}
 
 int rdev_set_freq(struct cfg80211_registered_device *rdev,
+                 struct wireless_dev *for_wdev,
                  int freq, enum nl80211_channel_type channel_type)
 {
        struct ieee80211_channel *chan;
        struct ieee80211_sta_ht_cap *ht_cap;
        int result;
 
-       if (rdev_fixed_channel(rdev, NULL))
+       if (rdev_fixed_channel(rdev, for_wdev))
                return -EBUSY;
 
        if (!rdev->ops->set_channel)
 
 rdev_fixed_channel(struct cfg80211_registered_device *rdev,
                   struct wireless_dev *for_wdev);
 int rdev_set_freq(struct cfg80211_registered_device *rdev,
+                 struct wireless_dev *for_wdev,
                  int freq, enum nl80211_channel_type channel_type);
 
 #endif /* __NET_WIRELESS_CORE_H */
 
                freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
 
                mutex_lock(&rdev->devlist_mtx);
-               result = rdev_set_freq(rdev, freq, channel_type);
+               result = rdev_set_freq(rdev, NULL, freq, channel_type);
                mutex_unlock(&rdev->devlist_mtx);
                if (result)
                        goto bad_res;
 
                if (freq == 0)
                        return -EINVAL;
                mutex_lock(&rdev->devlist_mtx);
-               err = rdev_set_freq(rdev, freq, NL80211_CHAN_NO_HT);
+               err = rdev_set_freq(rdev, NULL, freq, NL80211_CHAN_NO_HT);
                mutex_unlock(&rdev->devlist_mtx);
                return err;
        }
 
 
        /* SSID is not set, we just want to switch channel */
        if (chan && !wdev->wext.connect.ssid_len) {
-               err = rdev_set_freq(rdev, freq, NL80211_CHAN_NO_HT);
+               err = rdev_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT);
                goto out;
        }