Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315190
b: refs/heads/master
c: f4489eb
h: refs/heads/master
v: v3
  • Loading branch information
Michal Kazior authored and Johannes Berg committed Jun 29, 2012
1 parent eb4a979 commit 4b003c3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 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: ac800140c20e7ae51117e71289065bedd4930fc2
refs/heads/master: f4489ebeffa436c8427a20e2f05004e783708cde
3 changes: 3 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,9 @@ struct wireless_dev {
struct ieee80211_channel *preset_chan;
enum nl80211_channel_type preset_chantype;

/* for AP and mesh channel tracking */
struct ieee80211_channel *channel;

bool ps;
int ps_timeout;

Expand Down
4 changes: 3 additions & 1 deletion trunk/net/wireless/ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ static int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
return -ENOENT;

err = rdev->ops->stop_ap(&rdev->wiphy, dev);
if (!err)
if (!err) {
wdev->beacon_interval = 0;
wdev->channel = NULL;
}

return err;
}
Expand Down
18 changes: 14 additions & 4 deletions trunk/net/wireless/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
if (!err) {
memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
wdev->mesh_id_len = setup->mesh_id_len;
wdev->channel = setup->channel;
}

return err;
Expand All @@ -184,6 +185,7 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
enum nl80211_channel_type channel_type)
{
struct ieee80211_channel *channel;
int err;

channel = rdev_freq_to_chan(rdev, freq, channel_type);
if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy,
Expand All @@ -205,9 +207,14 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,

if (!netif_running(wdev->netdev))
return -ENETDOWN;
return rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
wdev->netdev,
channel);

err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
wdev->netdev,
channel);
if (!err)
wdev->channel = channel;

return err;
}

if (wdev->mesh_id_len)
Expand Down Expand Up @@ -249,8 +256,11 @@ static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
return -ENOTCONN;

err = rdev->ops->leave_mesh(&rdev->wiphy, dev);
if (!err)
if (!err) {
wdev->mesh_id_len = 0;
wdev->channel = NULL;
}

return err;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq,
if (WARN_ON(!chan))
goto out;

wdev->channel = chan;
nl80211_ch_switch_notify(rdev, dev, freq, type, GFP_KERNEL);
out:
wdev_unlock(wdev);
Expand Down
1 change: 1 addition & 0 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
wdev->preset_chan = params.channel;
wdev->preset_chantype = params.channel_type;
wdev->beacon_interval = params.beacon_interval;
wdev->channel = params.channel;
}
return err;
}
Expand Down

0 comments on commit 4b003c3

Please sign in to comment.