Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95868
b: refs/heads/master
c: 636c5d4
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 1, 2008
1 parent 8e2b3c6 commit eb98be0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 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: e94e106831403d5028e7bb73c3163951134de1ba
refs/heads/master: 636c5d488bc0b349e01cf5bfbf85588134af70a0
44 changes: 27 additions & 17 deletions trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,6 @@ static int ieee80211_open(struct net_device *dev)
case IEEE80211_IF_TYPE_WDS:
if (!is_valid_ether_addr(sdata->u.wds.remote_addr))
return -ENOLINK;

/* Create STA entry for the WDS peer */
sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
GFP_KERNEL);
if (!sta)
return -ENOMEM;

sta->flags |= WLAN_STA_AUTHORIZED;

res = sta_info_insert(sta);
if (res) {
/* STA has been freed */
return res;
}
break;
case IEEE80211_IF_TYPE_VLAN:
if (!sdata->u.vlan.ap)
Expand Down Expand Up @@ -337,10 +323,8 @@ static int ieee80211_open(struct net_device *dev)
conf.type = sdata->vif.type;
conf.mac_addr = dev->dev_addr;
res = local->ops->add_interface(local_to_hw(local), &conf);
if (res && !local->open_count && local->ops->stop)
local->ops->stop(local_to_hw(local));
if (res)
return res;
goto err_stop;

ieee80211_if_config(dev);
ieee80211_reset_erp_info(dev);
Expand All @@ -353,9 +337,29 @@ static int ieee80211_open(struct net_device *dev)
netif_carrier_on(dev);
}

if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) {
/* Create STA entry for the WDS peer */
sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
GFP_KERNEL);
if (!sta) {
res = -ENOMEM;
goto err_del_interface;
}

sta->flags |= WLAN_STA_AUTHORIZED;

res = sta_info_insert(sta);
if (res) {
/* STA has been freed */
goto err_del_interface;
}
}

if (local->open_count == 0) {
res = dev_open(local->mdev);
WARN_ON(res);
if (res)
goto err_del_interface;
tasklet_enable(&local->tx_pending_tasklet);
tasklet_enable(&local->tasklet);
}
Expand Down Expand Up @@ -390,6 +394,12 @@ static int ieee80211_open(struct net_device *dev)
netif_start_queue(dev);

return 0;
err_del_interface:
local->ops->remove_interface(local_to_hw(local), &conf);
err_stop:
if (!local->open_count && local->ops->stop)
local->ops->stop(local_to_hw(local));
return res;
}

static int ieee80211_stop(struct net_device *dev)
Expand Down

0 comments on commit eb98be0

Please sign in to comment.