Browse Source

qcacld-3.0: Use hdd api to check vdev state

Scan is rejected because in some failure condition
the disconnect event is not sent to the kernel.

Fix is when scan request is issued, check if current
vdev is connected using hdd api.

CRs-Fixed: 3593432
Change-Id: Ia230979a12f96f4a9972604f72ca4b888167403a
Amruta Kulkarni 1 year ago
parent
commit
4318520aca
1 changed files with 6 additions and 18 deletions
  1. 6 18
      core/hdd/src/wlan_hdd_scan.c

+ 6 - 18
core/hdd/src/wlan_hdd_scan.c

@@ -837,24 +837,11 @@ static void hdd_process_vendor_acs_response(struct hdd_adapter *adapter)
 
 #if defined(CFG80211_SCAN_RANDOM_MAC_ADDR) || \
 	(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
-#ifdef CFG80211_SINGLE_NETDEV_MULTI_LINK_SUPPORT
-static inline bool
-wlan_util_get_connected_status(struct wireless_dev *wdev)
-{
-	return wdev->connected;
-}
-#else
-static inline bool
-wlan_util_get_connected_status(struct wireless_dev *wdev)
-{
-	return !!wdev->current_bss;
-}
-#endif
 /**
  * wlan_hdd_vendor_scan_random_attr() - check and fill scan randomization attrs
  * @wiphy: Pointer to wiphy
  * @request: Pointer to scan request
- * @wdev: Pointer to wireless device
+ * @adapter: Pointer to hdd adapter
  * @tb: Pointer to nl attributes
  *
  * This function is invoked to check whether vendor scan needs
@@ -865,7 +852,7 @@ wlan_util_get_connected_status(struct wireless_dev *wdev)
  */
 static int wlan_hdd_vendor_scan_random_attr(struct wiphy *wiphy,
 					struct cfg80211_scan_request *request,
-					struct wireless_dev *wdev,
+					struct hdd_adapter *adapter,
 					struct nlattr **tb)
 {
 	uint32_t i;
@@ -875,7 +862,7 @@ static int wlan_hdd_vendor_scan_random_attr(struct wiphy *wiphy,
 		return 0;
 
 	if (!(wiphy->features & NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR) ||
-	    (wlan_util_get_connected_status(wdev))) {
+	    (hdd_cm_is_vdev_connected(adapter->deflink))) {
 		hdd_err("SCAN RANDOMIZATION not supported");
 		return -EOPNOTSUPP;
 	}
@@ -917,7 +904,7 @@ static int wlan_hdd_vendor_scan_random_attr(struct wiphy *wiphy,
 #else
 static int wlan_hdd_vendor_scan_random_attr(struct wiphy *wiphy,
 					struct cfg80211_scan_request *request,
-					struct wireless_dev *wdev,
+					struct hdd_adapter *adapter,
 					struct nlattr **tb)
 {
 	return 0;
@@ -1128,7 +1115,8 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 			goto error;
 		}
 
-		if (wlan_hdd_vendor_scan_random_attr(wiphy, request, wdev, tb))
+		if (wlan_hdd_vendor_scan_random_attr(wiphy, request,
+						     adapter, tb))
 			goto error;
 	}