]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/iface.c
Blackfin arch: move EXPORT_SYMBOL to the place where it is actually defined
[linux-2.6-omap-h63xx.git] / net / mac80211 / iface.c
index 46082125f3e19f9e9a889ec26c87fcb7aa23f69b..5abbc3f07dd6eb4c035b697698c878450e444c1e 100644 (file)
@@ -435,7 +435,11 @@ static int ieee80211_stop(struct net_device *dev)
                break;
        case NL80211_IFTYPE_STATION:
        case NL80211_IFTYPE_ADHOC:
-               sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED;
+               /* Announce that we are leaving the network. */
+               if (sdata->u.sta.state != IEEE80211_STA_MLME_DISABLED)
+                       ieee80211_sta_deauthenticate(sdata,
+                                               WLAN_REASON_DEAUTH_LEAVING);
+
                memset(sdata->u.sta.bssid, 0, ETH_ALEN);
                del_timer_sync(&sdata->u.sta.timer);
                /*
@@ -694,6 +698,10 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
        if (type == sdata->vif.type)
                return 0;
 
+       /* Setting ad-hoc mode on non-IBSS channel is not supported. */
+       if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+               return -EOPNOTSUPP;
+
        /*
         * We could, here, on changes between IBSS/STA/MESH modes,
         * invoke an MLME function instead that disassociates etc.