mac80211: convert to cfg80211 IBSS API
[safe/jmp/linux-2.6] / net / mac80211 / iface.c
index 6b56dc2..5242597 100644 (file)
@@ -235,11 +235,7 @@ static int ieee80211_open(struct net_device *dev)
                netif_addr_unlock_bh(local->mdev);
                break;
        case NL80211_IFTYPE_STATION:
-       case NL80211_IFTYPE_ADHOC:
-               if (sdata->vif.type == NL80211_IFTYPE_STATION)
-                       sdata->u.mgd.flags &= ~IEEE80211_STA_PREV_BSSID_SET;
-               else
-                       sdata->u.ibss.flags &= ~IEEE80211_IBSS_PREV_BSSID_SET;
+               sdata->u.mgd.flags &= ~IEEE80211_STA_PREV_BSSID_SET;
                /* fall through */
        default:
                conf.vif = &sdata->vif;
@@ -261,8 +257,7 @@ static int ieee80211_open(struct net_device *dev)
                ieee80211_bss_info_change_notify(sdata, changed);
                ieee80211_enable_keys(sdata);
 
-               if (sdata->vif.type == NL80211_IFTYPE_STATION &&
-                   !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME))
+               if (sdata->vif.type == NL80211_IFTYPE_STATION)
                        netif_carrier_off(dev);
                else
                        netif_carrier_on(dev);
@@ -318,6 +313,8 @@ static int ieee80211_open(struct net_device *dev)
                ieee80211_set_wmm_default(sdata);
        }
 
+       ieee80211_recalc_ps(local, -1);
+
        /*
         * ieee80211_sta_work is disabled while network interface
         * is down. Therefore, some configuration changes may not
@@ -326,8 +323,6 @@ static int ieee80211_open(struct net_device *dev)
         */
        if (sdata->vif.type == NL80211_IFTYPE_STATION)
                queue_work(local->hw.workqueue, &sdata->u.mgd.work);
-       else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-               queue_work(local->hw.workqueue, &sdata->u.ibss.work);
 
        netif_tx_start_all_queues(dev);
 
@@ -478,6 +473,9 @@ static int ieee80211_stop(struct net_device *dev)
                 */
                cancel_work_sync(&sdata->u.mgd.work);
                cancel_work_sync(&sdata->u.mgd.chswitch_work);
+
+               cancel_work_sync(&sdata->u.mgd.beacon_loss_work);
+
                /*
                 * When we get here, the interface is marked down.
                 * Call synchronize_rcu() to wait for the RX path
@@ -495,7 +493,6 @@ static int ieee80211_stop(struct net_device *dev)
                /* fall through */
        case NL80211_IFTYPE_ADHOC:
                if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
-                       memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
                        del_timer_sync(&sdata->u.ibss.timer);
                        cancel_work_sync(&sdata->u.ibss.work);
                        synchronize_rcu();
@@ -570,6 +567,8 @@ static int ieee80211_stop(struct net_device *dev)
                hw_reconf_flags = 0;
        }
 
+       ieee80211_recalc_ps(local, -1);
+
        /* do after stop to avoid reconfiguring when we stop anyway */
        if (hw_reconf_flags)
                ieee80211_hw_config(local, hw_reconf_flags);
@@ -647,19 +646,13 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
                        mesh_rmc_free(sdata);
                break;
        case NL80211_IFTYPE_ADHOC:
-               kfree_skb(sdata->u.ibss.probe_resp);
+               if (WARN_ON(sdata->u.ibss.presp))
+                       kfree_skb(sdata->u.ibss.presp);
                break;
        case NL80211_IFTYPE_STATION:
                kfree(sdata->u.mgd.extra_ie);
                kfree(sdata->u.mgd.assocreq_ies);
                kfree(sdata->u.mgd.assocresp_ies);
-               kfree(sdata->u.mgd.ie_probereq);
-               kfree(sdata->u.mgd.ie_proberesp);
-               kfree(sdata->u.mgd.ie_auth);
-               kfree(sdata->u.mgd.ie_assocreq);
-               kfree(sdata->u.mgd.ie_reassocreq);
-               kfree(sdata->u.mgd.ie_deauth);
-               kfree(sdata->u.mgd.ie_disassoc);
                kfree(sdata->u.mgd.sme_auth_ie);
                break;
        case NL80211_IFTYPE_WDS: