qcacmn: Replace duplicate api's of vdev_connected
Currently, the vdev connection status is checked by getting
the bss peer of that vdev, and if the bss peer is in associated
state then vdev connected status is sent as true. It can happen
vdev is present and bss peer is deleted after getting the bss peer
from vdev pointer. Then bss peer can not be dereferenced to get the
its status.
Instead remove all the duplicate api's tdls_is_vdev_connected,
pmo_core_is_vdev_connected, and wlan_vdev_is_connected with
wlan_vdev_is_up. wlan_vdev_is_up gives success status
if associated.
Change-Id: I863c3c0689f329870bd08c813813c16956135209
CRs-Fixed: 2426092
diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c
index 414fbf3..8d1da79 100644
--- a/os_if/linux/scan/src/wlan_cfg80211_scan.c
+++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c
@@ -79,7 +79,7 @@
if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE)
return;
- if (wlan_vdev_is_connected(vdev))
+ if (wlan_vdev_is_up(vdev) == QDF_STATUS_SUCCESS)
return;
*randomize = true;
diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h
index 2e8d892..9bee444 100644
--- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h
+++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h
@@ -1532,14 +1532,6 @@
}
/**
- * wlan_vdev_is_connected() - Check whether peer is associated or not
- * @vdev: pointer to objmgr vdev
- *
- * Return: true in case success else false
- */
-bool wlan_vdev_is_connected(struct wlan_objmgr_vdev *vdev);
-
-/**
* wlan_vdev_set_dp_handle() - set dp handle
* @vdev: vdev object pointer
* @dp_handle: Data path module handle
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
index 94407ce..c9e2036 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
@@ -869,29 +869,6 @@
}
qdf_export_symbol(wlan_objmgr_vdev_release_ref);
-bool wlan_vdev_is_connected(struct wlan_objmgr_vdev *vdev)
-{
- struct wlan_objmgr_peer *peer;
- enum wlan_peer_state peer_state;
-
- wlan_vdev_obj_lock(vdev);
- peer = wlan_vdev_get_bsspeer(vdev);
- wlan_vdev_obj_unlock(vdev);
-
- if (!peer)
- return false;
-
- wlan_peer_obj_lock(peer);
- peer_state = wlan_peer_mlme_get_state(peer);
- wlan_peer_obj_unlock(peer);
-
- if (peer_state != WLAN_ASSOC_STATE)
- return false;
-
- return true;
-}
-qdf_export_symbol(wlan_vdev_is_connected);
-
struct wlan_objmgr_vdev *wlan_pdev_vdev_list_peek_active_head(
struct wlan_objmgr_pdev *pdev,
qdf_list_t *vdev_list, wlan_objmgr_ref_dbgid dbg_id)
diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
index 950abd5..8c4d7d4 100644
--- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
@@ -1786,7 +1786,7 @@
return false;
if ((wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE) ||
- wlan_vdev_is_connected(vdev))
+ wlan_vdev_is_up(vdev) == QDF_STATUS_SUCCESS)
return false;
if (!scan_obj->ie_whitelist.white_list)