int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
struct net_device *dev,
struct cfg80211_ibss_params *params);
-void cfg80211_clear_ibss(struct net_device *dev);
+void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
- struct net_device *dev);
+ struct net_device *dev, bool nowext);
#endif /* __NET_WIRELESS_CORE_H */
return 0;
}
-void cfg80211_clear_ibss(struct net_device *dev)
+void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
wdev->current_bss = NULL;
wdev->ssid_len = 0;
memset(wdev->bssid, 0, ETH_ALEN);
+#ifdef CONFIG_WIRELESS_EXT
+ if (!nowext)
+ wdev->wext.ssid_len = 0;
+#endif
}
int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
- struct net_device *dev)
+ struct net_device *dev, bool nowext)
{
int err;
if (err)
return err;
- cfg80211_clear_ibss(dev);
+ cfg80211_clear_ibss(dev, nowext);
return 0;
}
return 0;
if (wdev->ssid_len) {
- err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev);
+ err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
+ dev, true);
if (err)
return err;
}
return -EOPNOTSUPP;
if (wdev->ssid_len) {
- err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev);
+ err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
+ dev, true);
if (err)
return err;
}
data->flags = 1;
data->length = wdev->ssid_len;
memcpy(ssid, wdev->ssid, data->length);
- } else if (wdev->wext.ssid) {
+ } else if (wdev->wext.ssid && wdev->wext.ssid_len) {
data->flags = 1;
data->length = wdev->wext.ssid_len;
memcpy(ssid, wdev->wext.ssid, data->length);
return 0;
if (wdev->ssid_len) {
- err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev);
+ err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
+ dev, true);
if (err)
return err;
}
if (dev && !err && (ntype != otype)) {
if (otype == NL80211_IFTYPE_ADHOC)
- cfg80211_clear_ibss(dev);
+ cfg80211_clear_ibss(dev, false);
}
unlock:
goto out;
}
- err = cfg80211_leave_ibss(drv, dev);
+ err = cfg80211_leave_ibss(drv, dev, false);
out:
cfg80211_put_dev(drv);