Browse Source

qcacmn: Add APIs to check roam substate state in connection manager

Add APIs to check roam substate state in connection manager.

Change-Id: I1c91e4e0bcb971d66bdf5d44af96d4049f991dfd
CRs-Fixed: 2847369
Abhishek Singh 4 years ago
parent
commit
a945925ad3

+ 50 - 1
umac/mlme/connection_mgr/core/src/wlan_cm_main_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015, 2020-2021, 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 above
@@ -760,6 +760,15 @@ bool cm_is_vdev_connecting(struct wlan_objmgr_vdev *vdev);
  */
 bool cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * cm_is_vdev_active() - check if vdev is in active state ie conneted or roaming
+ * state
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool cm_is_vdev_active(struct wlan_objmgr_vdev *vdev);
+
 /**
  * cm_is_vdev_disconnecting() - check if vdev is in disconneting state
  * @vdev: vdev pointer
@@ -784,6 +793,46 @@ bool cm_is_vdev_disconnected(struct wlan_objmgr_vdev *vdev);
  */
 bool cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev);
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * cm_is_vdev_roam_started() - check if vdev is in roaming state and
+ * roam started sub stated
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * cm_is_vdev_roam_sync_inprogress() - check if vdev is in roaming state
+ * and roam sync substate
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev);
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+/**
+ * cm_is_vdev_roam_preauth_state() - check if vdev is in roaming state and
+ * preauth is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * cm_is_vdev_roam_reassoc_state() - check if vdev is in roaming state
+ * and reassoc is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev);
+#endif
+
 /**
  * cm_get_active_req_type() - CM active req type
  * @vdev: vdev pointer

+ 94 - 1
umac/mlme/connection_mgr/core/src/wlan_cm_util.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015, 2020-2021, 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 above
@@ -871,6 +871,23 @@ bool cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev)
 	return false;
 }
 
+bool cm_is_vdev_active(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+	enum wlan_cm_sm_state state;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		return false;
+
+	state = cm_get_state(cm_ctx);
+
+	if (state == WLAN_CM_S_CONNECTED || state == WLAN_CM_S_ROAMING)
+		return true;
+
+	return false;
+}
+
 bool cm_is_vdev_disconnecting(struct wlan_objmgr_vdev *vdev)
 {
 	struct cnx_mgr *cm_ctx;
@@ -922,6 +939,82 @@ bool cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev)
 	return false;
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+bool cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+	enum wlan_cm_sm_state state;
+	enum wlan_cm_sm_state sub_state;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		return false;
+
+	state = cm_get_state(cm_ctx);
+	sub_state = cm_get_sub_state(cm_ctx);
+	if (state == WLAN_CM_S_ROAMING && sub_state == WLAN_CM_SS_ROAM_STARTED)
+		return true;
+
+	return false;
+}
+
+bool cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+	enum wlan_cm_sm_state state;
+	enum wlan_cm_sm_state sub_state;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		return false;
+
+	state = cm_get_state(cm_ctx);
+	sub_state = cm_get_sub_state(cm_ctx);
+	if (state == WLAN_CM_S_ROAMING && sub_state == WLAN_CM_SS_ROAM_SYNC)
+		return true;
+
+	return false;
+}
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+bool cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+	enum wlan_cm_sm_state state;
+	enum wlan_cm_sm_state sub_state;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		return false;
+
+	state = cm_get_state(cm_ctx);
+	sub_state = cm_get_sub_state(cm_ctx);
+	if (state == WLAN_CM_S_ROAMING && sub_state == WLAN_CM_SS_PREAUTH)
+		return true;
+
+	return false;
+}
+
+bool cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+	enum wlan_cm_sm_state state;
+	enum wlan_cm_sm_state sub_state;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx)
+		return false;
+
+	state = cm_get_state(cm_ctx);
+	sub_state = cm_get_sub_state(cm_ctx);
+	if (state == WLAN_CM_S_ROAMING && sub_state == WLAN_CM_SS_REASSOC)
+		return true;
+
+	return false;
+}
+#endif
+
 enum wlan_cm_active_request_type
 cm_get_active_req_type(struct wlan_objmgr_vdev *vdev)
 {

+ 73 - 1
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021 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 above
@@ -171,6 +171,15 @@ bool wlan_cm_is_vdev_connecting(struct wlan_objmgr_vdev *vdev);
  */
 bool wlan_cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * wlan_cm_is_vdev_active() - check if vdev is in active state ie conneted or
+ * roaming state
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_vdev_active(struct wlan_objmgr_vdev *vdev);
+
 /**
  * wlan_cm_is_vdev_disconnecting() - check if vdev is in disconneting state
  * @vdev: vdev pointer
@@ -195,6 +204,69 @@ bool wlan_cm_is_vdev_disconnected(struct wlan_objmgr_vdev *vdev);
  */
 bool wlan_cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev);
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * wlan_cm_is_vdev_roam_started() - check if vdev is in roaming state and
+ * roam started sub stated
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * wlan_cm_is_vdev_roam_sync_inprogress() - check if vdev is in roaming state
+ * and roam sync substate
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev);
+#else
+static inline bool wlan_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
+static inline
+bool wlan_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+/**
+ * wlan_cm_is_vdev_roam_preauth_state() - check if vdev is in roaming state and
+ * preauth is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * wlan_cm_is_vdev_roam_reassoc_state() - check if vdev is in roaming state
+ * and reassoc is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool wlan_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev);
+#else
+static inline
+bool wlan_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
+static inline
+bool wlan_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+#endif
+
 /**
  * wlan_cm_get_active_connect_req() - Get copy of active connect request
  * @vdev: vdev pointer

+ 73 - 1
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-2021 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 above
@@ -79,6 +79,15 @@ bool ucfg_cm_is_vdev_connecting(struct wlan_objmgr_vdev *vdev);
  */
 bool ucfg_cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * ucfg_cm_is_vdev_active() - check if vdev is in active state ie conneted or
+ * roaming state
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool ucfg_cm_is_vdev_active(struct wlan_objmgr_vdev *vdev);
+
 /**
  * ucfg_cm_is_vdev_disconnecting() - check if vdev is in disconneting state
  * @vdev: vdev pointer
@@ -103,6 +112,69 @@ bool ucfg_cm_is_vdev_disconnected(struct wlan_objmgr_vdev *vdev);
  */
 bool ucfg_cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev);
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * ucfg_cm_is_vdev_roam_started() - check if vdev is in roaming state and
+ * roam started sub stated
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool ucfg_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * ucfg_cm_is_vdev_roam_sync_inprogress() - check if vdev is in roaming state
+ * and roam sync substate
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool ucfg_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev);
+#else
+static inline bool ucfg_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
+static inline
+bool ucfg_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+/**
+ * ucfg_cm_is_vdev_roam_preauth_state() - check if vdev is in roaming state and
+ * preauth is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool ucfg_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * ucfg_cm_is_vdev_roam_reassoc_state() - check if vdev is in roaming state
+ * and reassoc is in progress
+ * @vdev: vdev pointer
+ *
+ * Return: bool
+ */
+bool ucfg_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev);
+#else
+static inline
+bool ucfg_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
+static inline
+bool ucfg_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+#endif
+
 /**
  * ucfg_cm_reason_code_to_str() - return string conversion of reason code
  * @reason: reason code.

+ 30 - 1
umac/mlme/connection_mgr/dispatcher/src/wlan_cm_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015, 2020-2021, 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 above
@@ -117,6 +117,11 @@ bool wlan_cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev)
 	return cm_is_vdev_connected(vdev);
 }
 
+bool wlan_cm_is_vdev_active(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_active(vdev);
+}
+
 bool wlan_cm_is_vdev_disconnecting(struct wlan_objmgr_vdev *vdev)
 {
 	return cm_is_vdev_disconnecting(vdev);
@@ -132,6 +137,30 @@ bool wlan_cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev)
 	return cm_is_vdev_roaming(vdev);
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+bool wlan_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_started(vdev);
+}
+
+bool wlan_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_sync_inprogress(vdev);
+}
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+bool wlan_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_preauth_state(vdev);
+}
+
+bool wlan_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_reassoc_state(vdev);
+}
+#endif
+
 enum wlan_cm_active_request_type
 wlan_cm_get_active_req_type(struct wlan_objmgr_vdev *vdev)
 {

+ 31 - 1
umac/mlme/connection_mgr/dispatcher/src/wlan_cm_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015, 2020-2021, 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 above
@@ -52,6 +52,11 @@ bool ucfg_cm_is_vdev_connected(struct wlan_objmgr_vdev *vdev)
 	return cm_is_vdev_connected(vdev);
 }
 
+bool ucfg_cm_is_vdev_active(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_active(vdev);
+}
+
 bool ucfg_cm_is_vdev_disconnecting(struct wlan_objmgr_vdev *vdev)
 {
 	return cm_is_vdev_disconnecting(vdev);
@@ -66,3 +71,28 @@ bool ucfg_cm_is_vdev_roaming(struct wlan_objmgr_vdev *vdev)
 {
 	return cm_is_vdev_roaming(vdev);
 }
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+bool ucfg_cm_is_vdev_roam_started(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_started(vdev);
+}
+
+bool ucfg_cm_is_vdev_roam_sync_inprogress(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_sync_inprogress(vdev);
+}
+#endif
+
+#ifdef WLAN_FEATURE_HOST_ROAM
+bool ucfg_cm_is_vdev_roam_preauth_state(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_preauth_state(vdev);
+}
+
+bool ucfg_cm_is_vdev_roam_reassoc_state(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_is_vdev_roam_reassoc_state(vdev);
+}
+#endif
+