Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136168
b: refs/heads/master
c: 35a8efe
h: refs/heads/master
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 28, 2009
1 parent 5951857 commit 4e2b673
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 255e737eab645ec6037baeca04a5e0a7c3b1f459
refs/heads/master: 35a8efe1a67ba5d7bb7492f67f52ed2aa4925892
25 changes: 0 additions & 25 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
int err;
int layer2_update;

/* Prevent a race with changing the rate control algorithm */
if (!netif_running(dev))
return -ENETDOWN;

if (params->vlan) {
sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);

Expand Down Expand Up @@ -860,9 +856,6 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
struct sta_info *sta;
int err;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
Expand Down Expand Up @@ -913,9 +906,6 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
struct mesh_path *mpath;
struct sta_info *sta;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
Expand Down Expand Up @@ -1202,9 +1192,6 @@ static int ieee80211_scan(struct wiphy *wiphy,
{
struct ieee80211_sub_if_data *sdata;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_STATION &&
Expand All @@ -1220,9 +1207,6 @@ static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev,
{
struct ieee80211_sub_if_data *sdata;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_STATION)
Expand Down Expand Up @@ -1282,9 +1266,6 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_sub_if_data *sdata;
int ret;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_STATION)
Expand Down Expand Up @@ -1323,9 +1304,6 @@ static int ieee80211_deauth(struct wiphy *wiphy, struct net_device *dev,
{
struct ieee80211_sub_if_data *sdata;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);
if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP;
Expand All @@ -1339,9 +1317,6 @@ static int ieee80211_disassoc(struct wiphy *wiphy, struct net_device *dev,
{
struct ieee80211_sub_if_data *sdata;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != NL80211_IFTYPE_STATION)
Expand Down
40 changes: 40 additions & 0 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,11 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

err = drv->ops->add_station(&drv->wiphy, dev, mac_addr, &params);

out:
Expand Down Expand Up @@ -1808,6 +1813,11 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

err = drv->ops->change_mpath(&drv->wiphy, dev, dst, next_hop);

out:
Expand Down Expand Up @@ -1846,6 +1856,11 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

err = drv->ops->add_mpath(&drv->wiphy, dev, dst, next_hop);

out:
Expand Down Expand Up @@ -2380,6 +2395,11 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

if (drv->scan_req) {
err = -EBUSY;
goto out;
Expand Down Expand Up @@ -2641,6 +2661,11 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

if (!info->attrs[NL80211_ATTR_MAC]) {
err = -EINVAL;
goto out;
Expand Down Expand Up @@ -2709,6 +2734,11 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

if (!info->attrs[NL80211_ATTR_MAC] ||
!info->attrs[NL80211_ATTR_SSID]) {
err = -EINVAL;
Expand Down Expand Up @@ -2767,6 +2797,11 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

if (!info->attrs[NL80211_ATTR_MAC]) {
err = -EINVAL;
goto out;
Expand Down Expand Up @@ -2821,6 +2856,11 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
goto out;
}

if (!netif_running(dev)) {
err = -ENETDOWN;
goto out;
}

if (!info->attrs[NL80211_ATTR_MAC]) {
err = -EINVAL;
goto out;
Expand Down

0 comments on commit 4e2b673

Please sign in to comment.