* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
@ 2013-12-10 22:16 Ивайло Димитров
0 siblings, 0 replies; 7+ messages in thread
From: Ивайло Димитров @ 2013-12-10 22:16 UTC (permalink / raw)
To: Pali Rohár
Cc: kvalo, pavel, luca, linville, linux-wireless, netdev,
linux-kernel, aaro.koskinen, sre, joni.lapilainen, johannes,
felipe.contreras, david.gnedt
>-------- Оригинално писмо --------
>От: Pali Rohár
>Относно: Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
>До: Kalle Valo ,
Pavel Machek
>Изпратено на: Вторник, 2013, Декември 10 19:08:44 EET
>
>
>On Tuesday 10 December 2013 16:41:04 Kalle Valo wrote:
>> Pavel Machek writes:
>> > ssids can have \0s in them... and what is worse, they may
>> > not be 0 terminated AFAICT.
>> >
>> > Potential solution is at
>> > http://www.spinics.net/lists/linux-wireless/msg98640.html .
>>
>> I just use print_hex_dump_bytes() to print SSIDs.
>
>Ok and has kernel printf modifier for size_t?
>
>--
>Pali Rohár
>pali.rohar@gmail.com
>
If I read lib/vsprintf.c correctly, you can use 'z'
Regards,
Ivo
PS: Please use my gmail address when cc-ing me, LKML really hates my abv dot bg account :)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
>From linux-wireless-owner@vger.kernel.org Wed Dec 11 03:45:13 2013
Return-Path: <linux-wireless-owner@vger.kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
jmaline2.user.openhosting.com
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=ham
version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by jmaline2.user.openhosting.com (8.13.8/8.13.8) with ESMTP id rBB1jDSS010436
for <j@w1.fi>; Tue, 10 Dec 2013 20:45:13 -0500
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1751224Ab3LKBpL (ORCPT <rfc822;j@w1.fi>);
Tue, 10 Dec 2013 20:45:11 -0500
Received: from plane.gmane.org ([80.91.229.3]:36778 "EHLO plane.gmane.org"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1751278Ab3LKBpH (ORCPT <rfc822;linux-wireless@vger.kernel.org>);
Tue, 10 Dec 2013 20:45:07 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
(envelope-from <glkwg-linux-wireless@m.gmane.org>)
id 1VqYrH-0003XA-4x
for linux-wireless@vger.kernel.org; Wed, 11 Dec 2013 02:45:03 +0100
Received: from ool-182c1fa2.dyn.optonline.net ([24.44.31.162])
by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
id 1AlnuQ-0007hv-00
for <linux-wireless@vger.kernel.org>; Wed, 11 Dec 2013 02:45:03 +0100
Received: from kampowchicken by ool-182c1fa2.dyn.optonline.net with local (Gmexim 0.1 (Debian))
id 1AlnuQ-0007hv-00
for <linux-wireless@vger.kernel.org>; Wed, 11 Dec 2013 02:45:03 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: linux-wireless@vger.kernel.org
From: Kam <kampowchicken@gmail.com>
Subject: rtl8723ae owner.
Date: Wed, 11 Dec 2013 01:42:07 +0000 (UTC)
Message-ID: <loom.20131211T021101-974@post.gmane.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: sea.gmane.org
User-Agent: Loom/3.14 (http://gmane.org/)
X-Loom-IP: 24.44.31.162 (Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0)
Sender: linux-wireless-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-wireless.vger.kernel.org>
X-Mailing-List: linux-wireless@vger.kernel.org
Content-Length: 1232
Lines: 25
I have the rtl8723ae PCIe wifi card. I've read through the messages on the
forums and experience similar issues to others who have inquired about the
card. I experience sluggish connections and disconnects, I for the most
can't connect to my school wifi at all.
I switched my router to 'AP' today after reading through the posts here and
initially the connection was faster than I've experienced thus far(since
switching to linux last year), I ended up shutting down the computer
eventually and after turning it back on few hours later, It was back to the
slow sluggish connection.
I've collected all the output that I could think of and wanted to contribute
it in hopes that it can assist the devs in testing/debugging the issues with
the card. The text file is a little but over 800 lines, so I will post it on
fpaste, if this isn't acceptable please let me know and I will repost the
text in preferred format. I am about ready to smoke the beacons off this
thing :P.
http://www.fpaste.org/60680/38672606/
Thank you!
Kam
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 00/16] wl1251 patches from linux-n900 tree
@ 2013-10-26 20:33 Pali Rohár
2013-12-08 9:24 ` [PATCH v2 " Pali Rohár
0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2013-10-26 20:33 UTC (permalink / raw)
To: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller
Cc: linux-wireless, netdev, linux-kernel, freemangordon,
aaro.koskinen, pavel, sre, joni.lapilainen, pali.rohar
Hello, I'm sending wl1251 patches from linux-n900 tree [1] for comments. More
patches come from David's monitor & packet injection work. Patches are tested
with 3.12 rc5 kernel on Nokia N900.
[1] - https://gitorious.org/linux-n900/linux-n900
David Gnedt (13):
mac80211: fix TX device statistics for monitor interfaces
wl1251: fix scan behaviour while not associated
wl1251: add sysfs interface for bluetooth coexistence mode
configuration
wl1251: retry power save entry
wl1251: implement hardware ARP filtering
wl1251: split RX and TX data path initialisation
wl1251: configure hardware en-/decryption for monitor mode
wl1251: implement multicast address filtering
wl1251: disable power saving in monitor mode
wl1251: fix channel switching in monitor mode
wl1251: enable tx path in monitor mode if necessary for packet
injection
wl1251: disable retry and ACK policy for injected packets
wl1251: enforce changed hw encryption support on monitor state change
Pali Rohár (3):
wl1251: add nvs file name to module firmware list
wl1251: Add sysfs file tx_mgmt_frm_rate for setting rate
wl1251: Add sysfs file address for setting permanent mac address
drivers/net/wireless/ti/wl1251/acx.c | 97 ++++++-
drivers/net/wireless/ti/wl1251/acx.h | 34 ++-
drivers/net/wireless/ti/wl1251/boot.c | 3 +-
drivers/net/wireless/ti/wl1251/cmd.c | 50 +++-
drivers/net/wireless/ti/wl1251/cmd.h | 8 +-
drivers/net/wireless/ti/wl1251/event.c | 44 +++
drivers/net/wireless/ti/wl1251/event.h | 7 +
drivers/net/wireless/ti/wl1251/init.c | 19 +-
drivers/net/wireless/ti/wl1251/main.c | 460 ++++++++++++++++++++++++++++++-
drivers/net/wireless/ti/wl1251/rx.c | 2 +-
drivers/net/wireless/ti/wl1251/tx.c | 27 +-
drivers/net/wireless/ti/wl1251/wl1251.h | 14 +
net/mac80211/tx.c | 3 +
13 files changed, 715 insertions(+), 53 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v2 00/16] wl1251 patches from linux-n900 tree
2013-10-26 20:33 [PATCH 00/16] wl1251 patches from linux-n900 tree Pali Rohár
@ 2013-12-08 9:24 ` Pali Rohár
2013-12-08 9:24 ` [PATCH v2 01/16] wl1251: fix scan behaviour while not associated Pali Rohár
0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2013-12-08 9:24 UTC (permalink / raw)
To: Luciano Coelho, John W. Linville
Cc: linux-wireless, netdev, linux-kernel, freemangordon,
aaro.koskinen, pavel, sre, joni.lapilainen, Johannes Berg,
Felipe Contreras, Pali Rohár
Hello, I'm sending wl1251 patches from linux-n900 tree [1] for comments. More
patches come from David's monitor & packet injection work. Patches are tested
with 3.12 rc5 kernel on Nokia N900.
Second version contains new patch for fixing NULL pointer dereference which
sometimes cause kernel panic and fixes code suggested by Pavel Machek.
[1] - https://gitorious.org/linux-n900/linux-n900
David Gnedt (12):
wl1251: fix scan behaviour while not associated
wl1251: add sysfs interface for bluetooth coexistence mode
configuration
wl1251: retry power save entry
wl1251: implement hardware ARP filtering
wl1251: split RX and TX data path initialisation
wl1251: configure hardware en-/decryption for monitor mode
wl1251: implement multicast address filtering
wl1251: disable power saving in monitor mode
wl1251: fix channel switching in monitor mode
wl1251: enable tx path in monitor mode if necessary for packet
injection
wl1251: disable retry and ACK policy for injected packets
wl1251: enforce changed hw encryption support on monitor state change
Pali Rohár (4):
wl1251: add nvs file name to module firmware list
wl1251: Add sysfs file tx_mgmt_frm_rate for setting rate
wl1251: Add sysfs file address for setting permanent mac address
wl1251: fix NULL pointer dereference
drivers/net/wireless/ti/wl1251/acx.c | 92 +++++-
drivers/net/wireless/ti/wl1251/acx.h | 34 ++-
drivers/net/wireless/ti/wl1251/boot.c | 3 +-
drivers/net/wireless/ti/wl1251/cmd.c | 59 +++-
drivers/net/wireless/ti/wl1251/cmd.h | 8 +-
drivers/net/wireless/ti/wl1251/event.c | 46 ++-
drivers/net/wireless/ti/wl1251/event.h | 7 +
drivers/net/wireless/ti/wl1251/init.c | 19 +-
drivers/net/wireless/ti/wl1251/main.c | 462 ++++++++++++++++++++++++++++++-
drivers/net/wireless/ti/wl1251/rx.c | 2 +-
drivers/net/wireless/ti/wl1251/tx.c | 35 ++-
drivers/net/wireless/ti/wl1251/wl1251.h | 14 +
12 files changed, 720 insertions(+), 61 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-08 9:24 ` [PATCH v2 " Pali Rohár
@ 2013-12-08 9:24 ` Pali Rohár
2013-12-10 9:21 ` Pavel Machek
0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2013-12-08 9:24 UTC (permalink / raw)
To: Luciano Coelho, John W. Linville
Cc: linux-wireless, netdev, linux-kernel, freemangordon,
aaro.koskinen, pavel, sre, joni.lapilainen, Johannes Berg,
Felipe Contreras, David Gnedt, Pali Rohár
From: David Gnedt <david.gnedt@davizone.at>
With a dissacociated card I often encoutered very long scan delays.
My guess is that it has something to do with the cards DTIM handling and
another firmware bug mentioned in the TI WLAN driver, which is described as
the card may never end scanning if the channel is overloaded because it
can't send probe requests. I think the firmware somehow also tries to
receive DTIM messages when the BSSID is not set. Therefore most of the time
it waits for DTIM messages and can't do scanning work.
Anyway we can workaround this misbehaviour by setting the HIGH_PRIORITY
bit for scans in disassociated state.
Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/net/wireless/ti/wl1251/cmd.c | 13 ++++++++++++-
drivers/net/wireless/ti/wl1251/cmd.h | 5 +++++
drivers/net/wireless/ti/wl1251/main.c | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
index 6822b84..16b6479 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -3,6 +3,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/crc7.h>
+#include <linux/etherdevice.h>
#include "wl1251.h"
#include "reg.h"
@@ -410,7 +411,10 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
struct wl1251_cmd_scan *cmd;
int i, ret = 0;
- wl1251_debug(DEBUG_CMD, "cmd scan");
+ wl1251_debug(DEBUG_CMD, "cmd scan channels %d ssid(%d) '%s'",
+ n_channels, (int)ssid_len, ssid);
+
+ WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS);
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
@@ -421,6 +425,13 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
CFG_RX_MGMT_EN |
CFG_RX_BCN_EN);
cmd->params.scan_options = 0;
+ /*
+ * Use high priority scan when not associated to prevent fw issue
+ * causing never-ending scans (sometimes 20+ minutes).
+ * Note: This bug may be caused by the fw's DTIM handling.
+ */
+ if (is_zero_ether_addr(wl->bssid))
+ cmd->params.scan_options |= WL1251_SCAN_OPT_PRIORITY_HIGH;
cmd->params.num_channels = n_channels;
cmd->params.num_probe_requests = n_probes;
cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */
diff --git a/drivers/net/wireless/ti/wl1251/cmd.h b/drivers/net/wireless/ti/wl1251/cmd.h
index ee4f2b3..126f273 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.h
+++ b/drivers/net/wireless/ti/wl1251/cmd.h
@@ -167,6 +167,11 @@ struct cmd_read_write_memory {
#define CMDMBOX_HEADER_LEN 4
#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
+#define WL1251_SCAN_OPT_PASSIVE 1
+#define WL1251_SCAN_OPT_5GHZ_BAND 2
+#define WL1251_SCAN_OPT_TRIGGERD_SCAN 4
+#define WL1251_SCAN_OPT_PRIORITY_HIGH 8
+
#define WL1251_SCAN_MIN_DURATION 30000
#define WL1251_SCAN_MAX_DURATION 60000
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 3291ffa..4d89ac8 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -930,6 +930,7 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
ret = wl1251_cmd_scan(wl, ssid, ssid_len, req->channels,
req->n_channels, WL1251_SCAN_NUM_PROBES);
if (ret < 0) {
+ wl1251_debug(DEBUG_SCAN, "scan failed %d", ret);
wl->scanning = false;
goto out_idle;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-08 9:24 ` [PATCH v2 01/16] wl1251: fix scan behaviour while not associated Pali Rohár
@ 2013-12-10 9:21 ` Pavel Machek
2013-12-10 15:41 ` Kalle Valo
2013-12-31 9:44 ` Pali Rohár
0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2013-12-10 9:21 UTC (permalink / raw)
To: Pali Rohár
Cc: Luciano Coelho, John W. Linville, linux-wireless, netdev,
linux-kernel, freemangordon, aaro.koskinen, sre, joni.lapilainen,
Johannes Berg, Felipe Contreras, David Gnedt
Hi!
> diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
> index 6822b84..16b6479 100644
> --- a/drivers/net/wireless/ti/wl1251/cmd.c
> +++ b/drivers/net/wireless/ti/wl1251/cmd.c
> @@ -410,7 +411,10 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
> struct wl1251_cmd_scan *cmd;
> int i, ret = 0;
>
> - wl1251_debug(DEBUG_CMD, "cmd scan");
> + wl1251_debug(DEBUG_CMD, "cmd scan channels %d ssid(%d) '%s'",
> + n_channels, (int)ssid_len, ssid);
> +
> + WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS);
>
ssids can have \0s in them... and what is worse, they may not be 0
terminated AFAICT.
Potential solution is at
http://www.spinics.net/lists/linux-wireless/msg98640.html .
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-10 9:21 ` Pavel Machek
@ 2013-12-10 15:41 ` Kalle Valo
2013-12-10 17:08 ` Pali Rohár
2013-12-31 9:44 ` Pali Rohár
1 sibling, 1 reply; 7+ messages in thread
From: Kalle Valo @ 2013-12-10 15:41 UTC (permalink / raw)
To: Pavel Machek
Cc: Pali Rohár, Luciano Coelho, John W. Linville, linux-wireless,
netdev, linux-kernel, freemangordon, aaro.koskinen, sre,
joni.lapilainen, Johannes Berg, Felipe Contreras, David Gnedt
Pavel Machek <pavel@ucw.cz> writes:
> ssids can have \0s in them... and what is worse, they may not be 0
> terminated AFAICT.
>
> Potential solution is at
> http://www.spinics.net/lists/linux-wireless/msg98640.html .
I just use print_hex_dump_bytes() to print SSIDs.
--
Kalle Valo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-10 15:41 ` Kalle Valo
@ 2013-12-10 17:08 ` Pali Rohár
2013-12-11 20:44 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2013-12-10 17:08 UTC (permalink / raw)
To: Kalle Valo, Pavel Machek
Cc: Luciano Coelho, John W. Linville, linux-wireless, netdev,
linux-kernel, freemangordon, aaro.koskinen, sre, joni.lapilainen,
Johannes Berg, Felipe Contreras, David Gnedt
[-- Attachment #1: Type: Text/Plain, Size: 440 bytes --]
On Tuesday 10 December 2013 16:41:04 Kalle Valo wrote:
> Pavel Machek <pavel@ucw.cz> writes:
> > ssids can have \0s in them... and what is worse, they may
> > not be 0 terminated AFAICT.
> >
> > Potential solution is at
> > http://www.spinics.net/lists/linux-wireless/msg98640.html .
>
> I just use print_hex_dump_bytes() to print SSIDs.
Ok and has kernel printf modifier for size_t?
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-10 17:08 ` Pali Rohár
@ 2013-12-11 20:44 ` Ben Hutchings
0 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2013-12-11 20:44 UTC (permalink / raw)
To: Pali Rohár
Cc: Kalle Valo, Pavel Machek, Luciano Coelho, John W. Linville,
linux-wireless, netdev, linux-kernel, freemangordon,
aaro.koskinen, sre, joni.lapilainen, Johannes Berg,
Felipe Contreras, David Gnedt
On Tue, 2013-12-10 at 18:08 +0100, Pali Rohár wrote:
> On Tuesday 10 December 2013 16:41:04 Kalle Valo wrote:
> > Pavel Machek <pavel@ucw.cz> writes:
> > > ssids can have \0s in them... and what is worse, they may
> > > not be 0 terminated AFAICT.
> > >
> > > Potential solution is at
> > > http://www.spinics.net/lists/linux-wireless/msg98640.html .
> >
> > I just use print_hex_dump_bytes() to print SSIDs.
>
> Ok and has kernel printf modifier for size_t?
It is 'z', same as in userland.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
2013-12-10 9:21 ` Pavel Machek
2013-12-10 15:41 ` Kalle Valo
@ 2013-12-31 9:44 ` Pali Rohár
1 sibling, 0 replies; 7+ messages in thread
From: Pali Rohár @ 2013-12-31 9:44 UTC (permalink / raw)
To: Pavel Machek
Cc: Luciano Coelho, John W. Linville, linux-wireless, netdev,
linux-kernel, freemangordon, aaro.koskinen, sre, joni.lapilainen,
Johannes Berg, Felipe Contreras, David Gnedt
[-- Attachment #1: Type: Text/Plain, Size: 4866 bytes --]
On Tuesday 10 December 2013 10:21:14 Pavel Machek wrote:
> Hi!
>
> > diff --git a/drivers/net/wireless/ti/wl1251/cmd.c
> > b/drivers/net/wireless/ti/wl1251/cmd.c index
> > 6822b84..16b6479 100644
> > --- a/drivers/net/wireless/ti/wl1251/cmd.c
> > +++ b/drivers/net/wireless/ti/wl1251/cmd.c
> > @@ -410,7 +411,10 @@ int wl1251_cmd_scan(struct wl1251 *wl,
> > u8 *ssid, size_t ssid_len,
> >
> > struct wl1251_cmd_scan *cmd;
> > int i, ret = 0;
> >
> > - wl1251_debug(DEBUG_CMD, "cmd scan");
> > + wl1251_debug(DEBUG_CMD, "cmd scan channels %d ssid(%d)
> > '%s'", + n_channels, (int)ssid_len, ssid);
> > +
> > + WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS);
>
> ssids can have \0s in them... and what is worse, they may not
> be 0 terminated AFAICT.
>
> Potential solution is at
> http://www.spinics.net/lists/linux-wireless/msg98640.html .
>
> Thanks,
> Pavel
Ok. To prevent other problems in future, I removed printing ssid
and len params from debug output. I think it is not needed...
Here is updated patch:
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Subject: [PATCH v2 01/16] wl1251: fix scan behaviour while not associated
Date: Sun, 8 Dec 2013 10:24:59 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 8bit
From: David Gnedt <david.gnedt@davizone.at>
With a dissacociated card I often encoutered very long scan delays.
My guess is that it has something to do with the cards DTIM handling and
another firmware bug mentioned in the TI WLAN driver, which is described as
the card may never end scanning if the channel is overloaded because it
can't send probe requests. I think the firmware somehow also tries to
receive DTIM messages when the BSSID is not set. Therefore most of the time
it waits for DTIM messages and can't do scanning work.
Anyway we can workaround this misbehaviour by setting the HIGH_PRIORITY
bit for scans in disassociated state.
Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/net/wireless/ti/wl1251/cmd.c | 13 ++++++++++++-
drivers/net/wireless/ti/wl1251/cmd.h | 5 +++++
drivers/net/wireless/ti/wl1251/main.c | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
index 6822b84..16b6479 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -3,6 +3,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/crc7.h>
+#include <linux/etherdevice.h>
#include "wl1251.h"
#include "reg.h"
@@ -410,7 +411,9 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
struct wl1251_cmd_scan *cmd;
int i, ret = 0;
- wl1251_debug(DEBUG_CMD, "cmd scan");
+ wl1251_debug(DEBUG_CMD, "cmd scan channels %d", n_channels);
+
+ WARN_ON(n_channels > SCAN_MAX_NUM_OF_CHANNELS);
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
@@ -421,6 +425,13 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
CFG_RX_MGMT_EN |
CFG_RX_BCN_EN);
cmd->params.scan_options = 0;
+ /*
+ * Use high priority scan when not associated to prevent fw issue
+ * causing never-ending scans (sometimes 20+ minutes).
+ * Note: This bug may be caused by the fw's DTIM handling.
+ */
+ if (is_zero_ether_addr(wl->bssid))
+ cmd->params.scan_options |= WL1251_SCAN_OPT_PRIORITY_HIGH;
cmd->params.num_channels = n_channels;
cmd->params.num_probe_requests = n_probes;
cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */
diff --git a/drivers/net/wireless/ti/wl1251/cmd.h b/drivers/net/wireless/ti/wl1251/cmd.h
index ee4f2b3..126f273 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.h
+++ b/drivers/net/wireless/ti/wl1251/cmd.h
@@ -167,6 +167,11 @@ struct cmd_read_write_memory {
#define CMDMBOX_HEADER_LEN 4
#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
+#define WL1251_SCAN_OPT_PASSIVE 1
+#define WL1251_SCAN_OPT_5GHZ_BAND 2
+#define WL1251_SCAN_OPT_TRIGGERD_SCAN 4
+#define WL1251_SCAN_OPT_PRIORITY_HIGH 8
+
#define WL1251_SCAN_MIN_DURATION 30000
#define WL1251_SCAN_MAX_DURATION 60000
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 3291ffa..4d89ac8 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -930,6 +930,7 @@ static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
ret = wl1251_cmd_scan(wl, ssid, ssid_len, req->channels,
req->n_channels, WL1251_SCAN_NUM_PROBES);
if (ret < 0) {
+ wl1251_debug(DEBUG_SCAN, "scan failed %d", ret);
wl->scanning = false;
goto out_idle;
}
--
1.7.9.5
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-31 9:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 22:16 [PATCH v2 01/16] wl1251: fix scan behaviour while not associated Ивайло Димитров
-- strict thread matches above, loose matches on Subject: below --
2013-10-26 20:33 [PATCH 00/16] wl1251 patches from linux-n900 tree Pali Rohár
2013-12-08 9:24 ` [PATCH v2 " Pali Rohár
2013-12-08 9:24 ` [PATCH v2 01/16] wl1251: fix scan behaviour while not associated Pali Rohár
2013-12-10 9:21 ` Pavel Machek
2013-12-10 15:41 ` Kalle Valo
2013-12-10 17:08 ` Pali Rohár
2013-12-11 20:44 ` Ben Hutchings
2013-12-31 9:44 ` Pali Rohár
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).