mac80211: switch to ieee80211_sdata_running
authorJohannes Berg <johannes.berg@intel.com>
Fri, 27 Aug 2010 10:35:55 +0000 (12:35 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Aug 2010 17:53:30 +0000 (13:53 -0400)
Since the introduction of ieee80211_sdata_running(),
some new code was introduced that uses netif_running()
instead. Switch all these instances over.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/cfg.c
net/mac80211/main.c
net/mac80211/util.c

index f149b4eb28d9acfe5efe47ea58c3fcc97b0522ff..f82b18e996b23a0ec9ae2c3b2ffc83603b50efb3 100644 (file)
@@ -81,16 +81,14 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
                             u8 key_idx, const u8 *mac_addr,
                             struct key_params *params)
 {
-       struct ieee80211_sub_if_data *sdata;
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct sta_info *sta = NULL;
        struct ieee80211_key *key;
        int err;
 
-       if (!netif_running(dev))
+       if (!ieee80211_sdata_running(sdata))
                return -ENETDOWN;
 
-       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
        /* reject WEP and TKIP keys if WEP failed to initialize */
        switch (params->cipher) {
        case WLAN_CIPHER_SUITE_WEP40:
index 964c267163a09b10f6c3a123c1ae327d8b844edb..93194f61adb0cc16e820fc6893abb0ccd112ac9e 100644 (file)
@@ -339,9 +339,6 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
        struct ieee80211_if_managed *ifmgd;
        int c = 0;
 
-       if (!netif_running(ndev))
-               return NOTIFY_DONE;
-
        /* Make sure it's our interface that got changed */
        if (!wdev)
                return NOTIFY_DONE;
@@ -352,6 +349,9 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
        sdata = IEEE80211_DEV_TO_SUB_IF(ndev);
        bss_conf = &sdata->vif.bss_conf;
 
+       if (!ieee80211_sdata_running(sdata))
+               return NOTIFY_DONE;
+
        /* ARP filtering is only supported in managed mode */
        if (sdata->vif.type != NL80211_IFTYPE_STATION)
                return NOTIFY_DONE;
index ef686d3b04e339c4bd22477bd9ffae4cebbf184b..d38b3767e8cc35caf8e4bfee9d0cb5ee7472eb6f 100644 (file)
@@ -1308,7 +1308,7 @@ void ieee80211_recalc_smps(struct ieee80211_local *local,
         */
 
        list_for_each_entry(sdata, &local->interfaces, list) {
-               if (!netif_running(sdata->dev))
+               if (!ieee80211_sdata_running(sdata))
                        continue;
                if (sdata->vif.type != NL80211_IFTYPE_STATION)
                        goto set;