Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314214
b: refs/heads/master
c: d9b9d94
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jun 6, 2012
1 parent 60a9053 commit c23795e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 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: 9dc216d740e1210ccb3da533e2dab99a156300f9
refs/heads/master: d9b9d940ac2d1c03ec955dc921dd12e432a64e5c
28 changes: 8 additions & 20 deletions trunk/drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,27 +447,17 @@ static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,

/* Return valid, unused, channel for a passive scan to reset the RF */
static u8 iwl_get_single_channel_number(struct iwl_priv *priv,
enum ieee80211_band band)
enum ieee80211_band band)
{
const struct iwl_channel_info *ch_info;
int i;
u8 channel = 0;
u8 min, max;
struct ieee80211_supported_band *sband = priv->hw->wiphy->bands[band];
struct iwl_rxon_context *ctx;
int i;

if (band == IEEE80211_BAND_5GHZ) {
min = 14;
max = priv->channel_count;
} else {
min = 0;
max = 14;
}

for (i = min; i < max; i++) {
for (i = 0; i < sband->n_channels; i++) {
bool busy = false;

for_each_context(priv, ctx) {
busy = priv->channel_info[i].channel ==
busy = sband->channels[i].hw_value ==
le16_to_cpu(ctx->staging.channel);
if (busy)
break;
Expand All @@ -476,13 +466,11 @@ static u8 iwl_get_single_channel_number(struct iwl_priv *priv,
if (busy)
continue;

channel = priv->channel_info[i].channel;
ch_info = iwl_get_channel_info(priv, band, channel);
if (is_channel_valid(ch_info))
break;
if (!(sband->channels[i].flags & IEEE80211_CHAN_DISABLED))
return sband->channels[i].hw_value;
}

return channel;
return 0;
}

static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
Expand Down

0 comments on commit c23795e

Please sign in to comment.