aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2010-01-05 13:17:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 13:51:26 -0500
commitdc52f0a8e50303eb67ff8856cd8d1b461462ceec (patch)
tree6f71ce1a4ac471fe6803a5482a4e58817ad27b9c /drivers
parente477c56e852c4c6db1f7665c642c9f45f76616a9 (diff)
wl1251: use mac80211 provided channel parameters in scanning
The number of channels to be used in scan was hard coded in wl1251. The proper way is to use the channels array provided by mac80211. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_cmd.c3
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_cmd.h5
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.c b/drivers/net/wireless/wl12xx/wl1251_cmd.c
index fcbfbd7585f..0320b478bb3 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.c
@@ -412,6 +412,7 @@ out:
412} 412}
413 413
414int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, 414int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
415 struct ieee80211_channel *channels[],
415 unsigned int n_channels, unsigned int n_probes) 416 unsigned int n_channels, unsigned int n_probes)
416{ 417{
417 struct wl1251_cmd_scan *cmd; 418 struct wl1251_cmd_scan *cmd;
@@ -442,7 +443,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
442 memset(&cmd->channels[i].bssid_msb, 0xff, 2); 443 memset(&cmd->channels[i].bssid_msb, 0xff, 2);
443 cmd->channels[i].early_termination = 0; 444 cmd->channels[i].early_termination = 0;
444 cmd->channels[i].tx_power_att = 0; 445 cmd->channels[i].tx_power_att = 0;
445 cmd->channels[i].channel = i + 1; 446 cmd->channels[i].channel = channels[i]->hw_value;
446 } 447 }
447 448
448 cmd->params.ssid_len = ssid_len; 449 cmd->params.ssid_len = ssid_len;
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.h b/drivers/net/wireless/wl12xx/wl1251_cmd.h
index 63ae3193f7c..4ad67cae94d 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.h
@@ -27,6 +27,8 @@
27 27
28#include "wl1251.h" 28#include "wl1251.h"
29 29
30#include <net/cfg80211.h>
31
30struct acx_header; 32struct acx_header;
31 33
32int wl1251_cmd_send(struct wl1251 *wl, u16 type, void *buf, size_t buf_len); 34int wl1251_cmd_send(struct wl1251 *wl, u16 type, void *buf, size_t buf_len);
@@ -44,6 +46,7 @@ int wl1251_cmd_read_memory(struct wl1251 *wl, u32 addr, void *answer,
44int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id, 46int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id,
45 void *buf, size_t buf_len); 47 void *buf, size_t buf_len);
46int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, 48int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
49 struct ieee80211_channel *channels[],
47 unsigned int n_channels, unsigned int n_probes); 50 unsigned int n_channels, unsigned int n_probes);
48int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout); 51int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout);
49 52
@@ -169,6 +172,8 @@ struct cmd_read_write_memory {
169#define WL1251_SCAN_MIN_DURATION 30000 172#define WL1251_SCAN_MIN_DURATION 30000
170#define WL1251_SCAN_MAX_DURATION 60000 173#define WL1251_SCAN_MAX_DURATION 60000
171 174
175#define WL1251_SCAN_NUM_PROBES 3
176
172struct wl1251_scan_parameters { 177struct wl1251_scan_parameters {
173 u32 rx_config_options; 178 u32 rx_config_options;
174 u32 rx_filter_options; 179 u32 rx_filter_options;
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 1db97229af4..4728983b438 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -878,7 +878,8 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
878 878
879 wl->scanning = true; 879 wl->scanning = true;
880 880
881 ret = wl1251_cmd_scan(wl, ssid, ssid_len, 13, 3); 881 ret = wl1251_cmd_scan(wl, ssid, ssid_len, req->channels,
882 req->n_channels, WL1251_SCAN_NUM_PROBES);
882 if (ret < 0) { 883 if (ret < 0) {
883 wl->scanning = false; 884 wl->scanning = false;
884 goto out_sleep; 885 goto out_sleep;