Re: ath9k: fix moredata flag endianness in cabq tx

2015-07-21 Thread Kalle Valo

 While compiling ath9k with some extra flags I've
 found that:
 
  ath9k/xmit.c +2473 ## 16: warning: restricted __le16 degrades to integer
  ath9k/xmit.c +2474 ## 36: warning: invalid assignment: =
  ath9k/xmit.c +2474 ## 36:left side has type restricted __le16
  ath9k/xmit.c +2474 ## 36:right side has type int
 
 There's no way for frame ftype/stype to be
 mistreated as the offending 'moredata' flag when
 considering cab queue.
 
 This could've however theoretically led sometimes
 to increased power consumption on connected
 stations as they would keep their Rx active
 waiting for frames that would never come.
 
 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: wlcore: add antenna diversity reading

2015-07-21 Thread Kalle Valo

 update the rssi reading on rx_status
 to read both RSSI level (7 bits) and
 antenna diversity (msb)
 
 Signed-off-by: Guy Mishol g...@ti.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel

2015-07-21 Thread Kalle Valo
Maninder Singh maninder...@samsung.com writes:

 chandef is initialized with NULL and on the very next line,
 we are using it to get channel, which is not correct.

 channel should be initialized after obtaining chandef.

 Signed-off-by: Maninder Singh maninder...@samsung.com

How did you find this bug?

 Static anlysis reports this bug like coverity or any other static tool like 
 cppcheck :-

 drivers/net/wireless/ath/ath10k/mac.c:839]: (error) Possible null pointer 
 dereference: chandef

Thanks. This is always good to add to the commit log so I did that:

ath10k: fix wrong initialization of struct channel

chandef is initialized with NULL and on the very next line, we are using it 
to
get channel, which is not correct. Channel should be initialized after
obtaining chandef.

Found by cppcheck:

ath/ath10k/mac.c:839]: (error) Possible null pointer dereference: chandef

Signed-off-by: Maninder Singh maninder...@samsung.com
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com


-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ath10k: suppress 'failed to process fft' warning messages.

2015-07-21 Thread Kevin Darbyshire-Bryant
When using DFS channels on Ath10k, kernel log has repeated warning message
'failed to process fft: -22' typically under medium/heavy traffic.

This patch switches the warnings to driver debug (WMI events) mode only
thus reducing log file noise.

DFS and spectral scan share underlying HW mechanisms and enabling one
(DFS) enables the other (spectral scan) as far as event reporting from
firmware to driver is concerned. Spectral scan events take no part in
processing of DFS radar pulses which are delivered as distinct events,
so the fft (spectral event) warning is harmless and DFS interference
detection/protection still occurs.

Symptoms seen  fix tested in both debug  non-debug modes on TP-Link
Archer C7 v2 platform.

Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk
---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 0791a43..1435614 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3498,7 +3498,7 @@ void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
  fftr, fftr_len,
  tsf);
if (res  0) {
-   ath10k_warn(ar, failed to process fft report: 
%d\n,
+   ath10k_dbg(ar, ATH10K_DBG_WMI, failed to 
process fft report: %d\n,
res);
return;
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2/2] iwlegacy: convert hex_dump_to_buffer() to %*ph

2015-07-21 Thread Kalle Valo

 There is no need to use hex_dump_to_buffer() in the cases like this:
 
   hexdump_to_buffer(buf, len, 16, 1, outbuf, outlen, false);  /* len 
 = 16 */
   sprintf(%s\n, outbuf);
 
 since it maybe easily converted to simple:
 
   sprintf(%*ph\n, len, buf);
 
 Note: it seems in the case the output is groupped by 2 bytes and looks like a
 typo. Thus, patch changes that to plain byte stream.
 
 Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] wl18xx: add dynamic fw traces

2015-07-21 Thread Kalle Valo
Guy Mishol g...@ti.com writes:

 add option to dynamically configure the fw
 which debug traces to open

 Signed-off-by: Guy Mishol g...@ti.com

Failed to apply, please rebase:

Applying: wl18xx: add dynamic fw traces
fatal: sha1 information is lacking or useless
(drivers/net/wireless/ti/wl18xx/acx.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 wl18xx: add dynamic fw traces

-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: brcmfmac: set wiphy's addresses to provide valid MACs

2015-07-21 Thread Kalle Valo

 Broadcom's firmware requires every BSS to use MAC address with unique
 last few bits. The amount of bits may depend on a particular firmware,
 it was verified to be 2 for BCM43602 one.
 If this condition won't be fulfilled firmware will reject such MAC:
 brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52
 
 We don't want to simply set addr_mask as it would also disallow using
 locally administrated bit. Instead let's build a list of addresses
 manually enabling 0x2 bit for extra interfaces.
 
 Signed-off-by: Rafa? Mi?ecki zaj...@gmail.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [v2,1/3] mwifiex: add bss mode TLV to extended scan command

2015-07-21 Thread Kalle Valo

 From: Aniket Nagarnaik anik...@marvell.com
 
 We are setting BSS mode as ANY so that firmware will provide
 all types of scan entries.
 
 Signed-off-by: Aniket Nagarnaik anik...@marvell.com
 Signed-off-by: Amitkumar Karwar akar...@marvell.com

Thanks, 3 patches applied to wireless-drivers-next.git:

40d7412b56f0 mwifiex: add bss mode TLV to extended scan command
0c6303cc0695 mwifiex: use maximum ssid length as 0xfe for p2p
e79801ffe9c8 mwifiex: correct p2p and station interface counters

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [1/2] ath9k: Fix register definitions for QCA956x

2015-07-21 Thread Kalle Valo

 From: Miaoqing Pan miaoq...@qca.qualcomm.com
 
 Signed-off-by: Miaoqing Pan miaoq...@qca.qualcomm.com

Thanks, 2 patches applied to wireless-drivers-next.git:

fa5b8c8a5ae4 ath9k: Fix register definitions for QCA956x
6301566e0b2d ath9k: export HW random number generator

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Support python 3 in utils/key2pub.py.

2015-07-21 Thread Stefan Lippers-Hollmann
Hi

On 2015-07-21, Taahir Ahmed wrote:
 On Wednesday 22 July 2015 04:50:45 Stefan Lippers-Hollmann wrote:
  You omit $(pwd) from ./utils/key2pub.py, while /utils/key2pub.py
  won't exist.
 
 Wow, that's a really bad mistake on my part.  It should indeed probably
 be './utils/key2pub.py'.  I made this change after my general testing,
 simply because emacs was undoing the execute bit every time I saved
 key2pub.py.
 
 It's not really a material change, so I'll probably just put it back the
 way it was.
 
 The rest of the patch is tested, I pinky-swear :)
  
  As little as I know about python packaging policies in Debian
  (and probably Fedora), /usr/bin/python is never supposed to point
  to python3 - afaik the interpreter should always be called python3
  there, so I don't really see how that's going to work there.
 
 I'm not assuming that the system interpreter is any particular version:
 key2pub.py has been modified so it runs under either 2.7 or 3.x.
 
 Some more simplification might be possible if 2.7 support is dropped,
 but not much, and I didn't want to rock the boat.

The problem, as I understand it, is that the python3 interpreter will
never be available as (/usr/bin/)python on Debian (or Fedora; even if
python2.x is not installed on the system), but always be called python3. 
So your new python3 compatibility is never actually used, neither on a 
python3-only system.

Therefore I'd suggest this approach instead, either make the python
interpreter user configurable, e.g.:

PYTHON ?= python

so the user can specify the interpreter when invoking make (as in
make PYTHON=python3), xor trying to auto-detect it (untested):

ifeq ($(shell which python3),)
  PYTHON = python
else
  PYTHON = python3
endif

and then using 

$(Q) $(PYTHON) ./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@

wherever python is needed.

Regards
Stefan Lippers-Hollmann
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [v2] brcmsmac: Use kstrdup to simplify code

2015-07-21 Thread Kalle Valo

 Replace a kmalloc+strcpy by an equivalent kstrdup in order to improve
 readability.
 
 Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr
 Acked-by: Arend van Spriel ar...@broadcom.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: rtlwifi: rtl8821ae: Fix an expression that is always false

2015-07-21 Thread Kalle Valo

 In routine _rtl8821ae_set_media_status(), an incorrect mask results in a test
 for AP status to always be false. Similar bugs were fixed in rtl8192cu and
 rtl8192de, but this instance was missed at that time.
 
 Reported-by: David Binderman dcb...@hotmail.com
 Signed-off-by: Larry Finger larry.fin...@lwfinger.net
 Cc: Stable sta...@vger.kernel.org [3.18+]
 Cc: David Binderman dcb...@hotmail.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: rtl8723au: fix incorrect type in assignment warning

2015-07-21 Thread Steve Pennington
Repaced call to htons with call to cpu_to_be16s to fix the
following sparse warning:
drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: warning: incorrect type in 
assignment (different base types)
drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:expected unsigned short 
[unsigned] [assigned] [usertype] len
drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:got restricted __be16 
[usertype] noident

Signed-off-by: Steve Pennington sgp...@gmail.com
---
 drivers/staging/rtl8723au/core/rtw_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 274a4b6..39318ae 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -1554,7 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame 
*precvframe)
ether_addr_copy(ptr + ETH_ALEN, pattrib-src);
 
if (!bsnaphdr) {
-   len = htons(len);
+   cpu_to_be16s(len);
memcpy(ptr + 12, len, 2);
}
 
-- 
2.4.6

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Support python 3 in utils/key2pub.py.

2015-07-21 Thread Taahir Ahmed
On Wednesday 22 July 2015 04:50:45 Stefan Lippers-Hollmann wrote:
 You omit $(pwd) from ./utils/key2pub.py, while /utils/key2pub.py
 won't exist.

Wow, that's a really bad mistake on my part.  It should indeed probably
be './utils/key2pub.py'.  I made this change after my general testing,
simply because emacs was undoing the execute bit every time I saved
key2pub.py.

It's not really a material change, so I'll probably just put it back the
way it was.

The rest of the patch is tested, I pinky-swear :)
 
 As little as I know about python packaging policies in Debian
 (and probably Fedora), /usr/bin/python is never supposed to point
 to python3 - afaik the interpreter should always be called python3
 there, so I don't really see how that's going to work there.

I'm not assuming that the system interpreter is any particular version:
key2pub.py has been modified so it runs under either 2.7 or 3.x.

Some more simplification might be possible if 2.7 support is dropped,
but not much, and I didn't want to rock the boat.

Thanks for the prompt review!

Taahir


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH 1/2] Support python 3 in utils/key2pub.py.

2015-07-21 Thread Stefan Lippers-Hollmann
Hi

On 2015-07-21, ahmed.taa...@gmail.com wrote:
 From: Taahir Ahmed ahmed.taa...@gmail.com
 
 utils/key2pub.py can now be run under either python 2.7 or python 3.x.
 This required some minor syntactical changes as well as switching from
 M2Crypto to pycrypto, since M2Crypto doesn't support python 3.x.
[...]
 diff --git a/Makefile b/Makefile
 index a3ead30..65fc780 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -112,7 +112,7 @@ $(REG_BIN):
  keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
   $(NQ) '  GEN ' $@
   $(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
 - $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
 + $(Q) python /utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
[...]

Without having tested it, nor being that familiar with python coding,
but this hunk seems to be problematic on two accords.

You omit $(pwd) from ./utils/key2pub.py, while /utils/key2pub.py
won't exist.

As little as I know about python packaging policies in Debian
(and probably Fedora), /usr/bin/python is never supposed to point
to python3 - afaik the interpreter should always be called python3
there, so I don't really see how that's going to work there.

Sorry if I missed anything obvious, but these things just caught
my attention without having looked any deeper.

Regards
Stefan Lippers-Hollmann
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Support Python 3 in the crda build system (Take 2)

2015-07-21 Thread ahmed . taahir
Updated Intro:

This patchset takes into account helpful comments by Stefan.  The user
can now set the make variable BUILD_PYTHON to select which interpreter
runs key2pub.py.

key2pub.py is further simplified as well.

Original Intro:

crda's build system is one of the last packages with a hard dep on
python-2.7 on my Gentoo system.  This patchset adapts the utility
script 'key2pub.py' so that it will run under either Python 2.7 or
Python 3.x.  The main change is a switch from using M2Crypto to
PyCrypto, specifically for Python 3.x support.

In addition, Gentoo had a small collection of bugfix patches that were
applied every time someone installed crda.  I've included those that
seemed to have general applicability, as described in Patch 2.

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] Support python 3 in utils/key2pub.py.

2015-07-21 Thread ahmed . taahir
From: Taahir Ahmed ahmed.taa...@gmail.com

utils/key2pub.py can now be run under either python 2.7 or python 3.x.
This required some minor syntactical changes as well as switching from
M2Crypto to pycrypto, since M2Crypto doesn't support python 3.x.

The generate source files have been renamed to keys-*.h, to prevent a
pattern rule from attempting to build the generated file.

In addition, some errors in the generated source file keys-ssl.h are
fixed:

  * The correct OpenSSL header for BN_ULONG is included.

  * The generated constants are given the 'ull' suffix to prevent
warnings about constants that are too large.
---
 Makefile |  14 ++--
 reglib.c |   4 +-
 utils/key2pub.py | 195 +++
 3 files changed, 106 insertions(+), 107 deletions(-)
 mode change 100755 = 100644 utils/key2pub.py

diff --git a/Makefile b/Makefile
index a3ead30..4ce900c 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,10 @@ UDEV_RULE_DIR?=/lib/udev/rules.d/
 PUBKEY_DIR?=pubkeys
 RUNTIME_PUBKEY_DIR?=/etc/wireless-regdb/pubkeys
 
+# Handle for the user to change the python interpreter that runs
+# utils/key2pub.py.  Python 2.7 and 3.x are supported.
+BUILDTIME_PYTHON ?= python
+
 CFLAGS += -O2 -fpic
 CFLAGS += -std=gnu99 -Wall -Werror -pedantic
 CFLAGS += -Wall -g
@@ -42,13 +46,13 @@ ifeq ($(USE_OPENSSL),1)
 CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\$(RUNTIME_PUBKEY_DIR)\ `pkg-config 
--cflags openssl`
 LDLIBS += `pkg-config --libs openssl`
 
-$(LIBREG): keys-ssl.c
+$(LIBREG): keys-ssl.h
 
 else
 CFLAGS += -DUSE_GCRYPT
 LDLIBS += -lgcrypt
 
-$(LIBREG): keys-gcrypt.c
+$(LIBREG): keys-gcrypt.h
 
 endif
 MKDIR ?= mkdir -p
@@ -109,10 +113,10 @@ $(REG_BIN):
$(NQ)
$(Q) exit 1
 
-keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
+keys-%.h: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
$(NQ) '  GEN ' $@
$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
-   $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
+   $(Q) $(BUILDTIME_PYTHON) utils/key2pub.py --$* $(wildcard 
$(PUBKEY_DIR)/*.pem) $@
 
 $(LIBREG): regdb.h reglib.h reglib.c
$(NQ) '  CC  ' $@
@@ -187,5 +191,5 @@ install: install-libreg install-libreg-headers crda 
crda.8.gz regdbdump.8.gz
 
 clean:
$(Q)rm -f $(LIBREG) crda regdbdump intersect db2rd optimize \
-   *.o *~ *.pyc keys-*.c *.gz \
+   *.o *~ *.pyc keys-*.h *.gz \
udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed
diff --git a/reglib.c b/reglib.c
index e00e9b8..aecff96 100644
--- a/reglib.c
+++ b/reglib.c
@@ -31,11 +31,11 @@
 #include reglib.h
 
 #ifdef USE_OPENSSL
-#include keys-ssl.c
+#include keys-ssl.h
 #endif
 
 #ifdef USE_GCRYPT
-#include keys-gcrypt.c
+#include keys-gcrypt.h
 #endif
 
 int debug = 0;
diff --git a/utils/key2pub.py b/utils/key2pub.py
old mode 100755
new mode 100644
index 3e84cd2..d6adefe
--- a/utils/key2pub.py
+++ b/utils/key2pub.py
@@ -1,126 +1,118 @@
 #!/usr/bin/env python
 
+import io
 import sys
 try:
-   from M2Crypto import RSA
-except ImportError, e:
-   sys.stderr.write('ERROR: Failed to import the M2Crypto module: %s\n' 
% e.message)
-   sys.stderr.write('Please install the M2Crypto Python module.\n')
-   sys.stderr.write('On Debian GNU/Linux the package is called 
python-m2crypto.\n')
-   sys.exit(1)
-
-def print_ssl_64(output, name, val):
-while val[0] == '\0':
-val = val[1:]
-while len(val) % 8:
-val = '\0' + val
-vnew = []
-while len(val):
-vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], 
val[7]))
-val = val[8:]
-vnew.reverse()
-output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
-idx = 0
-for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
-if not idx:
-output.write('\t')
-output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), 
ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
-idx += 1
-if idx == 2:
-idx = 0
-output.write('\n')
-if idx:
-output.write('\n')
-output.write('};\n\n')
-
-def print_ssl_32(output, name, val):
-while val[0] == '\0':
-val = val[1:]
-while len(val) % 4:
-val = '\0' + val
-vnew = []
-while len(val):
-vnew.append((val[0], val[1], val[2], val[3], ))
-val = val[4:]
-vnew.reverse()
-output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
-idx = 0
-for v1, v2, v3, v4 in vnew:
-if not idx:
-output.write('\t')
-output.write('0x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), 
ord(v4)))
-idx += 1
-if idx == 4:
-idx = 0
-output.write('\n')
-if idx:
-output.write('\n')
-output.write('};\n\n')
+from Crypto.PublicKey import RSA
+except ImportError as e:
+sys.stderr.write('ERROR: Failed to import the 

[PATCH 2/2] Small build system improvements.

2015-07-21 Thread ahmed . taahir
From: Taahir Ahmed ahmed.taa...@gmail.com

Phony targets are properly declared.

User's CFLAGS are not clobbered with '-O2 -g' unless the user has set no
cflags.
---
 Makefile | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 4ce900c..b5aa8e3 100644
--- a/Makefile
+++ b/Makefile
@@ -29,17 +29,19 @@ RUNTIME_PUBKEY_DIR?=/etc/wireless-regdb/pubkeys
 # utils/key2pub.py.  Python 2.7 and 3.x are supported.
 BUILDTIME_PYTHON ?= python
 
-CFLAGS += -O2 -fpic
+CFLAGS ?= -O2 -g
+CFLAGS += -fPIC
 CFLAGS += -std=gnu99 -Wall -Werror -pedantic
-CFLAGS += -Wall -g
 LDLIBREG += -lreg
 LDLIBS += $(LDLIBREG)
 LDLIBS += -lm
 LIBREG += libreg.so
 LDFLAGS += -L ./
 
+.PHONY: all
 all: all_noverify verify
 
+.PHONY: all_noverify
 all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
 
 ifeq ($(USE_OPENSSL),1)
@@ -122,11 +124,13 @@ $(LIBREG): regdb.h reglib.h reglib.c
$(NQ) '  CC  ' $@
$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
 
+.PHONY: install-libreg-headers
 install-libreg-headers:
$(NQ) '  INSTALL  libreg-headers'
$(Q)mkdir -p $(DESTDIR)/$(INCLUDE_DIR)
$(Q)cp *.h $(DESTDIR)/$(INCLUDE_DIR)/
 
+.PHONY: install-libreg
 install-libreg:
$(NQ) '  INSTALL  libreg'
$(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
@@ -167,6 +171,7 @@ verify: $(REG_BIN) regdbdump
@$(NQ) ' GZIP' $
$(Q)gzip  $  $@
 
+.PHONY: install
 install: install-libreg install-libreg-headers crda crda.8.gz regdbdump.8.gz
$(NQ) '  INSTALL  crda'
$(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR)
@@ -189,6 +194,7 @@ install: install-libreg install-libreg-headers crda 
crda.8.gz regdbdump.8.gz
$(NQ) '  INSTALL  regdbdump.8.gz'
$(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ regdbdump.8.gz
 
+.PHONY: clean
 clean:
$(Q)rm -f $(LIBREG) crda regdbdump intersect db2rd optimize \
*.o *~ *.pyc keys-*.h *.gz \
-- 
2.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Support Python3 in the crda buildsystem.

2015-07-21 Thread ahmed . taahir
crda's build system is one of the last packages with a hard dep on
python-2.7 on my Gentoo system.  This patchset adapts the utility
script 'key2pub.py' so that it will run under either Python 2.7 or
Python 3.x.  The main change is a switch from using M2Crypto to
PyCrypto, specifically for Python 3.x support.

In addition, Gentoo had a small collection of bugfix patches that were
applied every time someone installed crda.  I've included those that
seemed to have general applicability, as described in Patch 2.

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] Small build system improvements.

2015-07-21 Thread ahmed . taahir
From: Taahir Ahmed ahmed.taa...@gmail.com

Phony targets are properly declared.

User's CFLAGS are not clobbered with '-O2 -g' unless the user has set no
cflags.

Rename the generated file 'keys-*.c' to 'keys-*.h', so the general
object compilation pattern rule doesn't try to build it.
---
 Makefile | 16 ++--
 reglib.c |  4 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 65fc780..0b71916 100644
--- a/Makefile
+++ b/Makefile
@@ -25,30 +25,32 @@ UDEV_RULE_DIR?=/lib/udev/rules.d/
 PUBKEY_DIR?=pubkeys
 RUNTIME_PUBKEY_DIR?=/etc/wireless-regdb/pubkeys
 
-CFLAGS += -O2 -fpic
+CFLAGS ?= -O2 -g
+CFLAGS += -fPIC
 CFLAGS += -std=gnu99 -Wall -Werror -pedantic
-CFLAGS += -Wall -g
 LDLIBREG += -lreg
 LDLIBS += $(LDLIBREG)
 LDLIBS += -lm
 LIBREG += libreg.so
 LDFLAGS += -L ./
 
+.PHONY: all
 all: all_noverify verify
 
+.PHONY: all_noverify
 all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
 
 ifeq ($(USE_OPENSSL),1)
 CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\$(RUNTIME_PUBKEY_DIR)\ `pkg-config 
--cflags openssl`
 LDLIBS += `pkg-config --libs openssl`
 
-$(LIBREG): keys-ssl.c
+$(LIBREG): keys-ssl.h
 
 else
 CFLAGS += -DUSE_GCRYPT
 LDLIBS += -lgcrypt
 
-$(LIBREG): keys-gcrypt.c
+$(LIBREG): keys-gcrypt.h
 
 endif
 MKDIR ?= mkdir -p
@@ -109,7 +111,7 @@ $(REG_BIN):
$(NQ)
$(Q) exit 1
 
-keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
+keys-%.h: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
$(NQ) '  GEN ' $@
$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
$(Q) python /utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
@@ -163,6 +165,7 @@ verify: $(REG_BIN) regdbdump
@$(NQ) ' GZIP' $
$(Q)gzip  $  $@
 
+.PHONY: install
 install: install-libreg install-libreg-headers crda crda.8.gz regdbdump.8.gz
$(NQ) '  INSTALL  crda'
$(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR)
@@ -185,7 +188,8 @@ install: install-libreg install-libreg-headers crda 
crda.8.gz regdbdump.8.gz
$(NQ) '  INSTALL  regdbdump.8.gz'
$(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ regdbdump.8.gz
 
+.PHONY: clean
 clean:
$(Q)rm -f $(LIBREG) crda regdbdump intersect db2rd optimize \
-   *.o *~ *.pyc keys-*.c *.gz \
+   *.o *~ *.pyc keys-*.h *.gz \
udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed
diff --git a/reglib.c b/reglib.c
index e00e9b8..aecff96 100644
--- a/reglib.c
+++ b/reglib.c
@@ -31,11 +31,11 @@
 #include reglib.h
 
 #ifdef USE_OPENSSL
-#include keys-ssl.c
+#include keys-ssl.h
 #endif
 
 #ifdef USE_GCRYPT
-#include keys-gcrypt.c
+#include keys-gcrypt.h
 #endif
 
 int debug = 0;
-- 
2.3.6

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] Support python 3 in utils/key2pub.py.

2015-07-21 Thread ahmed . taahir
From: Taahir Ahmed ahmed.taa...@gmail.com

utils/key2pub.py can now be run under either python 2.7 or python 3.x.
This required some minor syntactical changes as well as switching from
M2Crypto to pycrypto, since M2Crypto doesn't support python 3.x.

In addition, some errors in the generated source file keys-ssl.h are
fixed:

  * The correct OpenSSL header for BN_ULONG is included.

  * The generated constants are given the 'ull' suffix to prevent
warnings about constants that are too large.
---
 Makefile |   2 +-
 utils/key2pub.py | 146 ---
 2 files changed, 75 insertions(+), 73 deletions(-)

diff --git a/Makefile b/Makefile
index a3ead30..65fc780 100644
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@ $(REG_BIN):
 keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
$(NQ) '  GEN ' $@
$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
-   $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
+   $(Q) python /utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
 
 $(LIBREG): regdb.h reglib.h reglib.c
$(NQ) '  CC  ' $@
diff --git a/utils/key2pub.py b/utils/key2pub.py
index 3e84cd2..ff92748 100755
--- a/utils/key2pub.py
+++ b/utils/key2pub.py
@@ -1,126 +1,128 @@
 #!/usr/bin/env python
 
+import io
 import sys
 try:
-   from M2Crypto import RSA
-except ImportError, e:
-   sys.stderr.write('ERROR: Failed to import the M2Crypto module: %s\n' 
% e.message)
-   sys.stderr.write('Please install the M2Crypto Python module.\n')
-   sys.stderr.write('On Debian GNU/Linux the package is called 
python-m2crypto.\n')
-   sys.exit(1)
+from Crypto.PublicKey import RSA
+except ImportError as e:
+sys.stderr.write('ERROR: Failed to import the Crypto.PublicKey module: 
%s\n' % e.message)
+sys.stderr.write('Please install the Crypto.PublicKey Python module.\n')
+sys.stderr.write('On Debian GNU/Linux the package is called 
python-crypto.\n')
+sys.exit(1)
+
+def bitwise_collect(value, radix_bits):
+words = []
+radix_mask = (1  radix_bits) - 1
+while value != 0:
+words.append(value  radix_mask)
+value = radix_bits
+return words
 
 def print_ssl_64(output, name, val):
-while val[0] == '\0':
-val = val[1:]
-while len(val) % 8:
-val = '\0' + val
-vnew = []
-while len(val):
-vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], 
val[7]))
-val = val[8:]
-vnew.reverse()
-output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+# OpenSSL expects 64-bit words given least-significant-word first.
+vwords = bitwise_collect(val, 64)
+
+output.write(u'static BN_ULONG {}[] = {{\n'.format(name))
 idx = 0
-for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
+for vword in vwords:
 if not idx:
-output.write('\t')
-output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), 
ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
+output.write(u'\t')
+output.write(u'0x{:016x}ULL, '.format(vword))
 idx += 1
 if idx == 2:
 idx = 0
-output.write('\n')
+output.write(u'\n')
 if idx:
-output.write('\n')
-output.write('};\n\n')
+output.write(u'\n')
+output.write(u'};\n\n')
 
 def print_ssl_32(output, name, val):
-while val[0] == '\0':
-val = val[1:]
-while len(val) % 4:
-val = '\0' + val
-vnew = []
-while len(val):
-vnew.append((val[0], val[1], val[2], val[3], ))
-val = val[4:]
-vnew.reverse()
-output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+# OpenSSL expects 32-bit words given least-significant-word first.
+vwords = bitwise_collect(val, 32)
+
+output.write(u'static BN_ULONG {}[] = {{\n'.format(name))
 idx = 0
-for v1, v2, v3, v4 in vnew:
+for vword in vwords:
 if not idx:
-output.write('\t')
-output.write('0x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), 
ord(v4)))
+output.write(u'\t')
+output.write(u'0x{:08x}, '.format(vword))
 idx += 1
 if idx == 4:
 idx = 0
-output.write('\n')
+output.write(u'\n')
 if idx:
-output.write('\n')
-output.write('};\n\n')
+output.write(u'\n')
+output.write(u'};\n\n')
 
 def print_ssl(output, name, val):
+
+output.write(u'#include stdint.h\n')
+output.write(u'#include openssl/bn.h\n')
+
 import struct
-output.write('#include stdint.h\n')
 if len(struct.pack('@L', 0)) == 8:
 return print_ssl_64(output, name, val)
 else:
 return print_ssl_32(output, name, val)
 
 def print_ssl_keys(output, n):
-output.write(r'''
+output.write(u'''
 struct pubkey {
struct bignum_st e, n;
 };
 
-#define KEY(data) {

[PATCH] ath10k: Improve performance by reducing tx_lock contention.

2015-07-21 Thread Marty Faltesek
From: Qi Zhou qiz...@google.com

During tx completion, tx_lock is held for longer than required, preventing
efficient refill of htt-pending_tx. Refactor the code so that only MSDU
related operations are protected by the lock.

Improves downstream performance on a 3x3 client from 495 to 580 Mbps.

Signed-off-by: Denton Gentry dgen...@google.com
Signed-off-by: Avery Pennarun apenw...@google.com
[mfalte...@google.com: removed conflicting code for tracking msdu_ids.]
Signed-off-by: Marty Faltesek mfalte...@google.com

Change-Id: Ia0fe8b037033c3335b5632b7276c3b0e33e738d4
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 12 ++--
 drivers/net/wireless/ath/ath10k/htt_tx.c |  8 ++--
 drivers/net/wireless/ath/ath10k/txrx.c   | 17 -
 3 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 89eb16b..79e68fa 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -1633,8 +1633,6 @@ static void ath10k_htt_rx_frm_tx_compl(struct ath10k *ar,
__le16 msdu_id;
int i;
 
-   lockdep_assert_held(htt-tx_lock);
-
switch (status) {
case HTT_DATA_TX_STATUS_NO_ACK:
tx_done.no_ack = true;
@@ -2000,15 +1998,11 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, 
struct sk_buff *skb)
break;
}
 
-   spin_lock_bh(htt-tx_lock);
ath10k_txrx_tx_unref(htt, tx_done);
-   spin_unlock_bh(htt-tx_lock);
break;
}
case HTT_T2H_MSG_TYPE_TX_COMPL_IND:
-   spin_lock_bh(htt-tx_lock);
-   __skb_queue_tail(htt-tx_compl_q, skb);
-   spin_unlock_bh(htt-tx_lock);
+   skb_queue_tail(htt-tx_compl_q, skb);
tasklet_schedule(htt-txrx_compl_task);
return;
case HTT_T2H_MSG_TYPE_SEC_IND: {
@@ -2093,12 +2087,10 @@ static void ath10k_htt_txrx_compl_task(unsigned long 
ptr)
struct htt_resp *resp;
struct sk_buff *skb;
 
-   spin_lock_bh(htt-tx_lock);
-   while ((skb = __skb_dequeue(htt-tx_compl_q))) {
+   while ((skb = skb_dequeue(htt-tx_compl_q))) {
ath10k_htt_rx_frm_tx_compl(htt-ar, skb);
dev_kfree_skb_any(skb);
}
-   spin_unlock_bh(htt-tx_lock);
 
spin_lock_bh(htt-rx_ring.lock);
while ((skb = __skb_dequeue(htt-rx_compl_q))) {
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a60ef7d..262d657 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -112,9 +112,7 @@ static int ath10k_htt_tx_clean_up_pending(int msdu_id, void 
*skb, void *ctx)
tx_done.discard = 1;
tx_done.msdu_id = msdu_id;
 
-   spin_lock_bh(htt-tx_lock);
ath10k_txrx_tx_unref(htt, tx_done);
-   spin_unlock_bh(htt-tx_lock);
 
return 0;
 }
@@ -355,12 +353,11 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct 
sk_buff *msdu)
 
spin_lock_bh(htt-tx_lock);
res = ath10k_htt_tx_alloc_msdu_id(htt, msdu);
+   spin_unlock_bh(htt-tx_lock);
if (res  0) {
-   spin_unlock_bh(htt-tx_lock);
goto err_tx_dec;
}
msdu_id = res;
-   spin_unlock_bh(htt-tx_lock);
 
txdesc = ath10k_htc_alloc_skb(ar, len);
if (!txdesc) {
@@ -429,12 +426,11 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
 
spin_lock_bh(htt-tx_lock);
res = ath10k_htt_tx_alloc_msdu_id(htt, msdu);
+   spin_unlock_bh(htt-tx_lock);
if (res  0) {
-   spin_unlock_bh(htt-tx_lock);
goto err_tx_dec;
}
msdu_id = res;
-   spin_unlock_bh(htt-tx_lock);
 
prefetch_len = min(htt-prefetch_len, msdu-len);
prefetch_len = roundup(prefetch_len, 4);
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c 
b/drivers/net/wireless/ath/ath10k/txrx.c
index 826500b..40a8083 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -53,8 +53,6 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
struct ath10k_skb_cb *skb_cb;
struct sk_buff *msdu;
 
-   lockdep_assert_held(htt-tx_lock);
-
ath10k_dbg(ar, ATH10K_DBG_HTT,
   htt tx completion msdu_id %u discard %d no_ack %d success 
%d\n,
   tx_done-msdu_id, !!tx_done-discard,
@@ -66,12 +64,19 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
return;
}
 
+   spin_lock_bh(htt-tx_lock);
msdu = idr_find(htt-pending_tx, tx_done-msdu_id);
if (!msdu) {
ath10k_warn(ar, received tx completion for invalid msdu_id: 
%d\n,
tx_done-msdu_id);
+   spin_unlock_bh(htt-tx_lock);
return;
}

[PATCH] mac80211_hwsim: unregister genetlink family properly

2015-07-21 Thread Su Kang Yin
During hwsim_init_netlink(), we should call genl_unregister_family()
if failed on netlink_register_notifier() since the genetlink is
already registered.

Signed-off-by: Su Kang Yin cant...@cantona.net
---
 drivers/net/wireless/mac80211_hwsim.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 99e873d..16d953e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3120,8 +3120,10 @@ static int hwsim_init_netlink(void)
goto failure;
 
rc = netlink_register_notifier(hwsim_netlink_notifier);
-   if (rc)
+   if (rc) {
+   genl_unregister_family(hwsim_genl_family);
goto failure;
+   }
 
return 0;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] bcma: switch GPIO portions to use GPIOLIB_IRQCHIP

2015-07-21 Thread Linus Walleij
This switches the BCMA GPIO driver to use GPIOLIB_IRQCHIP to
handle its interrupts instead of rolling its own copy of the
irqdomain handling etc.

Signed-off-by: Linus Walleij linus.wall...@linaro.org
---
Hi BCMA people,

if we can figure this out it would be great if you can test this
and merge it through whatever GIT tree handles BCMA patches.
Alternatively I can merge it into the GPIO tree with your ACK.

This is not even compiled, I don't have the right cross compilers
but the conversion is done like all other GPIOLIB_IRQCHIP conversions
I've done, so it shouldn't be very far off. Maybe you can get it
in shape in accordance with my idea if I screwed up? Thanks.
---
 drivers/bcma/Kconfig|  2 +-
 drivers/bcma/driver_gpio.c  | 88 +
 include/linux/bcma/bcma_driver_chipcommon.h |  1 -
 3 files changed, 28 insertions(+), 63 deletions(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index be5fffb6da24..023d448ed3fa 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -92,7 +92,7 @@ config BCMA_DRIVER_GMAC_CMN
 config BCMA_DRIVER_GPIO
bool BCMA GPIO driver
depends on BCMA  GPIOLIB
-   select IRQ_DOMAIN if BCMA_HOST_SOC
+   select GPIOLIB_IRQCHIP if BCMA_HOST_SOC
help
  Driver to provide access to the GPIO pins of the bcma bus.
 
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index 5f6018e7cd4c..f436fb5b429c 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -8,10 +8,8 @@
  * Licensed under the GNU/GPL. See COPYING for details.
  */
 
-#include linux/gpio.h
-#include linux/irq.h
+#include linux/gpio/driver.h
 #include linux/interrupt.h
-#include linux/irqdomain.h
 #include linux/export.h
 #include linux/bcma/bcma.h
 
@@ -79,19 +77,11 @@ static void bcma_gpio_free(struct gpio_chip *chip, unsigned 
gpio)
 }
 
 #if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
-static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
-{
-   struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
-
-   if (cc-core-bus-hosttype == BCMA_HOSTTYPE_SOC)
-   return irq_find_mapping(cc-irq_domain, gpio);
-   else
-   return -EINVAL;
-}
 
 static void bcma_gpio_irq_unmask(struct irq_data *d)
 {
-   struct bcma_drv_cc *cc = irq_data_get_irq_chip_data(d);
+   struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+   struct bcma_drv_cc *cc = bcma_gpio_get_cc(gc);
int gpio = irqd_to_hwirq(d);
u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
 
@@ -101,7 +91,8 @@ static void bcma_gpio_irq_unmask(struct irq_data *d)
 
 static void bcma_gpio_irq_mask(struct irq_data *d)
 {
-   struct bcma_drv_cc *cc = irq_data_get_irq_chip_data(d);
+   struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+   struct bcma_drv_cc *cc = bcma_gpio_get_cc(gc);
int gpio = irqd_to_hwirq(d);
 
bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
@@ -116,6 +107,7 @@ static struct irq_chip bcma_gpio_irq_chip = {
 static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
 {
struct bcma_drv_cc *cc = dev_id;
+   struct gpio_chip *gc = cc-gpio;
u32 val = bcma_cc_read32(cc, BCMA_CC_GPIOIN);
u32 mask = bcma_cc_read32(cc, BCMA_CC_GPIOIRQ);
u32 pol = bcma_cc_read32(cc, BCMA_CC_GPIOPOL);
@@ -125,14 +117,14 @@ static irqreturn_t bcma_gpio_irq_handler(int irq, void 
*dev_id)
if (!irqs)
return IRQ_NONE;
 
-   for_each_set_bit(gpio, irqs, cc-gpio.ngpio)
-   generic_handle_irq(bcma_gpio_to_irq(cc-gpio, gpio));
+   for_each_set_bit(gpio, irqs, gc-ngpio)
+   generic_handle_irq(irq_find_mapping(gc-irq_domain, gpio));
bcma_chipco_gpio_polarity(cc, irqs, val  irqs);
 
return IRQ_HANDLED;
 }
 
-static int bcma_gpio_irq_domain_init(struct bcma_drv_cc *cc)
+static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
 {
struct gpio_chip *chip = cc-gpio;
int gpio, hwirq, err;
@@ -140,66 +132,43 @@ static int bcma_gpio_irq_domain_init(struct bcma_drv_cc 
*cc)
if (cc-core-bus-hosttype != BCMA_HOSTTYPE_SOC)
return 0;
 
-   cc-irq_domain = irq_domain_add_linear(NULL, chip-ngpio,
-  irq_domain_simple_ops, cc);
-   if (!cc-irq_domain) {
-   err = -ENODEV;
-   goto err_irq_domain;
-   }
-   for (gpio = 0; gpio  chip-ngpio; gpio++) {
-   int irq = irq_create_mapping(cc-irq_domain, gpio);
-
-   irq_set_chip_data(irq, cc);
-   irq_set_chip_and_handler(irq, bcma_gpio_irq_chip,
-handle_simple_irq);
-   }
-
hwirq = bcma_core_irq(cc-core, 0);
err = request_irq(hwirq, bcma_gpio_irq_handler, IRQF_SHARED, gpio,
  cc);
if (err)
-   goto err_req_irq;
+   return 

Re: pull-request: wireless-drivers 2015-07-20

2015-07-21 Thread David Miller
From: Kalle Valo kv...@codeaurora.org
Date: Mon, 20 Jul 2015 18:36:30 +0300

 here are few fixes for 4.2, should not have anything out of ordinary.
 Please let me know if there are any issues.

Pulled, thanks.
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v3 2/2] firmware: add firmware signature checking support

2015-07-21 Thread Luis R. Rodriguez
On Tue, Jul 14, 2015 at 12:20 PM, Luis R. Rodriguez mcg...@suse.com wrote:
  +   strcpy(signed_name, buf-fw_id);
  +   strncat(signed_name, sign_ext, strlen(sign_ext));

 fw_id is potentially unbounded, so using strncat hear poses an
 overflow risk. Maybe better to use strlcpy?


 Thanks for the feedback, indeed.

Ok I've made this change based on David's tree.

 Luis
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pull-request: mac80211 2015-07-17

2015-07-21 Thread David Miller
From: Johannes Berg johan...@sipsolutions.net
Date: Fri, 17 Jul 2015 15:31:34 +0200

 We've accumulated some wireless fixes, please pull. Arik's fix is a bit
 bigger than I might like, but it fixes a real locking issue and we
 didn't really see a good way to make a smaller version.
 
 Let me know if there's any problem.

Pulled, thanks a lot Johannes.
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel

2015-07-21 Thread Kalle Valo
Maninder Singh maninder...@samsung.com writes:

 chandef is initialized with NULL and on the very next line,
 we are using it to get channel, which is not correct.

 channel should be initialized after obtaining chandef.

 Signed-off-by: Maninder Singh maninder...@samsung.com

How did you find this bug?

-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ath10k: Add QCA99X0 to supported device list

2015-07-21 Thread Vasanthakumar Thiagarajan
Add vendor/device id of QCA99X0 V2.0 to pci id table and
QCA99X0_HW_2_0_CHIP_ID_REV to ath10k_pci_supp_chips[] for
QCA99X0 to get detected by the driver.

Signed-off-by: Vasanthakumar Thiagarajan vthia...@qti.qualcomm.com
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5778e52..cc0e897 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -64,6 +64,7 @@ MODULE_PARM_DESC(reset_mode, 0: auto, 1: warm only (default: 
0));
 static const struct pci_device_id ath10k_pci_id_table[] = {
{ PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
{ PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 
*/
+   { PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
{0}
 };
 
@@ -78,6 +79,7 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_0_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_1_CHIP_ID_REV },
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
+   { QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
 };
 
 static void ath10k_pci_buffer_cleanup(struct ath10k *ar);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


FW: Multiple Vifs in Managed Mode

2015-07-21 Thread Doru
Hello, Johannes

What I try to do is perfectly  described in this picture: 
https://drive.google.com/file/d/0B5SBH08PU_ChSVVQdEhQQ29neG8/view?
usp=sharing
It’s worth mentioning that I need to do this on an Android phone. The 
problem is that the only resources
for finding a solution seems to be this mailing list and the associated 
web site but the information is pretty
scattered. From the research I’ve done until now, the mac80211 layer 
already has support for multi-vifs
but this is useless if the driver doesn’t use this functionality.

I tried to create multiple vif on 3 different Android smartphones (Nexus 
5, Nexus S, Samsung Galaxy S4) but 
all of them allowed me to create only one vif. The driver used in this 
case is the one from 
drivers/net/wireless/bcmdhd. Looking into the code I noticed that a 
maximum of 3 interfaces in the managed
mode are allowed. As there are already two interfaces in the managed 
mode (p2p0 and the physical Wifi interface) 
the above behavior  seems to be the right one.

My question is: from your knowledge is there any wireless driver for a 
smartphone’s WiFi chipset which supports 
multiple vifs? It doesn’t matter if the driver is open-source (can be 
found in the drivers/net/wireless folder) or
is presented in a binary format. 

I mention that most of the drivers for laptops’ WiFi chipsets seems to 
have support for multi-vifs. What’s the reason 
for not implementing this in the drivers for smartphones’ WiFi chipsets?

Sorry for the wall of text. Thanks,
Doru 


Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel

2015-07-21 Thread Maninder Singh
 chandef is initialized with NULL and on the very next line,
 we are using it to get channel, which is not correct.

 channel should be initialized after obtaining chandef.

 Signed-off-by: Maninder Singh maninder...@samsung.com

How did you find this bug?

Static anlysis reports this bug like coverity or any other static tool like 
cppcheck :-

drivers/net/wireless/ath/ath10k/mac.c:839]: (error) Possible null pointer 
dereference: chandef

Thanks,
Maninder

[PATCH v3 1/4] ath9k: advertise p2p dev support when chanctx

2015-07-21 Thread Janusz Dziedzic
Advertise p2p device support when ath9k loaded with
use_chanctx=1.

This will fix problem, when first interface is an AP
and next we would like to run p2p_find.
Before p2p find (scan phase) failed with EOPNOTSUPP.

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 drivers/net/wireless/ath/ath9k/init.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c 
b/drivers/net/wireless/ath/ath9k/init.c
index eff0e53..89a457d 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -736,13 +736,14 @@ static const struct ieee80211_iface_limit 
if_limits_multi[] = {
 BIT(NL80211_IFTYPE_P2P_CLIENT) |
 BIT(NL80211_IFTYPE_P2P_GO) },
{ .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
+   { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) },
 };
 
 static const struct ieee80211_iface_combination if_comb_multi[] = {
{
.limits = if_limits_multi,
.n_limits = ARRAY_SIZE(if_limits_multi),
-   .max_interfaces = 2,
+   .max_interfaces = 3,
.num_different_channels = 2,
.beacon_int_infra_match = true,
},
@@ -855,6 +856,10 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, 
struct ieee80211_hw *hw)
BIT(NL80211_IFTYPE_MESH_POINT) |
BIT(NL80211_IFTYPE_WDS);
 
+   if (ath9k_is_chanctx_enabled())
+   hw-wiphy-interface_modes |=
+   BIT(NL80211_IFTYPE_P2P_DEVICE);
+
hw-wiphy-iface_combinations = if_comb;
hw-wiphy-n_iface_combinations = ARRAY_SIZE(if_comb);
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] ath9k: handle RoC cancel correctly

2015-07-21 Thread Janusz Dziedzic
In case we will get ROC cancel from mac80211 we
should not call ieee80211_remain_on_channel_expired().

In other case I hit such warning on MIPS and
p2p negotiation failed (tested with use_chanctx=1).

ath: phy0: Starting RoC period
ath: phy0: Channel definition created: 2412 MHz
ath: phy0: Assigned next_chan to 2412 MHz
ath: phy0: Offchannel duration for chan 2412 MHz : 506632
ath: phy0: ath_chanctx_set_next: current: 2412 MHz, next: 2412 MHz
ath: phy0: Stopping current chanctx: 2412
ath: phy0: Flush timeout: 200
ath: phy0: ath_chanctx_set_next: Set channel 2412 MHz
ath: phy0: Set channel: 2412 MHz width: 0
ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 0
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_TSF_TIMER, state: 
ATH_CHANCTX_STATE_IDLE
ath: phy0: ath_offchannel_channel_change: offchannel state: 
ATH_OFFCHANNEL_ROC_START
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_SWITCH, state: 
ATH_CHANCTX_STATE_IDLE
ath: phy0: Cancel RoC
ath: phy0: RoC aborted
ath: phy0: RoC request on vif: 00:03:7f:4e:a0:cd, type: 1 duration: 500
ath: phy0: Starting RoC period
ath: phy0: Channel definition created: 2412 MHz
ath: phy0: Assigned next_chan to 2412 MHz
ath: phy0: Offchannel duration for chan 2412 MHz : 506705
ath: phy0: ath_chanctx_set_next: current: 2412 MHz, next: 2412 MHz
ath: phy0: ath_offchannel_channel_change: offchannel state: 
ATH_OFFCHANNEL_ROC_START
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_SWITCH, state: 
ATH_CHANCTX_STATE_IDLE
[ cut here ]
WARNING: CPU: 0 PID: 3312 at drivers/net/wireless/ath/ath9k/main.c:2319
Modules linked in: ath9k ath9k_common ath9k_hw ath mac80211 cfg80211

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 drivers/net/wireless/ath/ath9k/ath9k.h   |  9 -
 drivers/net/wireless/ath/ath9k/channel.c | 23 ---
 drivers/net/wireless/ath/ath9k/main.c|  4 ++--
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index a7a81b3..db7a7b6 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -410,6 +410,12 @@ enum ath_offchannel_state {
ATH_OFFCHANNEL_ROC_DONE,
 };
 
+enum ath_roc_complete_reason {
+   ATH_ROC_COMPLETE_EXPIRE,
+   ATH_ROC_COMPLETE_ABORT,
+   ATH_ROC_COMPLETE_CANCEL,
+};
+
 struct ath_offchannel {
struct ath_chanctx chan;
struct timer_list timer;
@@ -471,7 +477,8 @@ void ath_chanctx_event(struct ath_softc *sc, struct 
ieee80211_vif *vif,
 void ath_chanctx_set_next(struct ath_softc *sc, bool force);
 void ath_offchannel_next(struct ath_softc *sc);
 void ath_scan_complete(struct ath_softc *sc, bool abort);
-void ath_roc_complete(struct ath_softc *sc, bool abort);
+void ath_roc_complete(struct ath_softc *sc,
+ enum ath_roc_complete_reason reason);
 struct ath_chanctx* ath_is_go_chanctx_present(struct ath_softc *sc);
 
 #else
diff --git a/drivers/net/wireless/ath/ath9k/channel.c 
b/drivers/net/wireless/ath/ath9k/channel.c
index 2066650..90f5773 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -915,18 +915,27 @@ void ath_offchannel_next(struct ath_softc *sc)
}
 }
 
-void ath_roc_complete(struct ath_softc *sc, bool abort)
+void ath_roc_complete(struct ath_softc *sc, enum ath_roc_complete_reason 
reason)
 {
struct ath_common *common = ath9k_hw_common(sc-sc_ah);
 
-   if (abort)
+   sc-offchannel.roc_vif = NULL;
+   sc-offchannel.roc_chan = NULL;
+
+   switch (reason) {
+   case ATH_ROC_COMPLETE_ABORT:
ath_dbg(common, CHAN_CTX, RoC aborted\n);
-   else
+   ieee80211_remain_on_channel_expired(sc-hw);
+   break;
+   case ATH_ROC_COMPLETE_EXPIRE:
ath_dbg(common, CHAN_CTX, RoC expired\n);
+   ieee80211_remain_on_channel_expired(sc-hw);
+   break;
+   case ATH_ROC_COMPLETE_CANCEL:
+   ath_dbg(common, CHAN_CTX, RoC canceled\n);
+   break;
+   }
 
-   sc-offchannel.roc_vif = NULL;
-   sc-offchannel.roc_chan = NULL;
-   ieee80211_remain_on_channel_expired(sc-hw);
ath_offchannel_next(sc);
ath9k_ps_restore(sc);
 }
@@ -1058,7 +1067,7 @@ static void ath_offchannel_timer(unsigned long data)
case ATH_OFFCHANNEL_ROC_START:
case ATH_OFFCHANNEL_ROC_WAIT:
sc-offchannel.state = ATH_OFFCHANNEL_ROC_DONE;
-   ath_roc_complete(sc, false);
+   ath_roc_complete(sc, ATH_ROC_COMPLETE_EXPIRE);
break;
default:
break;
diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index cfd45cb..b7b77e0 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2246,7 +2246,7 @@ static void ath9k_cancel_pending_offchannel(struct 

[PATCH v3 3/4] ath9k: setup rxfilter for all chanctx

2015-07-21 Thread Janusz Dziedzic
While mac80211 setup this per HW, set same
rxfilter configuration for all chanctx.

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 drivers/net/wireless/ath/ath9k/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index b7b77e0..3de829f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1459,13 +1459,15 @@ static void ath9k_configure_filter(struct ieee80211_hw 
*hw,
   u64 multicast)
 {
struct ath_softc *sc = hw-priv;
+   struct ath_chanctx *ctx;
u32 rfilt;
 
changed_flags = SUPPORTED_FILTERS;
*total_flags = SUPPORTED_FILTERS;
 
spin_lock_bh(sc-chan_lock);
-   sc-cur_chan-rxfilter = *total_flags;
+   ath_for_each_chanctx(sc, ctx)
+   ctx-rxfilter = *total_flags;
spin_unlock_bh(sc-chan_lock);
 
ath9k_ps_wakeup(sc);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 4/4] ath9k: setup rxfilter when offchannel

2015-07-21 Thread Janusz Dziedzic
Setup rxfiler correctly for offchannel ctx.

This fix problem we didn't configure rxfilter, next
didn't receive probe requests and next failed
p2p_find. This was seen when ath9k loaded with
use_chanctx=1

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 drivers/net/wireless/ath/ath9k/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index 3de829f..c27143b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1468,6 +1468,9 @@ static void ath9k_configure_filter(struct ieee80211_hw 
*hw,
spin_lock_bh(sc-chan_lock);
ath_for_each_chanctx(sc, ctx)
ctx-rxfilter = *total_flags;
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+   sc-offchannel.chan.rxfilter = *total_flags;
+#endif
spin_unlock_bh(sc-chan_lock);
 
ath9k_ps_wakeup(sc);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [01/17] mwifiex: add tx data pause support

2015-07-21 Thread Kalle Valo

 This patch adds support to enable TX data pause feature for mwifiex.
 Whenever FW TX buffers reach threshold, FW would send TX pause event
 to driver. Driver in turn would block data traffic to that particular
 receiver address.
 
 Signed-off-by: Avinash Patil pat...@marvell.com
 Signed-off-by: Xinming Hu h...@marvell.com
 Signed-off-by: Cathy Luo c...@marvell.com

Thanks, 17 patches applied to wireless-drivers-next.git:

4e6ee91bb728 mwifiex: add tx data pause support
b5b0f272d618 mwifiex: block data traffic to tx paused receive address
9186a1f37d19 mwifiex: do not increase tx_pkts_queued if receive address tx 
paused
ba101ad50a50 mwifiex: add tdls channel switch status
f7669877e7ab mwifiex: process tdls channel switch event
449b8bbf45e6 mwifiex: add tdls config command
20834343a8e6 mwifiex: enable tdls channel switch ext_cap
55a2c0770634 mwifiex: enhance tdls link setup condition
b04975970676 mwifiex: add cfg80211 tdls channel switch handler
65d48e597106 mwifiex: update domain_info upon band change in start_ap
a1777327126e mwifiex: support for bypass tx queue
5c8946330abf mwifiex: enable traffic only when port is open
ddd7ceb3f6dd mwifiex: extend tx_data pause to AP interface as well
d5b036c403f8 mwifiex: support to set multichannel policy to FW
de9e9932b76d mwifiex: advertise multichannel support to cfg80211
cc7359b5c82f mwifiex: separate interface combination for multichannel and DFS
8d6b538a5eac mwifiex: handle multichannel event

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mwifiex: do not short circuit exit from mwifiex_set_mgmt_ies

2015-07-21 Thread Kalle Valo

 Without this change, the code simply exits after calling
 mwifiex_uap_set_head_tail_ies, leving the call to
 mwifiex_set_mgmt_beacon_data_ies as dead code.
 
 Coverity CID #1271292
 
 Signed-off-by: John W. Linville linvi...@tuxdriver.com
 Acked-by: Amitkumar Karwar akar...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mwifiex: fix leak of gen_ie storage on exit from mwifiex_del_mgmt_ies

2015-07-21 Thread Kalle Valo

 Storage pointed to by gen_ie is allocated with kmalloc, but was
 never freed.
 
 Coverity CID #1271251
 
 Signed-off-by: John W. Linville linvi...@tuxdriver.com
 Acked-by: Amitkumar Karwar akar...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: MAINTAINERS: update for mwifiex driver maintainers

2015-07-21 Thread Kalle Valo

 Amit  Nishant would be taking care of maintaining mwifiex driver here
 onwards on account of organizational changes.
 
 Signed-off-by: Avinash Patil pat...@marvell.com
 Signed-off-by: Amitkumar Karwar akar...@marvell.com
 Signed-off-by: Nishant Sarmukadam nisha...@marvell.com
 Signed-off-by: Cathy Luo c...@marvell.com
 Signed-off-by: Frank Huang fra...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mwifiex: usb: Fix double add error when submitting rx urb

2015-07-21 Thread Kalle Valo

 There is an error that can occur where the driver adds the same URB to USB 
 submission list twice.
 This happens since mwifiex_usb_submit_rem_rx can submit packets at same time 
 as an rx urb complete callback.
 This causes list corruption and is fixed by not setting the skb to NULL when 
 submitting an rx packet.
 
 [   84.461242] WARNING: CPU: 1 PID: 748 at lib/list_debug.c:36 
 __list_add+0xcb/0xd0()
 [   84.461245] list_add double add: new=8800c92b0c50, 
 prev=8800c92b0c50, next=8800ced6c430.
 [   84.461247] Modules linked in: rfcomm fuse cmac nf_conntrack_netbios_ns 
 nf_conntrack_broadcast ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack 
 ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables 
 ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle 
 ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat 
 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack bnep 
 iptable_mangle iptable_security iptable_raw btusb btintel bluetooth 
 mwifiex_usb mwifiex x86_pkg_temp_thermal cfg80211 coretemp r8712u(C) 
 kvm_intel kvm hid_sensor_als hid_sensor_incl_3d hid_sensor_rotation 
 hid_sensor_magn_3d hid_sensor_accel_3d hid_sensor_gyro_3d hid_sensor_trigger 
 hid_sensor_iio_common industrialio_triggered_buffer kfifo_buf rfkill iTCO_wdt 
 industrialio iTCO_vendor_support
 [   84.461316]  crc32_pclmul crc32c_intel ghash_clmulni_intel microcode 
 snd_hda_codec_realtek vfat snd_hda_codec_generic fat snd_hda_codec_hdmi 
 snd_hda_intel snd_hda_controller uvcvideo snd_hda_codec videobuf2_vmalloc 
 videobuf2_memops snd_hwdep videobuf2_core snd_hda_core joydev v4l2_common 
 videodev hid_sensor_hub snd_seq hid_multitouch media snd_seq_device snd_pcm 
 snd_timer mei_me snd i2c_i801 lpc_ich mei soundcore tpm_infineon tpm_tis tpm 
 i2c_hid i2c_designware_platform i2c_designware_core nfsd auth_rpcgss nfs_acl 
 lockd grace sunrpc sch_fq_codel i915 i2c_algo_bit drm_kms_helper drm xhci_pci 
 xhci_hcd ehci_pci sd_mod ehci_hcd video
 [   84.461383] CPU: 1 PID: 748 Comm: kworker/u9:0 Tainted: G C  
 4.1.0-rc5+ #163
 [   84.461386] Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 
 2, BIOS 2.05.0250 04/10/2015
 [   84.461396] Workqueue: MWIFIEX_RX_WORK_QUEUE mwifiex_rx_work_queue 
 [mwifiex]
 [   84.461399]  81a8150e 8801174cf8e8 817df830 
 
 [   84.461405]  8801174cf938 8801174cf928 810a54ba 
 8800c86bd750
 [   84.461410]  8800c92b0c50 8800c92b0c50 8800ced6c430 
 88010c057178
 [   84.461416] Call Trace:
 [   84.461421]  [817df830] dump_stack+0x4f/0x7b
 [   84.461428]  [810a54ba] warn_slowpath_common+0x8a/0xc0
 [   84.461432]  [810a5536] warn_slowpath_fmt+0x46/0x50
 [   84.461436]  [814109fb] __list_add+0xcb/0xd0
 [   84.461442]  [815c551a] ? usb_hcd_link_urb_to_ep+0x2a/0xa0
 [   84.461446]  [815c5570] usb_hcd_link_urb_to_ep+0x80/0xa0
 [   84.461459]  [a004318a] prepare_transfer+0xaa/0x130 [xhci_hcd]
 [   84.461470]  [a0044cf7] xhci_queue_bulk_tx+0xb7/0x7a0 [xhci_hcd]
 [   84.461480]  [a003b67f] ? xhci_urb_enqueue+0x50f/0x660 [xhci_hcd]
 [   84.461489]  [a003b67f] ? xhci_urb_enqueue+0x50f/0x660 [xhci_hcd]
 [   84.461498]  [a003b735] xhci_urb_enqueue+0x5c5/0x660 [xhci_hcd]
 [   84.461503]  [815c7ad3] usb_hcd_submit_urb+0x93/0xa70
 [   84.461507]  [8168dde8] ? __alloc_skb+0x78/0x1f0
 [   84.461511]  [8168d301] ? __kmalloc_reserve.isra.26+0x31/0x90
 [   84.461515]  [8168ddbc] ? __alloc_skb+0x4c/0x1f0
 [   84.461519]  [8168ddfc] ? __alloc_skb+0x8c/0x1f0
 [   84.461523]  [8168badd] ? skb_dequeue+0x5d/0x80
 [   84.461527]  [815c987e] usb_submit_urb+0x42e/0x5f0
 [   84.461531]  [816931d9] ? __alloc_rx_skb+0x39/0x100
 [   84.461536]  [a05aa372] mwifiex_usb_submit_rx_urb+0xb2/0x170 
 [mwifiex_usb]
 [   84.461542]  [a05aa5f5] mwifiex_usb_submit_rem_rx_urbs+0x45/0x50 
 [mwifiex_usb]
 [   84.461550]  [a07094be] mwifiex_rx_work_queue+0x10e/0x140 
 [mwifiex]
 [   84.461556]  [810c4429] process_one_work+0x229/0x890
 [   84.461559]  [810c438c] ? process_one_work+0x18c/0x890
 [   84.461565]  [810c4ae3] worker_thread+0x53/0x470
 [   84.461569]  [810c4a90] ? process_one_work+0x890/0x890
 [   84.461572]  [810cb162] kthread+0xf2/0x110
 [   84.461577]  [811031ad] ? trace_hardirqs_on+0xd/0x10
 [   84.461581]  [810cb070] ? kthread_create_on_node+0x230/0x230
 [   84.461586]  [817e9662] ret_from_fork+0x42/0x70
 [   84.461590]  [810cb070] ? kthread_create_on_node+0x230/0x230
 [   84.461593] ---[ end trace 65103af5e6fb3444 ]---
 
 Signed-off-by: Reyad Attiyat reyad.atti...@gmail.com
 Acked-by: Amitkumar Karwar akar...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line 

Re: b43: Fix typo in function name

2015-07-21 Thread Kalle Valo

 This fixes a typo in the b43_lo_g_maintenance_work function
 name.
 
 Signed-off-by: Nik Nyby niko...@gnu.org
 Acked-by: Larry Finger larry.fin...@lwfinger.net
 Acked-by: Michael Buesch m...@bues.ch

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: rtlwifi: fix typo in comments

2015-07-21 Thread Kalle Valo

 This fixes a typo in two comments: paht - path.
 
 Signed-off-by: Nik Nyby niko...@gnu.org
 Acked-by: Larry Finger larry.fin...@lwfinger.net

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: wlcore: sdio: return correct error code

2015-07-21 Thread Kalle Valo

 When wlcore_probe_of failed, return the correct error code instead of ENOMEM
 
 Signed-off-by: Raphaël Poggi poggi.r...@gmail.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ath9k: make DMA stop related messages debug-only

2015-07-21 Thread Kalle Valo

 A long time ago, ath9k had issues during reset where the DMA engine
 would stay active and could potentially corrupt memory.
 To debug those issues, the driver would print warnings whenever they
 occur.
 
 Nowadays, these issues are gone and the primary cause of these messages
 is if the MAC is stuck during reset or busy processing a long
 transmission. This is fairly harmless, yet these messages continue to
 worry users.
 
 To reduce the number of bogus bug reports, turn these messages into
 debug messages and count their occurence in the reset debugfs file.
 
 Signed-off-by: Felix Fietkau n...@openwrt.org

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mwifiex: fix for p2p broken link

2015-07-21 Thread Kalle Valo

 From: Aniket Nagarnaik anik...@marvell.com
 
 This patch fixes following issues in p2p code paths.
 
 1) bss role, bss type and connection type was not set correctly
 for p2p GO and p2p client at couple of places.
 2) Driver appends a proprietary header to management frames
 which will be parsed by our firmware. Later while informing
 TX status to cfg80211, modified frame buffer was passed to
 cfg80211_mgmt_tx_status() instead of original one.
 
 Signed-off-by: Aniket Nagarnaik anik...@marvell.com
 Signed-off-by: Amitkumar Karwar akar...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: populate bus DT subnodes as platform_device-s

2015-07-21 Thread Kalle Valo
Rafał Miłecki zaj...@gmail.com writes:

 Our bus should allow defining children nodes as we may want to specify
 devices attached to the bus. This is required e.g. to specify NAND or
 ChipCommon cores and use bus's address and IRQ mappings.

 Signed-off-by: Rafał Miłecki zaj...@gmail.com

Thanks, manually applied to wireless-drivers-next.git.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: rtlwifi: rtl8192cu: Remove rtl8723 code

2015-07-21 Thread Kalle Valo

 In the rtlwifi/rtl8192cu, rtl8723 code is dead code.
 So I remove it.
 
 Signed-off-by: Taehee Yoo ap420...@gmail.com
 Acked-by: Larry Finger larry.fin...@lwfinger.net

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [5/6] wireless: cw1200: Remove redundant spi driver bus initialization

2015-07-21 Thread Kalle Valo

 In ancient times it was necessary to manually initialize the bus
 field of an spi_driver to spi_bus_type. These days this is done in
 spi_register_driver(), so we can drop the manual assignment.
 
 Signed-off-by: Antonio Borneo borneo.anto...@gmail.com
 To: Solomon Peachy pi...@shaftnet.org
 To: Kalle Valo kv...@codeaurora.org
 To: linux-wireless@vger.kernel.org
 To: net...@vger.kernel.org
 Cc: linux-ker...@vger.kernel.org

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mwifiex: avoid freeing improper pointer inmwifiex_set_wowlan_mef_entry

2015-07-21 Thread Kalle Valo

 mwifiex_set_wowlan_mef_entry attempts to free a passed-in pointer in
 case of an error.  The only caller (mwifiex_set_mef_filter) passes that
 pointer as an offset into allocated memory, so any attempt to free that
 will not be the actual allocated pointer.
 
 Address this by changing mwifiex_set_wowlan_mef_entry to not do any
 free, and to cause mwifiex_set_mef_filter to do the appropriate free if
 the call to mwifiex_set_wowlan_mef_entry fails.
 
 Coverity CID #1295879
 
 Signed-off-by: John W. Linville linvi...@tuxdriver.com
 Acked-by: Amitkumar Karwar akar...@marvell.com

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/13] wil6210: TSO implementation

2015-07-21 Thread Kalle Valo
Vladimir Kondratiev qca_vkond...@qca.qualcomm.com writes:

 On Wednesday, July 08, 2015 10:06:37 PM Emmanuel Grumbach wrote:
 So your device is able to replicate and update the IP / TCP header?
 I don't really follow what your device is able to do.
 You seem to be cutting the frags so that their length sums up to mss.
 Which hints that your device can't segment the buffer by itself. OTOH,
 I don't see how you treat the IP / TCP header copy and modification.
 
 Emmanuel:
 Yes, it is correct - hardware know to replicate IP/TCP header; and
 DMA written in such a way that I have to arrange fragments to
 sums up to MSS.

 So this code fragment is OK. We tested it with lots of traffic.
 However, after your comments for another code fragment,
 I found there is a way to do it better. I'll rework and send updated patch.

 Kalle: please drop this patch. The rest of patches should apply cleanly
 without this one.

Ok, dropped this patch.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ath9k: Fix register definitions for QCA956x

2015-07-21 Thread Kalle Valo
miaoq...@qti.qualcomm.com writes:

 From: Miaoqing Pan miaoq...@qca.qualcomm.com

 Signed-off-by: Miaoqing Pan miaoq...@qca.qualcomm.com

No need to change anything for this patch, but I want to warn that in
the future I will automatically start rejecting patches with empty
commit logs.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html