Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wil6210: drop -Werror compiler flag
From: Vladimir Kondratiev @ 2013-07-22  9:53 UTC (permalink / raw)
  To: John W . Linville
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez, wil6210

In production code, don't use -Werror,
as it causes random compilation failures due to compiler version and options used.

With every new version of gcc, it becomes stricter and report more warnings.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/Makefile b/drivers/net/wireless/ath/wil6210/Makefile
index f891d51..990dd42a 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -11,9 +11,6 @@ wil6210-y += txrx.o
 wil6210-y += debug.o
 wil6210-$(CONFIG_WIL6210_TRACING) += trace.o
 
-ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
-	subdir-ccflags-y += -Werror
-endif
 # for tracing framework to find trace.h
 CFLAGS_trace.o := -I$(src)
 
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 2/2] MAINTAINERS: update ath6kl git location
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k
In-Reply-To: <20130722093113.26562.11543.stgit@localhost6.localdomain6>

The git tree is in github.com nowadays.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 MAINTAINERS |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 44626b8..7a403ba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1406,7 +1406,7 @@ ATHEROS ATH6KL WIRELESS DRIVER
 M:	Kalle Valo <kvalo@qca.qualcomm.com>
 L:	linux-wireless@vger.kernel.org
 W:	http://wireless.kernel.org/en/users/Drivers/ath6kl
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath6kl.git
+T:	git git://github.com/kvalo/ath.git
 S:	Supported
 F:	drivers/net/wireless/ath/ath6kl/
 


^ permalink raw reply related

* [PATCH 1/2] MAINTAINERS: add ath10k
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k
In-Reply-To: <20130722093113.26562.11543.stgit@localhost6.localdomain6>

I forgot to add an entry to MAINTAINERS when submitting the driver.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 MAINTAINERS |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index bf61e04..44626b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6719,6 +6719,14 @@ T:	git git://linuxtv.org/anttip/media_tree.git
 S:	Maintained
 F:	drivers/media/tuners/qt1010*
 
+QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
+M:	Kalle Valo <kvalo@qca.qualcomm.com>
+L:	ath10k@lists.infradead.org
+W:	http://wireless.kernel.org/en/users/Drivers/ath10k
+T:	git git://github.com/kvalo/ath.git
+S:	Supported
+F:	drivers/net/wireless/ath/ath10k/
+
 QUALCOMM HEXAGON ARCHITECTURE
 M:	Richard Kuo <rkuo@codeaurora.org>
 L:	linux-hexagon@vger.kernel.org


^ permalink raw reply related

* [PATCH 0/2] MAINTAINERS: ath10k and ath6kl updates
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k

Hi,

here few patches for MAINTAINERS. If they are ok I'll add them to ath.git and
send a pull request to John.

---

Kalle Valo (2):
      MAINTAINERS: add ath10k
      MAINTAINERS: update ath6kl git location


 MAINTAINERS |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Ben Hutchings @ 2013-07-22  1:45 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: thomas, Larry Finger, linville, linux-wireless, netdev, wil6210,
	Stable
In-Reply-To: <5330916.8NnOO4SNAp@lx-vladimir>

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

