From: Kalle Valo <kalle.valo@iki.fi>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 8/9] wl1251: use mac80211 provided channel parameters in scanning
Date: Sun, 03 Jan 2010 23:08:14 +0200 [thread overview]
Message-ID: <20100103210814.29287.10294.stgit@tikku> (raw)
In-Reply-To: <20100103210552.29287.20384.stgit@tikku>
From: Kalle Valo <kalle.valo@nokia.com>
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>
---
drivers/net/wireless/wl12xx/wl1251_cmd.c | 3 ++-
drivers/net/wireless/wl12xx/wl1251_cmd.h | 5 +++++
drivers/net/wireless/wl12xx/wl1251_main.c | 3 ++-
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 fcbfbd7..0320b47 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.c
@@ -412,6 +412,7 @@ out:
}
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)
{
struct wl1251_cmd_scan *cmd;
@@ -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);
cmd->channels[i].early_termination = 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;
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.h b/drivers/net/wireless/wl12xx/wl1251_cmd.h
index 63ae319..4ad67ca 100644
--- a/drivers/net/wireless/wl12xx/wl1251_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1251_cmd.h
@@ -27,6 +27,8 @@
#include "wl1251.h"
+#include <net/cfg80211.h>
+
struct acx_header;
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,
int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id,
void *buf, size_t buf_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);
int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout);
@@ -169,6 +172,8 @@ struct cmd_read_write_memory {
#define WL1251_SCAN_MIN_DURATION 30000
#define WL1251_SCAN_MAX_DURATION 60000
+#define WL1251_SCAN_NUM_PROBES 3
+
struct wl1251_scan_parameters {
u32 rx_config_options;
u32 rx_filter_options;
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 1db9722..4728983 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,
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) {
wl->scanning = false;
goto out_sleep;
next prev parent reply other threads:[~2010-01-03 21:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-03 21:07 [PATCH 0/9] mac80211: templates for drivers Kalle Valo
2010-01-03 21:07 ` [PATCH 1/9] mac80211: add functions to create PS Poll and Nullfunc templates Kalle Valo
2010-01-03 21:07 ` [PATCH 2/9] mac80211: use PS Poll and Nullfunc templates when sending such frames Kalle Valo
2010-01-03 21:07 ` [PATCH 3/9] wl1251: get PS Poll and Nullfunc templates from mac80211 Kalle Valo
2010-01-03 21:07 ` [PATCH 4/9] mac80211: create Probe Request template Kalle Valo
2010-01-05 9:21 ` Johannes Berg
2010-01-05 10:15 ` Kalle Valo
2010-01-05 10:23 ` Johannes Berg
2010-01-03 21:07 ` [PATCH 5/9] mac80211: use Probe Request template when sending a direct scan Kalle Valo
2010-01-03 21:08 ` [PATCH 6/9] wl1251: cleanup scanning code Kalle Valo
2010-01-03 21:08 ` [PATCH 7/9] wl1251: get probe request template from mac80211 Kalle Valo
2010-01-03 21:08 ` Kalle Valo [this message]
2010-01-03 21:08 ` [PATCH 9/9] wl1251: fix sleep related error paths in wl1251_op_bss_info_changed() Kalle Valo
2010-01-05 9:22 ` [PATCH 0/9] mac80211: templates for drivers Johannes Berg
2010-01-05 10:17 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100103210814.29287.10294.stgit@tikku \
--to=kalle.valo@iki.fi \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).