Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256216
b: refs/heads/master
c: d2c2bb9
h: refs/heads/master
v: v3
  • Loading branch information
Luciano Coelho committed Jun 27, 2011
1 parent e7493ad commit 88eac48
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 43 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: d192d268a1fb632148046b8efe9ab78e69890dd2
refs/heads/master: d2c2bb9fccdfe3cb70b276ae69e53d4890b11871
61 changes: 29 additions & 32 deletions trunk/drivers/net/wireless/wl12xx/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,15 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
struct cfg80211_sched_scan_request *req,
struct conn_scan_ch_params *channels,
u32 band, bool radar, bool passive,
int start)
int start, int max_channels)
{
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
int i, j;
u32 flags;
bool force_passive = !req->n_ssids;

for (i = 0, j = start;
i < req->n_channels && j < MAX_CHANNELS_ALL_BANDS;
i < req->n_channels && j < max_channels;
i++) {
flags = req->channels[i]->flags;

Expand Down Expand Up @@ -380,54 +380,52 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
return j - start;
}

static int
static bool
wl1271_scan_sched_scan_channels(struct wl1271 *wl,
struct cfg80211_sched_scan_request *req,
struct wl1271_cmd_sched_scan_config *cfg)
{
int idx = 0;

cfg->passive[0] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
IEEE80211_BAND_2GHZ,
false, true, idx);
idx += cfg->passive[0];

false, true, 0,
MAX_CHANNELS_2GHZ);
cfg->active[0] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_2,
IEEE80211_BAND_2GHZ,
false, false, idx);
/*
* 5GHz channels always start at position 14, not immediately
* after the last 2.4GHz channel
*/
idx = 14;

false, false,
cfg->passive[0],
MAX_CHANNELS_2GHZ);
cfg->passive[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
IEEE80211_BAND_5GHZ,
false, true, idx);
idx += cfg->passive[1];

false, true, 0,
MAX_CHANNELS_5GHZ);
cfg->dfs =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
IEEE80211_BAND_5GHZ,
true, true, idx);
idx += cfg->dfs;

true, true,
cfg->passive[1],
MAX_CHANNELS_5GHZ);
cfg->active[1] =
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels,
wl1271_scan_get_sched_scan_channels(wl, req, cfg->channels_5,
IEEE80211_BAND_5GHZ,
false, false, idx);
idx += cfg->active[1];
false, false,
cfg->passive[1] + cfg->dfs,
MAX_CHANNELS_5GHZ);
/* 802.11j channels are not supported yet */
cfg->passive[2] = 0;
cfg->active[2] = 0;

wl1271_debug(DEBUG_SCAN, " 2.4GHz: active %d passive %d",
cfg->active[0], cfg->passive[0]);
wl1271_debug(DEBUG_SCAN, " 5GHz: active %d passive %d",
cfg->active[1], cfg->passive[1]);
wl1271_debug(DEBUG_SCAN, " DFS: %d", cfg->dfs);

return idx;
return cfg->passive[0] || cfg->active[0] ||
cfg->passive[1] || cfg->active[1] || cfg->dfs ||
cfg->passive[2] || cfg->active[2];
}

int wl1271_scan_sched_scan_config(struct wl1271 *wl,
Expand All @@ -436,7 +434,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
{
struct wl1271_cmd_sched_scan_config *cfg = NULL;
struct conf_sched_scan_settings *c = &wl->conf.sched_scan;
int i, total_channels, ret;
int i, ret;
bool force_passive = !req->n_ssids;

wl1271_debug(DEBUG_CMD, "cmd sched_scan scan config");
Expand Down Expand Up @@ -471,8 +469,7 @@ int wl1271_scan_sched_scan_config(struct wl1271 *wl,
cfg->ssid_len = 0;
}

total_channels = wl1271_scan_sched_scan_channels(wl, req, cfg);
if (total_channels == 0) {
if (!wl1271_scan_sched_scan_channels(wl, req, cfg)) {
wl1271_error("scan channel list is empty");
ret = -EINVAL;
goto out;
Expand Down
17 changes: 7 additions & 10 deletions trunk/drivers/net/wireless/wl12xx/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,13 @@ struct wl1271_cmd_trigger_scan_to {
__le32 timeout;
} __packed;

#define MAX_CHANNELS_ALL_BANDS 41
#define MAX_CHANNELS_2GHZ 14
#define MAX_CHANNELS_5GHZ 23
#define MAX_CHANNELS_4GHZ 4

#define SCAN_MAX_CYCLE_INTERVALS 16
#define SCAN_MAX_BANDS 3

enum {
SCAN_CHANNEL_TYPE_2GHZ_PASSIVE,
SCAN_CHANNEL_TYPE_2GHZ_ACTIVE,
SCAN_CHANNEL_TYPE_5GHZ_PASSIVE,
SCAN_CHANNEL_TYPE_5GHZ_ACTIVE,
SCAN_CHANNEL_TYPE_5GHZ_DFS,
};

enum {
SCAN_SSID_FILTER_ANY = 0,
SCAN_SSID_FILTER_SPECIFIC = 1,
Expand Down Expand Up @@ -182,7 +177,9 @@ struct wl1271_cmd_sched_scan_config {

u8 padding[3];

struct conn_scan_ch_params channels[MAX_CHANNELS_ALL_BANDS];
struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
} __packed;


Expand Down

0 comments on commit 88eac48

Please sign in to comment.