On Sun, 2013-07-21 at 18:52 +0300, Vladimir Kondratiev wrote:
> On Sunday, July 21, 2013 09:35:40 AM Thomas Fjellstrom wrote:
> > If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
> > noticed that each newer successive version of gcc gets more strict with what 
> > code it accepts without warning, or error. A lot of my only somewhat old code 
> > tends to have a lot more warnings. Especially that signedness warning.
> 
> Yes, this is the case; I have 4.7.3
> 
> > 
> > It also looked like that that driver or section of the kernel was compiling 
> > with -Werror. I haven't verrified that but I remember seeing "treating all 
> > warnings as errors" at one point.
> > 
> You are right, I have this in Makefile:
> (if one turn on extra warnings with -W, there will be lots of false alarms,
> that's why this ifeq())
> 
> ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
> 	subdir-ccflags-y += -Werror
> endif

This is a pretty weird thing to do, and you've failed to account for
-Wextra.

-Werror is generally a bad default in free software, as you have no
control over which compiler version will be used.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Kalle Valo @ 2013-07-21 16:55 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: thomas, Larry Finger, linville, linux-wireless, netdev, wil6210
In-Reply-To: <5330916.8NnOO4SNAp@lx-vladimir>

(Dropping stable)

Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> writes:

>> It also looked like that that driver or section of the kernel was compiling 
>> with -Werror. I haven't verrified that but I remember seeing "treating all 
>> warnings as errors" at one point.
>> 
> You are right, I have this in Makefile:
> (if one turn on extra warnings with -W, there will be lots of false alarms,
> that's why this ifeq())
>
> ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
> 	subdir-ccflags-y += -Werror
> endif

This is exactly why it's recommended not to use -Werror on releases.
It's ok when developers use it, but for end users -Werror should not be
enabled by default.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Vladimir Kondratiev @ 2013-07-21 15:52 UTC (permalink / raw)
  To: thomas; +Cc: Larry Finger, linville, linux-wireless, netdev, wil6210, Stable
In-Reply-To: <1559869.yu0fjJXVeX@balsa>

On Sunday, July 21, 2013 09:35:40 AM Thomas Fjellstrom wrote:
> If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
> noticed that each newer successive version of gcc gets more strict with what 
> code it accepts without warning, or error. A lot of my only somewhat old code 
> tends to have a lot more warnings. Especially that signedness warning.

Yes, this is the case; I have 4.7.3

> 
> It also looked like that that driver or section of the kernel was compiling 
> with -Werror. I haven't verrified that but I remember seeing "treating all 
> warnings as errors" at one point.
> 
You are right, I have this in Makefile:
(if one turn on extra warnings with -W, there will be lots of false alarms,
that's why this ifeq())

ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
	subdir-ccflags-y += -Werror
endif

Thanks, Vladimir

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Thomas Fjellstrom @ 2013-07-21 15:35 UTC (permalink / raw)
  To: Larry Finger
  Cc: Vladimir Kondratiev, linville, linux-wireless, netdev, wil6210,
	Stable
In-Reply-To: <51EBFABB.8080701@lwfinger.net>

On Sun 21 July 2013 10:14:03 Larry Finger wrote:
> On 07/21/2013 02:06 AM, Vladimir Kondratiev wrote:
> > On Saturday, July 20, 2013 09:46:48 PM Larry Finger wrote:
> >> Building driver wil6210 in 3.10 and 3.11 kernels yields the following 
errors:
> >>
> >>    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
> >> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
> >> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets 
in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-
Werror=pointer-sign]
> >>             false);
> >>             ^
> >> In file included from include/linux/kernel.h:13:0,
> >>                   from include/linux/cache.h:4,
> >>                   from include/linux/time.h:4,
> >>                   from include/linux/stat.h:18,
> >>                   from include/linux/module.h:10,
> >>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> >> include/linux/printk.h:361:13: note: expected 'char *' but argument is of 
type 'unsigned char *'
> >>   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >>               ^
> >> drivers/net/wireless/ath/wil6210/debugfs.c: In function 
'wil_txdesc_debugfs_show':
> >> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets 
in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-
Werror=pointer-sign]
> >>            sizeof(printbuf), false);
> >>            ^
> >> In file included from include/linux/kernel.h:13:0,
> >>                   from include/linux/cache.h:4,
> >>                   from include/linux/time.h:4,
> >>                   from include/linux/stat.h:18,
> >>                   from include/linux/module.h:10,
> >>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> >> include/linux/printk.h:361:13: note: expected 'char *' but argument is of 
type 'unsigned char *'
> >>   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >>               ^
> >> cc1: all warnings being treated as errors
> >> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
> >> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
> >> make[3]: *** [drivers/net/wireless/ath] Error 2
> >> make[2]: *** [drivers/net/wireless] Error 2
> >> make[1]: *** [drivers/net] Error 2
> >> make: *** [drivers] Error 2
> >>
> >> These errors are fixed by changing the type of the buffer from "unsigned 
char *" to "char *".
> >>
> >> Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> >> Cc: Stable <stable@vger.kernel.org>  [3.10]
> >> Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> ---
> >>   drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c 
b/drivers/net/wireless/ath/wil6210/debugfs.c
> >> index e8308ec..ab63676 100644
> >> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> >> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> >> @@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const 
char *prefix,
> >>   				   le16_to_cpu(hdr.type), hdr.flags);
> >>   			if (len <= MAX_MBOXITEM_SIZE) {
> >>   				int n = 0;
> >> -				unsigned char printbuf[16 * 3 + 2];
> >> +				char printbuf[16 * 3 + 2];
> >>   				unsigned char databuf[MAX_MBOXITEM_SIZE];
> >>   				void __iomem *src = wmi_buffer(wil, d.addr) +
> >>   					sizeof(struct wil6210_mbox_hdr);
> >> @@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, 
void *data)
> >>   		seq_printf(s, "  SKB = %p\n", skb);
> >>
> >>   		if (skb) {
> >> -			unsigned char printbuf[16 * 3 + 2];
> >> +			char printbuf[16 * 3 + 2];
> >>   			int i = 0;
> >>   			int len = le16_to_cpu(d->dma.length);
> >>   			void *p = skb->data;
> >>
> > Hmm, I have no warning for this with neither 3.10 nor 3.11 kernel version; 
but
> > patch is correct, and here is my
> > Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
> 
> Thanks. I did not see any warning or error either; however, it did happen 
for 
> Thomas. I'm not sure what combination of compiler version and/or switches 
lead 
> to the problem, but his system apparently uses them.

If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
noticed that each newer successive version of gcc gets more strict with what 
code it accepts without warning, or error. A lot of my only somewhat old code 
tends to have a lot more warnings. Especially that signedness warning.

It also looked like that that driver or section of the kernel was compiling 
with -Werror. I haven't verrified that but I remember seeing "treating all 
warnings as errors" at one point.

> Larry
> 
> 
-- 
Thomas Fjellstrom
thomas@fjellstrom.ca

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Larry Finger @ 2013-07-21 15:14 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: linville, linux-wireless, netdev, wil6210, Stable,
	Thomas Fjellstrom
In-Reply-To: <1958736.oRuXAUfNGd@lx-vladimir>

On 07/21/2013 02:06 AM, Vladimir Kondratiev wrote:
> On Saturday, July 20, 2013 09:46:48 PM Larry Finger wrote:
>> Building driver wil6210 in 3.10 and 3.11 kernels yields the following errors:
>>
>>    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
>> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
>> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>>             false);
>>             ^
>> In file included from include/linux/kernel.h:13:0,
>>                   from include/linux/cache.h:4,
>>                   from include/linux/time.h:4,
>>                   from include/linux/stat.h:18,
>>                   from include/linux/module.h:10,
>>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
>> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>>               ^
>> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_txdesc_debugfs_show':
>> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>>            sizeof(printbuf), false);
>>            ^
>> In file included from include/linux/kernel.h:13:0,
>>                   from include/linux/cache.h:4,
>>                   from include/linux/time.h:4,
>>                   from include/linux/stat.h:18,
>>                   from include/linux/module.h:10,
>>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
>> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>>               ^
>> cc1: all warnings being treated as errors
>> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
>> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
>> make[3]: *** [drivers/net/wireless/ath] Error 2
>> make[2]: *** [drivers/net/wireless] Error 2
>> make[1]: *** [drivers/net] Error 2
>> make: *** [drivers] Error 2
>>
>> These errors are fixed by changing the type of the buffer from "unsigned char *" to "char *".
>>
>> Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Cc: Stable <stable@vger.kernel.org>  [3.10]
>> Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> ---
>>   drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
>> index e8308ec..ab63676 100644
>> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
>> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
>> @@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
>>   				   le16_to_cpu(hdr.type), hdr.flags);
>>   			if (len <= MAX_MBOXITEM_SIZE) {
>>   				int n = 0;
>> -				unsigned char printbuf[16 * 3 + 2];
>> +				char printbuf[16 * 3 + 2];
>>   				unsigned char databuf[MAX_MBOXITEM_SIZE];
>>   				void __iomem *src = wmi_buffer(wil, d.addr) +
>>   					sizeof(struct wil6210_mbox_hdr);
>> @@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
>>   		seq_printf(s, "  SKB = %p\n", skb);
>>
>>   		if (skb) {
>> -			unsigned char printbuf[16 * 3 + 2];
>> +			char printbuf[16 * 3 + 2];
>>   			int i = 0;
>>   			int len = le16_to_cpu(d->dma.length);
>>   			void *p = skb->data;
>>
> Hmm, I have no warning for this with neither 3.10 nor 3.11 kernel version; but
> patch is correct, and here is my
> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>

Thanks. I did not see any warning or error either; however, it did happen for 
Thomas. I'm not sure what combination of compiler version and/or switches lead 
to the problem, but his system apparently uses them.

Larry



^ permalink raw reply

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Arik Nemtsov @ 2013-07-21 14:18 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez
In-Reply-To: <20971.60401.394690.279877@gargle.gargle.HOWL>

On Sun, Jul 21, 2013 at 5:10 PM, Sujith Manoharan <sujith@msujith.org> wrote:
> Arik Nemtsov wrote:
>> The RTNL has to be held since this potentially changes the regdomain.
>> Locking was forgotten here due to recent locking simplification changes.
>
> This is already present in the mac80211 tree:
> https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb
>

Ah thanks. I missed that. Disregard then please.

Arik

^ permalink raw reply

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Sujith Manoharan @ 2013-07-21 14:10 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez
In-Reply-To: <1374413809-26005-2-git-send-email-arik@wizery.com>

Arik Nemtsov wrote:
> The RTNL has to be held since this potentially changes the regdomain.
> Locking was forgotten here due to recent locking simplification changes.

This is already present in the mac80211 tree:
https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb

Sujith

^ permalink raw reply

* [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov
In-Reply-To: <1374413809-26005-1-git-send-email-arik@wizery.com>

The RTNL has to be held since this potentially changes the regdomain.
Locking was forgotten here due to recent locking simplification changes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ec3933..b25390a 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2285,7 +2285,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
 static void reg_timeout_work(struct work_struct *work)
 {
 	REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n");
+	rtnl_lock();
 	restore_regulatory_settings(true);
+	rtnl_unlock();
 }
 
 int __init regulatory_init(void)
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov

The current regdomain was not always set by the core. This causes
cards with a custom regulatory domain to ignore user initiated changes
if done before the card was registered.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ddeff80..1ec3933 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2250,10 +2250,13 @@ int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 void wiphy_regulatory_register(struct wiphy *wiphy)
 {
+	struct regulatory_request *lr;
+
 	if (!reg_dev_ignore_cell_hint(wiphy))
 		reg_num_devs_support_basehint++;
 
-	wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
+	lr = get_last_request();
+	wiphy_update_regulatory(wiphy, lr->initiator);
 }
 
 void wiphy_regulatory_deregister(struct wiphy *wiphy)
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 0/2] wil6210 checksum offload
From: Vladimir Kondratiev @ 2013-07-21  8:34 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, Vladimir Kondratiev, linux-wireless,
	Luis R . Rodriguez, wil6210

Next ready for integration patches. This time, introduce checksum offload
by Erez. Other patch is pre-requisite for checksum patch, and for more
offload patches that are coming.

Kirshenbaum Erez (1):
  wil6210: Enable TCP/UDP checksum HW offload

Vladimir Kondratiev (1):
  wil6210: fix error path in wil_tx_vring

 drivers/net/wireless/ath/wil6210/netdev.c |  2 +
 drivers/net/wireless/ath/wil6210/txrx.c   | 83 +++++++++++++++++++++++++++++--
 drivers/net/wireless/ath/wil6210/txrx.h   | 20 +++++++-
 drivers/net/wireless/ath/wil6210/wmi.c    |  6 +++
 4 files changed, 105 insertions(+), 6 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH 2/2] wil6210: Enable TCP/UDP checksum HW offload
From: Vladimir Kondratiev @ 2013-07-21  8:34 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, linux-wireless, Luis R . Rodriguez, wil6210,
	Vladimir Kondratiev
In-Reply-To: <1374395677-16751-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

From: Kirshenbaum Erez <erezk@wilocity.com>

Add support for TCP and UDP HW checksum offloading.
RX chain is allways configured for offload mode.
In case of checksum error in RX path the DMA L4 error bit(5)
will be set to 1 and driver will drop the packet.
TX checksum offloading is configrable (ethtool -K).
TX descriptors are configured for checksum offload according
to the SKB protocol type (TCP/UDP, IPV4/6), Upon mismatch drop
the TX packet (checksum required but not TCP/UDP IPV4/6 type).

Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/netdev.c |  2 +
 drivers/net/wireless/ath/wil6210/txrx.c   | 76 ++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/wil6210/txrx.h   | 20 +++++++-
 drivers/net/wireless/ath/wil6210/wmi.c    |  6 +++
 4 files changed, 101 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
index 29dd1e5..717178f 100644
--- a/drivers/net/wireless/ath/wil6210/netdev.c
+++ b/drivers/net/wireless/ath/wil6210/netdev.c
@@ -127,6 +127,8 @@ void *wil_if_alloc(struct device *dev, void __iomem *csr)
 
 	ndev->netdev_ops = &wil_netdev_ops;
 	ndev->ieee80211_ptr = wdev;
+	ndev->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
+	ndev->features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
 	SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
 	wdev->netdev = ndev;
 
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index e563af1..ea1abeb 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -18,6 +18,9 @@
 #include <net/ieee80211_radiotap.h>
 #include <linux/if_arp.h>
 #include <linux/moduleparam.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
+#include <net/ipv6.h>
 
 #include "wil6210.h"
 #include "wmi.h"
@@ -407,6 +410,21 @@ static struct sk_buff *wil_vring_reap_rx(struct wil6210_priv *wil,
 		return NULL;
 	}
 
+	/* L4 IDENT is on when HW calculated checksum, check status
+	 * and in case of error drop the packet
+	 * higher stack layers will handle retransmission (if required)
+	 */
+	if (d->dma.status & RX_DMA_STATUS_L4_IDENT) {
+		/* L4 protocol identified, csum calculated */
+		if ((d->dma.error & RX_DMA_ERROR_L4_ERR) == 0) {
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		} else {
+			wil_err(wil, "Incorrect checksum reported\n");
+			kfree_skb(skb);
+			return NULL;
+		}
+	}
+
 	ds_bits = wil_rxdesc_ds_bits(d);
 	if (ds_bits == 1) {
 		/*
@@ -646,6 +664,53 @@ static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len,
 	return 0;
 }
 
+static int wil_tx_desc_offload_cksum_set(struct wil6210_priv *wil,
+				struct vring_tx_desc *d,
+				struct sk_buff *skb)
+{
+	int protocol;
+
+	if (skb->ip_summed != CHECKSUM_PARTIAL)
+		return 0;
+
+	switch (skb->protocol) {
+	case cpu_to_be16(ETH_P_IP):
+		protocol = ip_hdr(skb)->protocol;
+		break;
+	case cpu_to_be16(ETH_P_IPV6):
+		protocol = ipv6_hdr(skb)->nexthdr;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	switch (protocol) {
+	case IPPROTO_TCP:
+		d->dma.d0 |= (2 << DMA_CFG_DESC_TX_0_L4_TYPE_POS);
+		/* L4 header len: TCP header length */
+		d->dma.d0 |=
+		(tcp_hdrlen(skb) & DMA_CFG_DESC_TX_0_L4_LENGTH_MSK);
+		break;
+	case IPPROTO_UDP:
+		/* L4 header len: UDP header length */
+		d->dma.d0 |=
+		(sizeof(struct udphdr) & DMA_CFG_DESC_TX_0_L4_LENGTH_MSK);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	d->dma.ip_length = skb_network_header_len(skb);
+	d->dma.b11 = ETH_HLEN; /* MAC header length */
+	d->dma.b11 |= BIT(DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS);
+	/* Enable TCP/UDP checksum */
+	d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_TCP_UDP_CHECKSUM_EN_POS);
+	/* Calculate pseudo-header */
+	d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_POS);
+
+	return 0;
+}
+
 static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 			struct sk_buff *skb)
 {
@@ -655,7 +720,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 	u32 swhead = vring->swhead;
 	int avail = wil_vring_avail_tx(vring);
 	int nr_frags = skb_shinfo(skb)->nr_frags;
-	uint f;
+	uint f = 0;
 	int vring_index = vring - wil->vring_tx;
 	uint i = swhead;
 	dma_addr_t pa;
@@ -686,13 +751,20 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 		return -EINVAL;
 	/* 1-st segment */
 	wil_tx_desc_map(d, pa, skb_headlen(skb), vring_index);
+	/* Process TCP/UDP checksum offloading */
+	if (wil_tx_desc_offload_cksum_set(wil, d, skb)) {
+		wil_err(wil, "VRING #%d Failed to set cksum, drop packet\n",
+			vring_index);
+		goto dma_error;
+	}
+
 	d->mac.d[2] |= ((nr_frags + 1) <<
 		       MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
 	if (nr_frags)
 		*_d = *d;
 
 	/* middle segments */
-	for (f = 0; f < nr_frags; f++) {
+	for (; f < nr_frags; f++) {
 		const struct skb_frag_struct *frag =
 				&skb_shinfo(skb)->frags[f];
 		int len = skb_frag_size(frag);
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
index 859aea6..b382827 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.h
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -235,7 +235,16 @@ struct vring_tx_mac {
 
 #define DMA_CFG_DESC_TX_0_L4_TYPE_POS 30
 #define DMA_CFG_DESC_TX_0_L4_TYPE_LEN 2
-#define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000
+#define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000 /* L4 type: 0-UDP, 2-TCP */
+
+
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_POS 0
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_LEN 7
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_MSK 0x7F /* MAC hdr len */
+
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS 7
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_LEN 1
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_MSK 0x80 /* 1-IPv4, 0-IPv6 */
 
 
 #define TX_DMA_STATUS_DU         BIT(0)
@@ -334,8 +343,17 @@ struct vring_rx_mac {
 
 #define RX_DMA_D0_CMD_DMA_IT     BIT(10)
 
+/* Error field, offload bits */
+#define RX_DMA_ERROR_L3_ERR   BIT(4)
+#define RX_DMA_ERROR_L4_ERR   BIT(5)
+
+
+/* Status field */
 #define RX_DMA_STATUS_DU         BIT(0)
 #define RX_DMA_STATUS_ERROR      BIT(2)
+
+#define RX_DMA_STATUS_L3_IDENT   BIT(4)
+#define RX_DMA_STATUS_L4_IDENT   BIT(5)
 #define RX_DMA_STATUS_PHY_INFO   BIT(6)
 
 struct vring_rx_dma {
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index a62511a..5220f15 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -924,6 +924,12 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
 		cmd.sniffer_cfg.phy_support =
 			cpu_to_le32((wil->monitor_flags & MONITOR_FLAG_CONTROL)
 				    ? WMI_SNIFFER_CP : WMI_SNIFFER_DP);
+	} else {
+		/* Initialize offload (in non-sniffer mode).
+		 * Linux IP stack always calculates IP checksum
+		 * HW always calculate TCP/UDP checksum
+		 */
+		cmd.l3_l4_ctrl |= (1 << L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS);
 	}
 	/* typical time for secure PCP is 840ms */
 	rc = wmi_call(wil, WMI_CFG_RX_CHAIN_CMDID, &cmd, sizeof(cmd),
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 1/2] wil6210: fix error path in wil_tx_vring
From: Vladimir Kondratiev @ 2013-07-21  8:34 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, Vladimir Kondratiev, linux-wireless,
	Luis R . Rodriguez, wil6210
In-Reply-To: <1374395677-16751-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Release fragments in the order of allocation; including one for skb head

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/txrx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 2a9d56a..e563af1 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -730,12 +730,13 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 	return 0;
  dma_error:
 	/* unmap what we have mapped */
-	/* Note: increment @f to operate with positive index */
-	for (f++; f > 0; f--) {
+	nr_frags = f + 1; /* frags mapped + one for skb head */
+	for (f = 0; f < nr_frags; f++) {
 		u16 dmalen;
-		struct wil_ctx *ctx = &vring->ctx[i];
+		struct wil_ctx *ctx;
 
 		i = (swhead + f) % vring->size;
+		ctx = &vring->ctx[i];
 		_d = &(vring->va[i].tx);
 		*d = *_d;
 		_d->dma.status = TX_DMA_STATUS_DU;
-- 
1.8.1.2


^ permalink raw reply related

* Re: [PATCH] ath: wil6210: Fix build error
From: Vladimir Kondratiev @ 2013-07-21  7:06 UTC (permalink / raw)
  To: Larry Finger
  Cc: linville, linux-wireless, netdev, wil6210, Stable,
	Thomas Fjellstrom
In-Reply-To: <1374374808-12768-1-git-send-email-Larry.Finger@lwfinger.net>

On Saturday, July 20, 2013 09:46:48 PM Larry Finger wrote:
> Building driver wil6210 in 3.10 and 3.11 kernels yields the following errors:
> 
>   CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>            false);
>            ^
> In file included from include/linux/kernel.h:13:0,
>                  from include/linux/cache.h:4,
>                  from include/linux/time.h:4,
>                  from include/linux/stat.h:18,
>                  from include/linux/module.h:10,
>                  from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>  extern void hex_dump_to_buffer(const void *buf, size_t len,
>              ^
> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_txdesc_debugfs_show':
> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>           sizeof(printbuf), false);
>           ^
> In file included from include/linux/kernel.h:13:0,
>                  from include/linux/cache.h:4,
>                  from include/linux/time.h:4,
>                  from include/linux/stat.h:18,
>                  from include/linux/module.h:10,
>                  from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>  extern void hex_dump_to_buffer(const void *buf, size_t len,
>              ^
> cc1: all warnings being treated as errors
> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
> make[3]: *** [drivers/net/wireless/ath] Error 2
> make[2]: *** [drivers/net/wireless] Error 2
> make[1]: *** [drivers/net] Error 2
> make: *** [drivers] Error 2
> 
> These errors are fixed by changing the type of the buffer from "unsigned char *" to "char *".
> 
> Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Stable <stable@vger.kernel.org>  [3.10]
> Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
> ---
>  drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
> index e8308ec..ab63676 100644
> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> @@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
>  				   le16_to_cpu(hdr.type), hdr.flags);
>  			if (len <= MAX_MBOXITEM_SIZE) {
>  				int n = 0;
> -				unsigned char printbuf[16 * 3 + 2];
> +				char printbuf[16 * 3 + 2];
>  				unsigned char databuf[MAX_MBOXITEM_SIZE];
>  				void __iomem *src = wmi_buffer(wil, d.addr) +
>  					sizeof(struct wil6210_mbox_hdr);
> @@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
>  		seq_printf(s, "  SKB = %p\n", skb);
>  
>  		if (skb) {
> -			unsigned char printbuf[16 * 3 + 2];
> +			char printbuf[16 * 3 + 2];
>  			int i = 0;
>  			int len = le16_to_cpu(d->dma.length);
>  			void *p = skb->data;
> 
Hmm, I have no warning for this with neither 3.10 nor 3.11 kernel version; but
patch is correct, and here is my
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>


^ permalink raw reply

* [PATCH] ath: wil6210: Fix build error
From: Larry Finger @ 2013-07-21  2:46 UTC (permalink / raw)
  To: linville
  Cc: linux-wireless, Larry Finger, netdev, Vladimir Kondratiev,
	wil6210, Stable, Thomas Fjellstrom

Building driver wil6210 in 3.10 and 3.11 kernels yields the following errors:

  CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
           false);
           ^
In file included from include/linux/kernel.h:13:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
 extern void hex_dump_to_buffer(const void *buf, size_t len,
             ^
drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_txdesc_debugfs_show':
drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
          sizeof(printbuf), false);
          ^
In file included from include/linux/kernel.h:13:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
 extern void hex_dump_to_buffer(const void *buf, size_t len,
             ^
cc1: all warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

These errors are fixed by changing the type of the buffer from "unsigned char *" to "char *".

Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>  [3.10]
Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index e8308ec..ab63676 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
 				   le16_to_cpu(hdr.type), hdr.flags);
 			if (len <= MAX_MBOXITEM_SIZE) {
 				int n = 0;
-				unsigned char printbuf[16 * 3 + 2];
+				char printbuf[16 * 3 + 2];
 				unsigned char databuf[MAX_MBOXITEM_SIZE];
 				void __iomem *src = wmi_buffer(wil, d.addr) +
 					sizeof(struct wil6210_mbox_hdr);
@@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
 		seq_printf(s, "  SKB = %p\n", skb);
 
 		if (skb) {
-			unsigned char printbuf[16 * 3 + 2];
+			char printbuf[16 * 3 + 2];
 			int i = 0;
 			int len = le16_to_cpu(d->dma.length);
 			void *p = skb->data;
-- 
1.8.1.4


^ permalink raw reply related

* Re: pull request: wireless 2013-07-19
From: David Miller @ 2013-07-21  0:02 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20130719171910.GD7641@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 19 Jul 2013 13:19:10 -0400

> Please accept this batch of fixes intended for the 3.11 tree...

Pulled, thanks John.

^ permalink raw reply

* Re: wil6210 driver compilation failure
From: Thomas Fjellstrom @ 2013-07-20 22:48 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, Greg Kroah-Hartman
In-Reply-To: <51EAFD2A.6060909@lwfinger.net>

On Sat 20 July 2013 16:12:10 Larry Finger wrote:
> On 07/20/2013 02:40 PM, Thomas Fjellstrom wrote:
> > The warnings have gone away, and the first error, but the second one is
> > still there.
> 
> Sorry, I missed the second one in your original message. Does this one fix
> it?

That seems to have done the trick.

> Larry
-- 
Thomas Fjellstrom
thomas@fjellstrom.ca

^ permalink raw reply

* Re: wil6210 driver compilation failure
From: Larry Finger @ 2013-07-20 21:12 UTC (permalink / raw)
  To: thomas; +Cc: linux-wireless, Greg Kroah-Hartman
In-Reply-To: <1546638.YtIzlZyRv2@balsa>

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

On 07/20/2013 02:40 PM, Thomas Fjellstrom wrote:
>
> The warnings have gone away, and the first error, but the second one is still
> there.

Sorry, I missed the second one in your original message. Does this one fix it?

Larry



[-- Attachment #2: wil6210_compile --]
[-- Type: text/plain, Size: 882 bytes --]

Index: linux-2.6/drivers/net/wireless/ath/wil6210/debugfs.c
===================================================================
--- linux-2.6.orig/drivers/net/wireless/ath/wil6210/debugfs.c
+++ linux-2.6/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_fi
 				   le16_to_cpu(hdr.type), hdr.flags);
 			if (len <= MAX_MBOXITEM_SIZE) {
 				int n = 0;
-				unsigned char printbuf[16 * 3 + 2];
+				char printbuf[16 * 3 + 2];
 				unsigned char databuf[MAX_MBOXITEM_SIZE];
 				void __iomem *src = wmi_buffer(wil, d.addr) +
 					sizeof(struct wil6210_mbox_hdr);
@@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struc
 		seq_printf(s, "  SKB = %p\n", skb);
 
 		if (skb) {
-			unsigned char printbuf[16 * 3 + 2];
+			char printbuf[16 * 3 + 2];
 			int i = 0;
 			int len = le16_to_cpu(d->dma.length);
 			void *p = skb->data;

^ permalink raw reply

* Re: wil6210 driver compilation failure
From: Thomas Fjellstrom @ 2013-07-20 19:40 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, Greg Kroah-Hartman
In-Reply-To: <51EAE191.90401@lwfinger.net>

On Sat 20 July 2013 14:14:25 Larry Finger wrote:
> On 07/20/2013 01:37 PM, Thomas Fjellstrom wrote:
> > Hi,
> > 
> > Recently while trying to figure out a separate issue, I did a
> > make allmodconfig and a make oldconfig with debian's default config on
> > the 3.10.1 kernel, and debian's config with 3.10.0.
> > 
> > It failed in the wil6210 driver.
> > 
> > The system it failed on is running a fresh install of Debian Sid, with gcc
> > 4.8.1.
> > 
> > This is the error I got:
> >    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
> > 
> > drivers/net/wireless/ath/wil6210/debugfs.c: In function âwil_print_ringâ:
> > drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets
> > in passing argument 5 of âhex_dump_to_bufferâ differ in signedness
> > [-Werror=pointer-sign]> 
> >             false);
> >             ^
> > 
> > In file included from include/linux/kernel.h:13:0,
> > 
> >                   from include/linux/cache.h:4,
> >                   from include/linux/time.h:4,
> >                   from include/linux/stat.h:18,
> >                   from include/linux/module.h:10,
> > 
> >                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> > include/linux/printk.h:361:13: note: expected âchar *â but argument is of
> > type âunsigned char *â> 
> >   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >   
> >               ^
> > 
> > drivers/net/wireless/ath/wil6210/debugfs.c: In function
> > âwil_txdesc_debugfs_showâ:
> > drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets
> > in passing argument 5 of âhex_dump_to_bufferâ differ in signedness
> > [-Werror=pointer-sign]> 
> >            sizeof(printbuf), false);
> >            ^
> > 
> > In file included from include/linux/kernel.h:13:0,
> > 
> >                   from include/linux/cache.h:4,
> >                   from include/linux/time.h:4,
> >                   from include/linux/stat.h:18,
> >                   from include/linux/module.h:10,
> > 
> >                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> > include/linux/printk.h:361:13: note: expected âchar *â but argument is of
> > type âunsigned char *â> 
> >   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >   
> >               ^
> > 
> > cc1: all warnings being treated as errors
> > make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
> > make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
> > make[3]: *** [drivers/net/wireless/ath] Error 2
> > make[2]: *** [drivers/net/wireless] Error 2
> > make[1]: *** [drivers/net] Error 2
> > make: *** [drivers] Error 2
> > 
> > please excuse the mangled quotes, fresh install and I negelected to set up
> > the locale properly. It's fixed now, but it seems I need to restart X for
> > it to notice.
> 
> This error should be fixed by the attached patch. Please test.
> 
> Note that my system did not issue a warning for this "problem". It seems we
> have different warnings turned on in the compiler.

The warnings have gone away, and the first error, but the second one is still 
there.

> Larry
-- 
Thomas Fjellstrom
thomas@fjellstrom.ca

^ permalink raw reply

* Re: wil6210 driver compilation failure
From: Larry Finger @ 2013-07-20 19:14 UTC (permalink / raw)
  To: thomas; +Cc: linux-wireless, Greg Kroah-Hartman
In-Reply-To: <6363399.uASIm9rubl@balsa>

[-- Attachment #1: Type: text/plain, Size: 2765 bytes --]

On 07/20/2013 01:37 PM, Thomas Fjellstrom wrote:
> Hi,
>
> Recently while trying to figure out a separate issue, I did a
> make allmodconfig and a make oldconfig with debian's default config on
> the 3.10.1 kernel, and debian's config with 3.10.0.
>
> It failed in the wil6210 driver.
>
> The system it failed on is running a fresh install of Debian Sid, with gcc
> 4.8.1.
>
> This is the error I got:
>
>    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
> drivers/net/wireless/ath/wil6210/debugfs.c: In function âwil_print_ringâ:
> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of âhex_dump_to_bufferâ differ in signedness [-Werror=pointer-sign]
>             false);
>             ^
> In file included from include/linux/kernel.h:13:0,
>                   from include/linux/cache.h:4,
>                   from include/linux/time.h:4,
>                   from include/linux/stat.h:18,
>                   from include/linux/module.h:10,
>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/linux/printk.h:361:13: note: expected âchar *â but argument is of type âunsigned char *â
>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>               ^
> drivers/net/wireless/ath/wil6210/debugfs.c: In function âwil_txdesc_debugfs_showâ:
> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of âhex_dump_to_bufferâ differ in signedness [-Werror=pointer-sign]
>            sizeof(printbuf), false);
>            ^
> In file included from include/linux/kernel.h:13:0,
>                   from include/linux/cache.h:4,
>                   from include/linux/time.h:4,
>                   from include/linux/stat.h:18,
>                   from include/linux/module.h:10,
>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/linux/printk.h:361:13: note: expected âchar *â but argument is of type âunsigned char *â
>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>               ^
> cc1: all warnings being treated as errors
> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
> make[3]: *** [drivers/net/wireless/ath] Error 2
> make[2]: *** [drivers/net/wireless] Error 2
> make[1]: *** [drivers/net] Error 2
> make: *** [drivers] Error 2
>
> please excuse the mangled quotes, fresh install and I negelected to set up
> the locale properly. It's fixed now, but it seems I need to restart X for it to
> notice.

This error should be fixed by the attached patch. Please test.

Note that my system did not issue a warning for this "problem". It seems we have 
different warnings turned on in the compiler.

Larry



[-- Attachment #2: wil6210_compile --]
[-- Type: text/plain, Size: 613 bytes --]

Index: linux-2.6/drivers/net/wireless/ath/wil6210/debugfs.c
===================================================================
--- linux-2.6.orig/drivers/net/wireless/ath/wil6210/debugfs.c
+++ linux-2.6/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_fi
 				   le16_to_cpu(hdr.type), hdr.flags);
 			if (len <= MAX_MBOXITEM_SIZE) {
 				int n = 0;
-				unsigned char printbuf[16 * 3 + 2];
+				char printbuf[16 * 3 + 2];
 				unsigned char databuf[MAX_MBOXITEM_SIZE];
 				void __iomem *src = wmi_buffer(wil, d.addr) +
 					sizeof(struct wil6210_mbox_hdr);

^ permalink raw reply

* wil6210 driver compilation failure
From: Thomas Fjellstrom @ 2013-07-20 18:37 UTC (permalink / raw)
  To: linux-wireless

Hi, 

Recently while trying to figure out a separate issue, I did a
make allmodconfig and a make oldconfig with debian's default config on
the 3.10.1 kernel, and debian's config with 3.10.0.

It failed in the wil6210 driver.

The system it failed on is running a fresh install of Debian Sid, with gcc
4.8.1.

This is the error I got:

  CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
drivers/net/wireless/ath/wil6210/debugfs.c: In function âwil_print_ringâ:
drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of âhex_dump_to_bufferâ differ in signedness [-Werror=pointer-sign]
           false);
           ^
In file included from include/linux/kernel.h:13:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/linux/printk.h:361:13: note: expected âchar *â but argument is of type âunsigned char *â
 extern void hex_dump_to_buffer(const void *buf, size_t len,
             ^
drivers/net/wireless/ath/wil6210/debugfs.c: In function âwil_txdesc_debugfs_showâ:
drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of âhex_dump_to_bufferâ differ in signedness [-Werror=pointer-sign]
          sizeof(printbuf), false);
          ^
In file included from include/linux/kernel.h:13:0,
                 from include/linux/cache.h:4,
                 from include/linux/time.h:4,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/linux/printk.h:361:13: note: expected âchar *â but argument is of type âunsigned char *â
 extern void hex_dump_to_buffer(const void *buf, size_t len,
             ^
cc1: all warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

please excuse the mangled quotes, fresh install and I negelected to set up
the locale properly. It's fixed now, but it seems I need to restart X for it to
notice.

-- 
Thomas Fjellstrom
thomas@fjellstrom.ca

^ permalink raw reply

* Re: Wake-On-Wireless and Deauthentication
From: Arend van Spriel @ 2013-07-20 16:50 UTC (permalink / raw)
  To: greg.huber; +Cc: Luis R. Rodriguez, linux-wireless, daniel.wagner, Dan Williams
In-Reply-To: <51E9800C.8040007@carestream.com>

On 07/19/13 20:06, greg.huber wrote:
> Thank you for your reply, I'm trying this now.
>
> Greg
>
> On 07/18/2013 09:38 PM, Luis R. Rodriguez wrote:
>> On Wed, Jul 17, 2013 at 11:11 AM, greg.huber<greg.huber@carestream.com>  wrote:
>>> I'm trying to get Wake-on-wireless working with an Atheros AR9462.
>>> The problem I seem to be having is that there is a Deauth requested
>>> when the system is suspended. Does anyone know how to keep the
>>> association while suspended?? I'm using kernel 3.9.9.
>>>
>>> The log after waking (from keyboard)
>>>
>>> [  320.117062] wlp3s0: deauthenticating from 00:24:01:12:de:7a by local choice
>>> (reason=3)
>> Typical managers for networking will disassociate you (and therefore
>> deauth first) prior to kicking the system to suspend. To test WoW you
>> need to run the supplicant manually because as far as I can tell the
>> GUI managers don't consider if WoW was enabled or not. In such a case
>> that WoW was enabled the GUI managers should not send the
>> deauth/disassoc.

There has been recent commit, which may affect you:

commit 8125696991194aacb1173b6e8196d19098b44e17
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Thu Feb 28 10:55:25 2013 +0100

     cfg80211/mac80211: disconnect on suspend

It is mentioning something about wowlan so I am not sure whether it 
does. As you are on 3.9.9 I guess you do not have this commit.

Regards,
Arend


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox