Browse Source

qcacld-3.0: Fix bad channel in cfg80211 get channel for SAP

The cfg80211 callback for get channel is returning invalid
channel in case of SAP as the check for is vdev associated
will return false for SAP mode.

Keep this check only for STA mode only so SAP can return
the valid channel in get_channel callback.

Change-Id: I5a03626291f0e20c8e07ae8fde48cb9eacafb2e4
CRs-Fixed: 3410453
Vinod Kumar Pirla 2 năm trước cách đây
mục cha
commit
3ec1adb554
1 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 8 5
      core/hdd/src/wlan_hdd_cfg80211.c

+ 8 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -25865,11 +25865,14 @@ static int __wlan_hdd_cfg80211_get_channel(struct wiphy *wiphy,
 	if (!vdev)
 		return -EINVAL;
 
-	vdev_id = wlan_vdev_get_id(vdev);
-	link_adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
-	if (link_adapter && !hdd_cm_is_vdev_associated(link_adapter)) {
-		wlan_key_put_link_vdev(vdev, WLAN_OSIF_ID);
-		return -EBUSY;
+	if (adapter->device_mode == QDF_STA_MODE) {
+		vdev_id = wlan_vdev_get_id(vdev);
+		link_adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
+		if (link_adapter &&
+		    !hdd_cm_is_vdev_associated(link_adapter)) {
+			wlan_key_put_link_vdev(vdev, WLAN_OSIF_ID);
+			return -EBUSY;
+		}
 	}
 
 	chan_freq = vdev->vdev_mlme.des_chan->ch_freq;