Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171377
b: refs/heads/master
c: 584991d
h: refs/heads/master
i:
  171375: 35b2700
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 2, 2009
1 parent de1df9f commit 513dfc4
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 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: 6c085227bd7168fd84976479218f81bf35b5acd7
refs/heads/master: 584991dccfd347cd2e1675ab262998f6c335d3c0
13 changes: 2 additions & 11 deletions trunk/net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,23 +614,14 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
{
int skip;
struct ieee80211_channel *chan;
struct ieee80211_sub_if_data *sdata = local->scan_sdata;

skip = 0;
chan = local->scan_req->channels[local->scan_channel_idx];

if (chan->flags & IEEE80211_CHAN_DISABLED ||
(sdata->vif.type == NL80211_IFTYPE_ADHOC &&
chan->flags & IEEE80211_CHAN_NO_IBSS))
local->scan_channel = chan;
if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL))
skip = 1;

if (!skip) {
local->scan_channel = chan;
if (ieee80211_hw_config(local,
IEEE80211_CONF_CHANGE_CHANNEL))
skip = 1;
}

/* advance state machine to next channel/band */
local->scan_channel_idx++;

Expand Down
34 changes: 27 additions & 7 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2988,7 +2988,6 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
goto out;
}

request->n_channels = n_channels;
if (n_ssids)
request->ssids = (void *)&request->channels[n_channels];
request->n_ssids = n_ssids;
Expand All @@ -2999,32 +2998,53 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
request->ie = (void *)(request->channels + n_channels);
}

i = 0;
if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) {
/* user specified, bail out if channel not found */
request->n_channels = n_channels;
i = 0;
nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_FREQUENCIES], tmp) {
request->channels[i] = ieee80211_get_channel(wiphy, nla_get_u32(attr));
if (!request->channels[i]) {
struct ieee80211_channel *chan;

chan = ieee80211_get_channel(wiphy, nla_get_u32(attr));

if (!chan) {
err = -EINVAL;
goto out_free;
}

/* ignore disabled channels */
if (chan->flags & IEEE80211_CHAN_DISABLED)
continue;

request->channels[i] = chan;
i++;
}
} else {
/* all channels */
i = 0;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
int j;
if (!wiphy->bands[band])
continue;
for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
request->channels[i] = &wiphy->bands[band]->channels[j];
struct ieee80211_channel *chan;

chan = &wiphy->bands[band]->channels[j];

if (chan->flags & IEEE80211_CHAN_DISABLED)
continue;

request->channels[i] = chan;
i++;
}
}
}

if (!i) {
err = -EINVAL;
goto out_free;
}

request->n_channels = i;

i = 0;
if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) {
nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) {
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,15 @@ int cfg80211_wext_siwscan(struct net_device *dev,
i = 0;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
int j;

if (!wiphy->bands[band])
continue;

for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
/* ignore disabled channels */
if (wiphy->bands[band]->channels[j].flags &
IEEE80211_CHAN_DISABLED)
continue;

/* If we have a wireless request structure and the
* wireless request specifies frequencies, then search
Expand Down

0 comments on commit 513dfc4

Please sign in to comment.