aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-27 06:35:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-27 13:53:30 -0400
commit26a58456be40d8181b884eb5b4e61e3f73ba94e0 (patch)
treed3284dcba4f286d1f666b1efca136c018791e692
parentb9dcf712d1fb98bf279fcd453a42a763b104961d (diff)
mac80211: switch to ieee80211_sdata_running
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>
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/main.c6
-rw-r--r--net/mac80211/util.c2
3 files changed, 6 insertions, 8 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f149b4eb28d9..f82b18e996b2 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -81,16 +81,14 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
81 u8 key_idx, const u8 *mac_addr, 81 u8 key_idx, const u8 *mac_addr,
82 struct key_params *params) 82 struct key_params *params)
83{ 83{
84 struct ieee80211_sub_if_data *sdata; 84 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
85 struct sta_info *sta = NULL; 85 struct sta_info *sta = NULL;
86 struct ieee80211_key *key; 86 struct ieee80211_key *key;
87 int err; 87 int err;
88 88
89 if (!netif_running(dev)) 89 if (!ieee80211_sdata_running(sdata))
90 return -ENETDOWN; 90 return -ENETDOWN;
91 91
92 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
93
94 /* reject WEP and TKIP keys if WEP failed to initialize */ 92 /* reject WEP and TKIP keys if WEP failed to initialize */
95 switch (params->cipher) { 93 switch (params->cipher) {
96 case WLAN_CIPHER_SUITE_WEP40: 94 case WLAN_CIPHER_SUITE_WEP40:
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 964c267163a0..93194f61adb0 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -339,9 +339,6 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
339 struct ieee80211_if_managed *ifmgd; 339 struct ieee80211_if_managed *ifmgd;
340 int c = 0; 340 int c = 0;
341 341
342 if (!netif_running(ndev))
343 return NOTIFY_DONE;
344
345 /* Make sure it's our interface that got changed */ 342 /* Make sure it's our interface that got changed */
346 if (!wdev) 343 if (!wdev)
347 return NOTIFY_DONE; 344 return NOTIFY_DONE;
@@ -352,6 +349,9 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
352 sdata = IEEE80211_DEV_TO_SUB_IF(ndev); 349 sdata = IEEE80211_DEV_TO_SUB_IF(ndev);
353 bss_conf = &sdata->vif.bss_conf; 350 bss_conf = &sdata->vif.bss_conf;
354 351
352 if (!ieee80211_sdata_running(sdata))
353 return NOTIFY_DONE;
354
355 /* ARP filtering is only supported in managed mode */ 355 /* ARP filtering is only supported in managed mode */
356 if (sdata->vif.type != NL80211_IFTYPE_STATION) 356 if (sdata->vif.type != NL80211_IFTYPE_STATION)
357 return NOTIFY_DONE; 357 return NOTIFY_DONE;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ef686d3b04e3..d38b3767e8cc 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1308,7 +1308,7 @@ void ieee80211_recalc_smps(struct ieee80211_local *local,
1308 */ 1308 */
1309 1309
1310 list_for_each_entry(sdata, &local->interfaces, list) { 1310 list_for_each_entry(sdata, &local->interfaces, list) {
1311 if (!netif_running(sdata->dev)) 1311 if (!ieee80211_sdata_running(sdata))
1312 continue; 1312 continue;
1313 if (sdata->vif.type != NL80211_IFTYPE_STATION) 1313 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1314 goto set; 1314 goto set;