* [PATCH 1/4] wl12xx: don't fail on AP scan
2012-02-02 11:54 [PATCH 0/4] wl12xx: some scan patches Eliad Peller
@ 2012-02-02 11:54 ` Eliad Peller
2012-02-02 11:54 ` [PATCH 2/4] wl12xx: increase max probe-req template size to WL1271_CMD_TEMPL_MAX_SIZE Eliad Peller
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2012-02-02 11:54 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
AP role uses its own role_id for scans, so there's
no reason to fail the scan if dev_role_id is invalid.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/scan.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 848a165..e3566ca 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -175,16 +175,17 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
if (passive)
scan_options |= WL1271_SCAN_OPT_PASSIVE;
- if (WARN_ON(wlvif->role_id == WL12XX_INVALID_ROLE_ID ||
- wlvif->dev_role_id == WL12XX_INVALID_ROLE_ID)) {
- ret = -EINVAL;
- goto out;
- }
- if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
+ if (wlvif->bss_type == BSS_TYPE_AP_BSS ||
+ test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
cmd->params.role_id = wlvif->role_id;
else
cmd->params.role_id = wlvif->dev_role_id;
+ if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
cmd->params.scan_options = cpu_to_le16(scan_options);
cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req,
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/4] wl12xx: increase max probe-req template size to WL1271_CMD_TEMPL_MAX_SIZE
2012-02-02 11:54 [PATCH 0/4] wl12xx: some scan patches Eliad Peller
2012-02-02 11:54 ` [PATCH 1/4] wl12xx: don't fail on AP scan Eliad Peller
@ 2012-02-02 11:54 ` Eliad Peller
2012-02-02 11:54 ` [PATCH 3/4] wl12xx: use split scan for normal scan Eliad Peller
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2012-02-02 11:54 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless, Ido Reis, Arik Nemtsov
From: Ido Reis <idor@ti.com>
Increase max scan IEs to allow big probe-req frames
Report a correct max-length for the scan IEs we can support, according
to the now larger size of the probe-req template.
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/init.c | 4 ++--
drivers/net/wireless/wl12xx/main.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index acc0379..203fbeb 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -42,14 +42,14 @@ int wl1271_init_templates_config(struct wl1271 *wl)
/* send empty templates for fw memory reservation */
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
- WL1271_CMD_TEMPL_DFLT_SIZE,
+ WL1271_CMD_TEMPL_MAX_SIZE,
0, WL1271_RATE_AUTOMATIC);
if (ret < 0)
return ret;
ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
CMD_TEMPL_CFG_PROBE_REQ_5,
- NULL, WL1271_CMD_TEMPL_DFLT_SIZE, 0,
+ NULL, WL1271_CMD_TEMPL_MAX_SIZE, 0,
WL1271_RATE_AUTOMATIC);
if (ret < 0)
return ret;
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index ad7f1fe..1a12d8c 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -4926,10 +4926,10 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
* should be the maximum length possible for a template, without
* the IEEE80211 header of the template
*/
- wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE -
+ wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
sizeof(struct ieee80211_header);
- wl->hw->wiphy->max_sched_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE -
+ wl->hw->wiphy->max_sched_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
sizeof(struct ieee80211_header);
wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] wl12xx: use split scan for normal scan
2012-02-02 11:54 [PATCH 0/4] wl12xx: some scan patches Eliad Peller
2012-02-02 11:54 ` [PATCH 1/4] wl12xx: don't fail on AP scan Eliad Peller
2012-02-02 11:54 ` [PATCH 2/4] wl12xx: increase max probe-req template size to WL1271_CMD_TEMPL_MAX_SIZE Eliad Peller
@ 2012-02-02 11:54 ` Eliad Peller
2012-02-02 11:54 ` [PATCH 4/4] wl12xx: add split_scan_timeout debugfs file Eliad Peller
2012-02-15 10:21 ` [PATCH 0/4] wl12xx: some scan patches Luciano Coelho
4 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2012-02-02 11:54 UTC (permalink / raw)
To: Luciano Coelho
Cc: linux-wireless, Eyal Shapira, Eyal Shapira, Igal Chernobelsky
From: Eyal Shapira <eyal@wizery.com>
Split scan allows the FW to schedule other activities
during a scan which may be a long operation. This is
achieved by setting a trigger TID to ANY_TID and a scan
trigger timeout other than 0. The default one is set to 50ms.
Signed-off-by: Eyal Shapira <eyal@wizey.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/conf.h | 8 ++++++++
drivers/net/wireless/wl12xx/main.c | 1 +
drivers/net/wireless/wl12xx/scan.c | 8 +++++---
drivers/net/wireless/wl12xx/scan.h | 2 +-
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index 823535c..cc50faa 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -1082,6 +1082,14 @@ struct conf_scan_settings {
*/
u16 num_probe_reqs;
+ /*
+ * Scan trigger (split scan) timeout. The FW will split the scan
+ * operation into slices of the given time and allow the FW to schedule
+ * other tasks in between.
+ *
+ * Range: u32 Microsecs
+ */
+ u32 split_scan_timeout;
};
struct conf_sched_scan_settings {
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 1a12d8c..52efe7d 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -272,6 +272,7 @@ static struct conf_drv_settings default_conf = {
.min_dwell_time_passive = 100000,
.max_dwell_time_passive = 100000,
.num_probe_reqs = 2,
+ .split_scan_timeout = 50000,
},
.sched_scan = {
/* sched_scan requires dwell times in TU instead of TU/1000 */
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index e3566ca..e43a6b2 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -172,6 +172,9 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
goto out;
}
+ if (wl->conf.scan.split_scan_timeout)
+ scan_options |= WL1271_SCAN_OPT_SPLIT_SCAN;
+
if (passive)
scan_options |= WL1271_SCAN_OPT_PASSIVE;
@@ -198,7 +201,7 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
cmd->params.tx_rate = cpu_to_le32(basic_rate);
cmd->params.n_probe_reqs = wl->conf.scan.num_probe_reqs;
- cmd->params.tid_trigger = 0;
+ cmd->params.tid_trigger = CONF_TX_AC_ANY_TID;
cmd->params.scan_tag = WL1271_SCAN_DEFAULT_TAG;
if (band == IEEE80211_BAND_2GHZ)
@@ -223,8 +226,7 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,
goto out;
}
- /* disable the timeout */
- trigger->timeout = 0;
+ trigger->timeout = cpu_to_le32(wl->conf.scan.split_scan_timeout);
ret = wl1271_cmd_send(wl, CMD_TRIGGER_SCAN_TO, trigger,
sizeof(*trigger), 0);
if (ret < 0) {
diff --git a/drivers/net/wireless/wl12xx/scan.h b/drivers/net/wireless/wl12xx/scan.h
index a7ed43d..96ff457 100644
--- a/drivers/net/wireless/wl12xx/scan.h
+++ b/drivers/net/wireless/wl12xx/scan.h
@@ -48,7 +48,7 @@ void wl1271_scan_sched_scan_results(struct wl1271 *wl);
#define WL1271_SCAN_CURRENT_TX_PWR 0
#define WL1271_SCAN_OPT_ACTIVE 0
#define WL1271_SCAN_OPT_PASSIVE 1
-#define WL1271_SCAN_OPT_TRIGGERED_SCAN 2
+#define WL1271_SCAN_OPT_SPLIT_SCAN 2
#define WL1271_SCAN_OPT_PRIORITY_HIGH 4
/* scan even if we fail to enter psm */
#define WL1271_SCAN_OPT_FORCE 8
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/4] wl12xx: add split_scan_timeout debugfs file
2012-02-02 11:54 [PATCH 0/4] wl12xx: some scan patches Eliad Peller
` (2 preceding siblings ...)
2012-02-02 11:54 ` [PATCH 3/4] wl12xx: use split scan for normal scan Eliad Peller
@ 2012-02-02 11:54 ` Eliad Peller
2012-02-15 10:21 ` [PATCH 0/4] wl12xx: some scan patches Luciano Coelho
4 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2012-02-02 11:54 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless, Eyal Shapira, Eyal Shapira
From: Eyal Shapira <eyal@wizery.com>
Add control over split_scan_timeout through
debugfs. Values are in ms while 0 will disable split scan.
Signed-off-by: Eyal Shapira <eyal@wizey.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/debugfs.c | 43 +++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index f063c70..00dbe15 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -445,6 +445,48 @@ static const struct file_operations forced_ps_ops = {
.llseek = default_llseek,
};
+static ssize_t split_scan_timeout_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct wl1271 *wl = file->private_data;
+
+ return wl1271_format_buffer(user_buf, count,
+ ppos, "%d\n",
+ wl->conf.scan.split_scan_timeout / 1000);
+}
+
+static ssize_t split_scan_timeout_write(struct file *file,
+ const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct wl1271 *wl = file->private_data;
+ unsigned long value;
+ int ret;
+
+ ret = kstrtoul_from_user(user_buf, count, 10, &value);
+ if (ret < 0) {
+ wl1271_warning("illegal value in split_scan_timeout");
+ return -EINVAL;
+ }
+
+ if (value == 0)
+ wl1271_info("split scan will be disabled");
+
+ mutex_lock(&wl->mutex);
+
+ wl->conf.scan.split_scan_timeout = value * 1000;
+
+ mutex_unlock(&wl->mutex);
+ return count;
+}
+
+static const struct file_operations split_scan_timeout_ops = {
+ .read = split_scan_timeout_read,
+ .write = split_scan_timeout_write,
+ .open = wl1271_open_file_generic,
+ .llseek = default_llseek,
+};
+
static ssize_t driver_state_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
@@ -1082,6 +1124,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl,
DEBUGFS_ADD(beacon_filtering, rootdir);
DEBUGFS_ADD(dynamic_ps_timeout, rootdir);
DEBUGFS_ADD(forced_ps, rootdir);
+ DEBUGFS_ADD(split_scan_timeout, rootdir);
streaming = debugfs_create_dir("rx_streaming", rootdir);
if (!streaming || IS_ERR(streaming))
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/4] wl12xx: some scan patches
2012-02-02 11:54 [PATCH 0/4] wl12xx: some scan patches Eliad Peller
` (3 preceding siblings ...)
2012-02-02 11:54 ` [PATCH 4/4] wl12xx: add split_scan_timeout debugfs file Eliad Peller
@ 2012-02-15 10:21 ` Luciano Coelho
4 siblings, 0 replies; 6+ messages in thread
From: Luciano Coelho @ 2012-02-15 10:21 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Thu, 2012-02-02 at 13:54 +0200, Eliad Peller wrote:
> fix some various scan issues
>
> Eliad Peller (1):
> wl12xx: don't fail on AP scan
>
> Eyal Shapira (2):
> wl12xx: use split scan for normal scan
> wl12xx: add split_scan_timeout debugfs file
>
> Ido Reis (1):
> wl12xx: increase max probe-req template size to
> WL1271_CMD_TEMPL_MAX_SIZE
>
> drivers/net/wireless/wl12xx/conf.h | 8 ++++++
> drivers/net/wireless/wl12xx/debugfs.c | 43 +++++++++++++++++++++++++++++++++
> drivers/net/wireless/wl12xx/init.c | 4 +-
> drivers/net/wireless/wl12xx/main.c | 5 ++-
> drivers/net/wireless/wl12xx/scan.c | 21 +++++++++-------
> drivers/net/wireless/wl12xx/scan.h | 2 +-
> 6 files changed, 69 insertions(+), 14 deletions(-)
Applied these 4 patches, thanks!
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 6+ messages in thread