Commit dc52f0a8 authored by Kalle Valo's avatar Kalle Valo Committed by John W. Linville

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: default avatarKalle Valo <kalle.valo@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e477c56e
...@@ -412,6 +412,7 @@ out: ...@@ -412,6 +412,7 @@ out:
} }
int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
struct ieee80211_channel *channels[],
unsigned int n_channels, unsigned int n_probes) unsigned int n_channels, unsigned int n_probes)
{ {
struct wl1251_cmd_scan *cmd; struct wl1251_cmd_scan *cmd;
...@@ -442,7 +443,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, ...@@ -442,7 +443,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
memset(&cmd->channels[i].bssid_msb, 0xff, 2); memset(&cmd->channels[i].bssid_msb, 0xff, 2);
cmd->channels[i].early_termination = 0; cmd->channels[i].early_termination = 0;
cmd->channels[i].tx_power_att = 0; cmd->channels[i].tx_power_att = 0;
cmd->channels[i].channel = i + 1; cmd->channels[i].channel = channels[i]->hw_value;
} }
cmd->params.ssid_len = ssid_len; cmd->params.ssid_len = ssid_len;
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "wl1251.h" #include "wl1251.h"
#include <net/cfg80211.h>
struct acx_header; struct acx_header;
int wl1251_cmd_send(struct wl1251 *wl, u16 type, void *buf, size_t buf_len); int 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, ...@@ -44,6 +46,7 @@ int wl1251_cmd_read_memory(struct wl1251 *wl, u32 addr, void *answer,
int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id, int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id,
void *buf, size_t buf_len); void *buf, size_t buf_len);
int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
struct ieee80211_channel *channels[],
unsigned int n_channels, unsigned int n_probes); unsigned int n_channels, unsigned int n_probes);
int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout); int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout);
...@@ -169,6 +172,8 @@ struct cmd_read_write_memory { ...@@ -169,6 +172,8 @@ struct cmd_read_write_memory {
#define WL1251_SCAN_MIN_DURATION 30000 #define WL1251_SCAN_MIN_DURATION 30000
#define WL1251_SCAN_MAX_DURATION 60000 #define WL1251_SCAN_MAX_DURATION 60000
#define WL1251_SCAN_NUM_PROBES 3
struct wl1251_scan_parameters { struct wl1251_scan_parameters {
u32 rx_config_options; u32 rx_config_options;
u32 rx_filter_options; u32 rx_filter_options;
......
...@@ -878,7 +878,8 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw, ...@@ -878,7 +878,8 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
wl->scanning = true; wl->scanning = true;
ret = wl1251_cmd_scan(wl, ssid, ssid_len, 13, 3); ret = wl1251_cmd_scan(wl, ssid, ssid_len, req->channels,
req->n_channels, WL1251_SCAN_NUM_PROBES);
if (ret < 0) { if (ret < 0) {
wl->scanning = false; wl->scanning = false;
goto out_sleep; goto out_sleep;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment