diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2009-03-20 15:21:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:05 -0400 |
commit | 35a8efe1a67ba5d7bb7492f67f52ed2aa4925892 (patch) | |
tree | 7783b27bebbc3f113a15ba0b884c24fb627c37a2 /net/mac80211 | |
parent | 255e737eab645ec6037baeca04a5e0a7c3b1f459 (diff) |
nl80211: Check that netif_runnin is true in cfg80211 code
We do not want to require all the drivers using cfg80211 to need to do
this or to be prepared to handle these commands when the interface is
down.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f5c15c9a00ce..b5810b4c79ac 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -728,10 +728,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
728 | int err; | 728 | int err; |
729 | int layer2_update; | 729 | int layer2_update; |
730 | 730 | ||
731 | /* Prevent a race with changing the rate control algorithm */ | ||
732 | if (!netif_running(dev)) | ||
733 | return -ENETDOWN; | ||
734 | |||
735 | if (params->vlan) { | 731 | if (params->vlan) { |
736 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 732 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
737 | 733 | ||
@@ -860,9 +856,6 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
860 | struct sta_info *sta; | 856 | struct sta_info *sta; |
861 | int err; | 857 | int err; |
862 | 858 | ||
863 | if (!netif_running(dev)) | ||
864 | return -ENETDOWN; | ||
865 | |||
866 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 859 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
867 | 860 | ||
868 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | 861 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
@@ -913,9 +906,6 @@ static int ieee80211_change_mpath(struct wiphy *wiphy, | |||
913 | struct mesh_path *mpath; | 906 | struct mesh_path *mpath; |
914 | struct sta_info *sta; | 907 | struct sta_info *sta; |
915 | 908 | ||
916 | if (!netif_running(dev)) | ||
917 | return -ENETDOWN; | ||
918 | |||
919 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 909 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
920 | 910 | ||
921 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | 911 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
@@ -1202,9 +1192,6 @@ static int ieee80211_scan(struct wiphy *wiphy, | |||
1202 | { | 1192 | { |
1203 | struct ieee80211_sub_if_data *sdata; | 1193 | struct ieee80211_sub_if_data *sdata; |
1204 | 1194 | ||
1205 | if (!netif_running(dev)) | ||
1206 | return -ENETDOWN; | ||
1207 | |||
1208 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1195 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1209 | 1196 | ||
1210 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | 1197 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
@@ -1220,9 +1207,6 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev, | |||
1220 | { | 1207 | { |
1221 | struct ieee80211_sub_if_data *sdata; | 1208 | struct ieee80211_sub_if_data *sdata; |
1222 | 1209 | ||
1223 | if (!netif_running(dev)) | ||
1224 | return -ENETDOWN; | ||
1225 | |||
1226 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1210 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1227 | 1211 | ||
1228 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 1212 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
@@ -1282,9 +1266,6 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev, | |||
1282 | struct ieee80211_sub_if_data *sdata; | 1266 | struct ieee80211_sub_if_data *sdata; |
1283 | int ret; | 1267 | int ret; |
1284 | 1268 | ||
1285 | if (!netif_running(dev)) | ||
1286 | return -ENETDOWN; | ||
1287 | |||
1288 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1269 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1289 | 1270 | ||
1290 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 1271 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
@@ -1323,9 +1304,6 @@ static int ieee80211_deauth(struct wiphy *wiphy, struct net_device *dev, | |||
1323 | { | 1304 | { |
1324 | struct ieee80211_sub_if_data *sdata; | 1305 | struct ieee80211_sub_if_data *sdata; |
1325 | 1306 | ||
1326 | if (!netif_running(dev)) | ||
1327 | return -ENETDOWN; | ||
1328 | |||
1329 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1307 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1330 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 1308 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
1331 | return -EOPNOTSUPP; | 1309 | return -EOPNOTSUPP; |
@@ -1339,9 +1317,6 @@ static int ieee80211_disassoc(struct wiphy *wiphy, struct net_device *dev, | |||
1339 | { | 1317 | { |
1340 | struct ieee80211_sub_if_data *sdata; | 1318 | struct ieee80211_sub_if_data *sdata; |
1341 | 1319 | ||
1342 | if (!netif_running(dev)) | ||
1343 | return -ENETDOWN; | ||
1344 | |||
1345 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1320 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1346 | 1321 | ||
1347 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 1322 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |