Re: pull-request: mac80211 2016-08-30

2016-08-30 Thread David Miller
From: Johannes Berg 
Date: Tue, 30 Aug 2016 08:19:18 +0200

> Nothing much, but we have three little fixes, see below. I've included the
> static inline so that BATMAN_ADV_BATMAN_V can be changed to be allowed w/o
> cfg80211 sooner, and it's a trivial change.
> 
> Let me know if there's any problem.

Pulled, thanks Johannes.


Re: [PATCH V2] rtl_bt: Add firmware and config file for RTL8822BE

2016-08-30 Thread Ben Hutchings
On Tue, 2016-08-30 at 20:11 -0500, Larry Finger wrote:
> This device is a new model from Realtek. Updates to driver btrtl will
> soon be submitted to the kernel.
> 
> These files were provided by the Realtek developer.
> 
> Signed-off-by: 陆朱伟 
> Signed-off-by: Larry Finger 
> Cc: linux-blueto...@vger.kernel.org
> ---
> 
> V2 - fix error in file names in WHENCE
> ---
[...]
>  Found in vendor driver, linux_bt_usb_2.11.20140423_8723be.rar
>  From https://github.com/troy-tan/driver_store
> +Files rtl_bt/rtl8822e_* came directly from Realtek.
[...]

You missed this wildcard, but I fixed it up.  Applied and pushed,
thanks.

Ben.

-- 
Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.


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


[PATCH V2] rtl_bt: Add firmware and config file for RTL8822BE

2016-08-30 Thread Larry Finger
This device is a new model from Realtek. Updates to driver btrtl will
soon be submitted to the kernel.

These files were provided by the Realtek developer.

Signed-off-by: 陆朱伟 
Signed-off-by: Larry Finger 
Cc: linux-blueto...@vger.kernel.org
---

V2 - fix error in file names in WHENCE
---
 WHENCE |   3 +++
 rtl_bt/rtl8822b_config.bin | Bin 0 -> 32 bytes
 rtl_bt/rtl8822b_fw.bin | Bin 0 -> 51756 bytes
 3 files changed, 3 insertions(+)
 create mode 100644 rtl_bt/rtl8822b_config.bin
 create mode 100644 rtl_bt/rtl8822b_fw.bin

diff --git a/WHENCE b/WHENCE
index d0bef0d..a9d7c97 100644
--- a/WHENCE
+++ b/WHENCE
@@ -2755,11 +2755,14 @@ File: rtl_bt/rtl8723b_fw.bin
 File: rtl_bt/rtl8761a_fw.bin
 File: rtl_bt/rtl8812ae_fw.bin
 File: rtl_bt/rtl8821a_fw.bin
+File: rtl_bt/rtl8822b_fw.bin
+File: rtl_bt/rtl8822b_config.bin
 
 Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details.
 
 Found in vendor driver, linux_bt_usb_2.11.20140423_8723be.rar
 From https://github.com/troy-tan/driver_store
+Files rtl_bt/rtl8822e_* came directly from Realtek.
 
 --
 
diff --git a/rtl_bt/rtl8822b_config.bin b/rtl_bt/rtl8822b_config.bin
new file mode 100644
index 
..a691e7ca258b0e7dc4ff2bdbdc1d13f2a613526b
GIT binary patch
literal 32
ncmWGtt=ulfaGQbAX&)n#faGpQMq3vKHbEt07gmOw42=2!f)WPF

literal 0
HcmV?d1

diff --git a/rtl_bt/rtl8822b_fw.bin b/rtl_bt/rtl8822b_fw.bin
new file mode 100644
index 
..b7d6d1229491314875b3d4a7266462c47998c0fb
GIT binary patch
literal 51756
zcmeEv31CxYy7oEANt=k+uP>MoZa2eFJYz0z8R73<#DD{*qEmm+`20bhe
zI2H#en}~Bm+M+^1NLt2w?|5%4-~#0iq#%lVr?Si~Nm^2PJ!UA(t2e|f%m=O?|<>r;4s%1hVQ@I+T@c!5h*Zpw8ATEmaHEP0l^;$Uld
zvWvMwewAKlpfImBJi*r*F7+{23UlY+Y?h9{mQErNTzVHJsQ|_98FTB+y=8O5o
zAz%1GDQ9Z})`m5K!hBzNHbT85ncpey68*
zU+=>6UEb(*2A*elqu0Cftk}%0WiHA~n9^Z)^5QH;CtBd{h1)ld7a5gKWGuWmAe|R8
z5_RH|AMs*6{EFqgcrH#SjzO3%+z;t_aWC!({dln%zu%|f#e?xW@q%hWot^9Ek5
z)#$|c6$pp>+e3NLf^a$|!r?v=_iebB#_?h+?jSUAO)4**K%CqA^WrD?X3bb$T#es0
zBJ5t=pUcKO;ufFKiR+O534|Gfy8-Ds5ypowzwgV79NzD{4c};`c=aO6c85$SuEuv&
za0#~~Y=Tbw2;a0O>BN(2UL1yR6u39zejfg7@$KihZ@^uFJl4ZM754_*wVs3qORZ}w
zXLAI!M$=XIm`Czh$DUwSFyg2RGBz(8k+TV9#*{LpGhEDGN_RWTMm`#kA-vd~
zhOd(=IjgCboikf79aMTO?l|~yGiM8|-OyGZpmw1=M@raZj4i_}zHGi(bhe)>soB*Y
zDX$MU2X7dW?zOz!ezv5B-V7sB@%H7}v#*BQo7?-2WT!R<)N{^SdEPuK_1xJy(YdR=
z{$ixO`C|M{?Afy}3Z;}n>E?7;SsTkUHg+xY4%(QY(}@ds&<5@io4LarGPj2U_n&93
zxW+J7YR0_T-g1t)BIYw!R^&=ZwV!bo+mUPdl$lsl%h
zsD{}au~Dw;gH?g}#`p&9epBx5P<*2)w>eZCst-9s>PC%M{In{lZm2>{7Y7Y(mQO*m
zESxM7VIm9@iAeE8B40)#kw5;SByPU)xZ+s
zM{^}q#y{M_iy>AghHz)lzaw}~!JUKC!=W~8j7^S_TkbWqnU3UuzJ|duwxT>$!=vX=
z*Pp~SPRL((-qOrYm0B{OnbT>dS{#RP3*d;liCS4utHNm7ro%Yu2$(*hxTXFD%2yc^
z5JJS*33{+Q0twj~yz}@%WwdOQg&91_jjUaU5sbdufWG^yY@K*ZicVB{T{W!Tw5>iU
z%jE6OfDG*-%j7W5_oTrvJTt%6axMO3W4y<*GjeqRdZ6X-MYOFW5a*?~b_P^o2C*o-
zrjMo4m%d2l#dz~8^h<8NX{YIE)StD>yK}>oeu*%$ue{5@^3HwbU40&0GkZbC~$lg{38l=3?9BbOf%rsb*)w6b@

Re: [PATCH] rtl_bt: Add firmware and config file for RTL8822BE

2016-08-30 Thread Larry Finger

On 08/30/2016 09:51 AM, Ben Hutchings wrote:

On Tue, 2016-08-30 at 09:08 -0500, Larry Finger wrote:

This device is a new model from Realtek. Updates to driver btrtl will
soon be submitted to the kernel.

These files were provided by the Realtek developer.

Signed-off-by: 陆朱伟 
Signed-off-by: Larry Finger 
Cc: linux-blueto...@vger.kernel.org
---
 WHENCE |   3 +++
 rtl_bt/rtl8822b_config.bin | Bin 0 -> 32 bytes
 rtl_bt/rtl8822b_fw.bin | Bin 0 -> 51756 bytes
 3 files changed, 3 insertions(+)
 create mode 100644 rtl_bt/rtl8822b_config.bin
 create mode 100644 rtl_bt/rtl8822b_fw.bin

diff --git a/WHENCE b/WHENCE
index d0bef0d..a9d7c97 100644
--- a/WHENCE
+++ b/WHENCE
@@ -2755,11 +2755,14 @@ File: rtl_bt/rtl8723b_fw.bin
 File: rtl_bt/rtl8761a_fw.bin
 File: rtl_bt/rtl8812ae_fw.bin
 File: rtl_bt/rtl8821a_fw.bin
+File: rtl_bt/rtl8822e_fw.bin
+File: rtl_bt/rtl8822e_config.bin

[...]

Should the filenames begin with "rtl822b" or "rtl822e"?


They should start with rtl8822b. V2 will be sent shortly.

Thanks,

Larry



[PATCH v2] cfg80211: Remove deprecated create_singlethread_workqueue

2016-08-30 Thread Bhaktipriya Shridhar
The workqueue "cfg80211_wq" is involved in cleanup, scan and event related
works. It queues multiple work items >event_work,
>dfs_update_channels_wk,
_to_rdev(request->wiphy)->scan_done_wk,
_to_rdev(wiphy)->sched_scan_results_wk, which require strict
execution ordering.
Hence, an ordered dedicated workqueue has been used.

Since it's a wireless driver, WQ_MEM_RECLAIM has been set to ensure
forward progress under memory pressure.

Signed-off-by: Bhaktipriya Shridhar 
---
 net/wireless/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index d25c82b..2cd4563 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1218,7 +1218,7 @@ static int __init cfg80211_init(void)
if (err)
goto out_fail_reg;

-   cfg80211_wq = create_singlethread_workqueue("cfg80211");
+   cfg80211_wq = alloc_ordered_workqueue("cfg80211", WQ_MEM_RECLAIM);
if (!cfg80211_wq) {
err = -ENOMEM;
goto out_fail_wq;
--
2.1.4



Re: [PATCH v4] brcmfmac: add missing header dependencies

2016-08-30 Thread Kalle Valo
Baoyou Xie  writes:

> On 29 August 2016 at 23:31, Rafał Miłecki  wrote:
>
> On 29 August 2016 at 14:39, Baoyou Xie  wrote:
> > We get 1 warning when build kernel with W=1:
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c:23:6:
> warning: no previous prototype for '__brcmf_err' [-Wmissing-prototypes]
>
> building? I'm not native English, but I think so.
>
>
> > In fact, this function is declared in brcmfmac/debug.h, so this patch
> > add missing header dependencies.
>
> adds
>
>
> > Signed-off-by: Baoyou Xie 
> > Acked-by: Arnd Bergmann 
>
> Please don't resend patches just to add tags like that. This only
> increases a noise and patchwork handles this just fine, see:
> https://patchwork.kernel.org/patch/9303285/
> https://patchwork.kernel.org/patch/9303285/mbox/
>
>
> Do I need to resend a patch that fixes two typos(build/add)? or you modify 
> them
> on your way?

I can fix those when I commit the patch.

-- 
Kalle Valo


Re: [PATCH] rtl_bt: Add firmware and config file for RTL8822BE

2016-08-30 Thread Ben Hutchings
On Tue, 2016-08-30 at 09:08 -0500, Larry Finger wrote:
> This device is a new model from Realtek. Updates to driver btrtl will
> soon be submitted to the kernel.
> 
> These files were provided by the Realtek developer.
> 
> Signed-off-by: 陆朱伟 
> Signed-off-by: Larry Finger 
> Cc: linux-blueto...@vger.kernel.org
> ---
>  WHENCE |   3 +++
>  rtl_bt/rtl8822b_config.bin | Bin 0 -> 32 bytes
>  rtl_bt/rtl8822b_fw.bin | Bin 0 -> 51756 bytes
>  3 files changed, 3 insertions(+)
>  create mode 100644 rtl_bt/rtl8822b_config.bin
>  create mode 100644 rtl_bt/rtl8822b_fw.bin
> 
> diff --git a/WHENCE b/WHENCE
> index d0bef0d..a9d7c97 100644
> --- a/WHENCE
> +++ b/WHENCE
> @@ -2755,11 +2755,14 @@ File: rtl_bt/rtl8723b_fw.bin
>  File: rtl_bt/rtl8761a_fw.bin
>  File: rtl_bt/rtl8812ae_fw.bin
>  File: rtl_bt/rtl8821a_fw.bin
> +File: rtl_bt/rtl8822e_fw.bin
> +File: rtl_bt/rtl8822e_config.bin
[...]

Should the filenames begin with "rtl822b" or "rtl822e"?

Ben.

-- 
Ben Hutchings
All the simple programs have been written, and all the good names
taken.


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


Re: [PATCH] ath6kl: enable firmware crash dumps on the AR6004

2016-08-30 Thread Dan Kephart
Sorry Kalle, I did not intend to re-send this patch up, it is the same as the 
previous one.


On 8/30/16, 10:19 AM, "linux-wireless-ow...@vger.kernel.org on behalf of Valo, 
Kalle"  wrote:

engineer...@keppy.com writes:

> From: Dan Kephart 
>
> The firmware crash dumps on the 6004 are the same as the 6003. Remove the
> statement guarding it from dumping on the 6004.  Renamed the
> REG_DUMP_COUNT_AR6003 to reflect support on both chips.
>
> Signed-off-by: Dan Kephart 

I have a similar patch already on my queue:

https://patchwork.kernel.org/patch/9262289/

How does this differ from that? Please _always_ add a changelog so that
people know what has changed. Also remember to add "[PATCH v2]" to the
title.


https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#subject_name

-- 
Kalle Valo




Re: [PATCH] ath6kl: enable firmware crash dumps on the AR6004

2016-08-30 Thread Valo, Kalle
engineer...@keppy.com writes:

> From: Dan Kephart 
>
> The firmware crash dumps on the 6004 are the same as the 6003. Remove the
> statement guarding it from dumping on the 6004.  Renamed the
> REG_DUMP_COUNT_AR6003 to reflect support on both chips.
>
> Signed-off-by: Dan Kephart 

I have a similar patch already on my queue:

https://patchwork.kernel.org/patch/9262289/

How does this differ from that? Please _always_ add a changelog so that
people know what has changed. Also remember to add "[PATCH v2]" to the
title.

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#subject_name

-- 
Kalle Valo

[PATCH] rtl_bt: Add firmware and config file for RTL8822BE

2016-08-30 Thread Larry Finger
This device is a new model from Realtek. Updates to driver btrtl will
soon be submitted to the kernel.

These files were provided by the Realtek developer.

Signed-off-by: 陆朱伟 
Signed-off-by: Larry Finger 
Cc: linux-blueto...@vger.kernel.org
---
 WHENCE |   3 +++
 rtl_bt/rtl8822b_config.bin | Bin 0 -> 32 bytes
 rtl_bt/rtl8822b_fw.bin | Bin 0 -> 51756 bytes
 3 files changed, 3 insertions(+)
 create mode 100644 rtl_bt/rtl8822b_config.bin
 create mode 100644 rtl_bt/rtl8822b_fw.bin

diff --git a/WHENCE b/WHENCE
index d0bef0d..a9d7c97 100644
--- a/WHENCE
+++ b/WHENCE
@@ -2755,11 +2755,14 @@ File: rtl_bt/rtl8723b_fw.bin
 File: rtl_bt/rtl8761a_fw.bin
 File: rtl_bt/rtl8812ae_fw.bin
 File: rtl_bt/rtl8821a_fw.bin
+File: rtl_bt/rtl8822e_fw.bin
+File: rtl_bt/rtl8822e_config.bin
 
 Licence: Redistributable. See LICENCE.rtlwifi_firmware.txt for details.
 
 Found in vendor driver, linux_bt_usb_2.11.20140423_8723be.rar
 From https://github.com/troy-tan/driver_store
+Files rtl_bt/rtl8822e_* came directly from Realtek.
 
 --
 
diff --git a/rtl_bt/rtl8822b_config.bin b/rtl_bt/rtl8822b_config.bin
new file mode 100644
index 
..a691e7ca258b0e7dc4ff2bdbdc1d13f2a613526b
GIT binary patch
literal 32
ncmWGtt=ulfaGQbAX&)n#faGpQMq3vKHbEt07gmOw42=2!f)WPF

literal 0
HcmV?d1

diff --git a/rtl_bt/rtl8822b_fw.bin b/rtl_bt/rtl8822b_fw.bin
new file mode 100644
index 
..b7d6d1229491314875b3d4a7266462c47998c0fb
GIT binary patch
literal 51756
zcmeEv31CxYy7oEANt=k+uP>MoZa2eFJYz0z8R73<#DD{*qEmm+`20bhe
zI2H#en}~Bm+M+^1NLt2w?|5%4-~#0iq#%lVr?Si~Nm^2PJ!UA(t2e|f%m=O?|<>r;4s%1hVQ@I+T@c!5h*Zpw8ATEmaHEP0l^;$Uld
zvWvMwewAKlpfImBJi*r*F7+{23UlY+Y?h9{mQErNTzVHJsQ|_98FTB+y=8O5o
zAz%1GDQ9Z})`m5K!hBzNHbT85ncpey68*
zU+=>6UEb(*2A*elqu0Cftk}%0WiHA~n9^Z)^5QH;CtBd{h1)ld7a5gKWGuWmAe|R8
z5_RH|AMs*6{EFqgcrH#SjzO3%+z;t_aWC!({dln%zu%|f#e?xW@q%hWot^9Ek5
z)#$|c6$pp>+e3NLf^a$|!r?v=_iebB#_?h+?jSUAO)4**K%CqA^WrD?X3bb$T#es0
zBJ5t=pUcKO;ufFKiR+O534|Gfy8-Ds5ypowzwgV79NzD{4c};`c=aO6c85$SuEuv&
za0#~~Y=Tbw2;a0O>BN(2UL1yR6u39zejfg7@$KihZ@^uFJl4ZM754_*wVs3qORZ}w
zXLAI!M$=XIm`Czh$DUwSFyg2RGBz(8k+TV9#*{LpGhEDGN_RWTMm`#kA-vd~
zhOd(=IjgCboikf79aMTO?l|~yGiM8|-OyGZpmw1=M@raZj4i_}zHGi(bhe)>soB*Y
zDX$MU2X7dW?zOz!ezv5B-V7sB@%H7}v#*BQo7?-2WT!R<)N{^SdEPuK_1xJy(YdR=
z{$ixO`C|M{?Afy}3Z;}n>E?7;SsTkUHg+xY4%(QY(}@ds&<5@io4LarGPj2U_n&93
zxW+J7YR0_T-g1t)BIYw!R^&=ZwV!bo+mUPdl$lsl%h
zsD{}au~Dw;gH?g}#`p&9epBx5P<*2)w>eZCst-9s>PC%M{In{lZm2>{7Y7Y(mQO*m
zESxM7VIm9@iAeE8B40)#kw5;SByPU)xZ+s
zM{^}q#y{M_iy>AghHz)lzaw}~!JUKC!=W~8j7^S_TkbWqnU3UuzJ|duwxT>$!=vX=
z*Pp~SPRL((-qOrYm0B{OnbT>dS{#RP3*d;liCS4utHNm7ro%Yu2$(*hxTXFD%2yc^
z5JJS*33{+Q0twj~yz}@%WwdOQg&91_jjUaU5sbdufWG^yY@K*ZicVB{T{W!Tw5>iU
z%jE6OfDG*-%j7W5_oTrvJTt%6axMO3W4y<*GjeqRdZ6X-MYOFW5a*?~b_P^o2C*o-
zrjMo4m%d2l#dz~8^h<8NX{YIE)StD>yK}>oeu*%$ue{5@^3HwbU40&0GkZbC~$lg{38l=3?9BbOf%rsb*)w6b@

[PATCH] ath6kl: enable firmware crash dumps on the AR6004

2016-08-30 Thread engineering
From: Dan Kephart 

The firmware crash dumps on the 6004 are the same as the 6003. Remove the
statement guarding it from dumping on the 6004.  Renamed the
REG_DUMP_COUNT_AR6003 to reflect support on both chips.

Signed-off-by: Dan Kephart 
---
 drivers/net/wireless/ath/ath6kl/hif.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/hif.c 
b/drivers/net/wireless/ath/ath6kl/hif.c
index 18c0708..d194253 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -64,7 +64,7 @@ int ath6kl_hif_rw_comp_handler(void *context, int status)
 }
 EXPORT_SYMBOL(ath6kl_hif_rw_comp_handler);
 
-#define REG_DUMP_COUNT_AR6003   60
+#define REGISTER_DUMP_COUNT 60
 #define REGISTER_DUMP_LEN_MAX   60
 
 static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
@@ -73,9 +73,6 @@ static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
u32 i, address, regdump_addr = 0;
int ret;
 
-   if (ar->target_type != TARGET_TYPE_AR6003)
-   return;
-
/* the reg dump pointer is copied to the host interest area */
address = ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_failure_state));
address = TARG_VTOP(ar->target_type, address);
@@ -95,7 +92,7 @@ static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
 
/* fetch register dump data */
ret = ath6kl_diag_read(ar, regdump_addr, (u8 *)_val[0],
- REG_DUMP_COUNT_AR6003 * (sizeof(u32)));
+ REGISTER_DUMP_COUNT * (sizeof(u32)));
if (ret) {
ath6kl_warn("failed to get register dump: %d\n", ret);
return;
@@ -105,9 +102,9 @@ static void ath6kl_hif_dump_fw_crash(struct ath6kl *ar)
ath6kl_info("hw 0x%x fw %s\n", ar->wiphy->hw_version,
ar->wiphy->fw_version);
 
-   BUILD_BUG_ON(REG_DUMP_COUNT_AR6003 % 4);
+   BUILD_BUG_ON(REGISTER_DUMP_COUNT % 4);
 
-   for (i = 0; i < REG_DUMP_COUNT_AR6003; i += 4) {
+   for (i = 0; i < REGISTER_DUMP_COUNT; i += 4) {
ath6kl_info("%d: 0x%8.8x 0x%8.8x 0x%8.8x 0x%8.8x\n",
i,
le32_to_cpu(regdump_val[i]),
-- 
2.4.10



[PATCH v4] mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue.

2016-08-30 Thread Toke Høiland-Jørgensen
The TXQ intermediate queues can cause packet reordering when more than
one flow is active to a single station. Since some of the wifi-specific
packet handling (notably sequence number and encryption handling) is
sensitive to re-ordering, things break if they are applied before the
TXQ.

This splits up the TX handlers and fast_xmit logic into two parts: An
early part and a late part. The former is applied before TXQ enqueue,
and the latter after dequeue. The non-TXQ path just applies both parts
at once.

To avoid having to deal with fragmentation on dequeue, the split is set
to be after the fragmentation handler. This means that some reordering
of TX handlers is necessary, and some handlers had to be made aware of
fragmentation due to this reordering.

This approach avoids having to scatter special cases for when TXQ is
enabled, at the cost of making the fast_xmit and TX handler code
slightly more complex.

Signed-off-by: Toke Høiland-Jørgensen 
---
Changes since v3:
  - Fix sequence number assignment in the fast path.
  - Code cleanup.

 include/net/mac80211.h |   2 +
 net/mac80211/tx.c  | 269 ++---
 net/mac80211/wpa.c |  18 +++-
 3 files changed, 227 insertions(+), 62 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index cca510a..9a6a3e9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -715,6 +715,7 @@ enum mac80211_tx_info_flags {
  * frame (PS-Poll or uAPSD).
  * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information
  * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
+ * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
  *
  * These flags are used in tx_info->control.flags.
  */
@@ -723,6 +724,7 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_CTRL_PS_RESPONSE   = BIT(1),
IEEE80211_TX_CTRL_RATE_INJECT   = BIT(2),
IEEE80211_TX_CTRL_AMSDU = BIT(3),
+   IEEE80211_TX_CTRL_FAST_XMIT = BIT(4),
 };
 
 /*
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1d0746d..56dca2d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -38,6 +38,12 @@
 #include "wme.h"
 #include "rate.h"
 
+static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx);
+static bool ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
+  struct sta_info *sta,
+  struct ieee80211_fast_tx *fast_tx,
+  struct sk_buff *skb, bool xmit);
+
 /* misc utils */
 
 static inline void ieee80211_tx_stats(struct net_device *dev, u32 len)
@@ -585,20 +591,27 @@ static ieee80211_tx_result debug_noinline
 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 {
struct ieee80211_key *key;
-   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
-   struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
+   struct ieee80211_tx_info *info;
+   struct ieee80211_hdr *hdr;
+   struct sk_buff *skb = tx->skb;
+
+   if (!skb)
+   skb = skb_peek(>skbs);
+
+   info = IEEE80211_SKB_CB(skb);
+   hdr = (struct ieee80211_hdr *)skb->data;
 
if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT))
tx->key = NULL;
else if (tx->sta &&
 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx])))
tx->key = key;
-   else if (ieee80211_is_group_privacy_action(tx->skb) &&
+   else if (ieee80211_is_group_privacy_action(skb) &&
(key = rcu_dereference(tx->sdata->default_multicast_key)))
tx->key = key;
else if (ieee80211_is_mgmt(hdr->frame_control) &&
 is_multicast_ether_addr(hdr->addr1) &&
-ieee80211_is_robust_mgmt_frame(tx->skb) &&
+ieee80211_is_robust_mgmt_frame(skb) &&
 (key = rcu_dereference(tx->sdata->default_mgmt_key)))
tx->key = key;
else if (is_multicast_ether_addr(hdr->addr1) &&
@@ -628,8 +641,8 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
case WLAN_CIPHER_SUITE_GCMP_256:
if (!ieee80211_is_data_present(hdr->frame_control) &&
!ieee80211_use_mfp(hdr->frame_control, tx->sta,
-  tx->skb) &&
-   !ieee80211_is_group_privacy_action(tx->skb))
+  skb) &&
+   !ieee80211_is_group_privacy_action(skb))
tx->key = NULL;
else
skip_hw = (tx->key->conf.flags &
@@ -799,10 +812,12 @@ static __le16 ieee80211_tx_next_seq(struct sta_info *sta, 
int tid)
 static ieee80211_tx_result debug_noinline
 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 {
-   

[PATCH 16/16] iwlwifi: pcie: remove dead code

2016-08-30 Thread Luca Coelho
From: Sara Sharon 

If device family is 8000 then iwl_pcie_load_cpu_sections()
won't be called at all (iwl_pcie_load_cpu_sections_8000() is
called in that case) so this piece of code never gets called.

Signed-off-by: Sara Sharon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-prph.h   | 13 -
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c |  8 
 2 files changed, 21 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
index 849ee79..406ef30 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
@@ -302,7 +302,6 @@
 #define OSC_CLK_FORCE_CONTROL  (0x8)
 
 #define FH_UCODE_LOAD_STATUS   (0x1AF0)
-#define CSR_UCODE_LOAD_STATUS_ADDR (0x1E70)
 
 /*
  * Replacing FH_UCODE_LOAD_STATUS
@@ -311,21 +310,9 @@
  */
 #define UREG_UCODE_LOAD_STATUS (0xa05c40)
 
-enum secure_load_status_reg {
-   LMPM_CPU_UCODE_LOADING_STARTED  = 0x0001,
-   LMPM_CPU_HDRS_LOADING_COMPLETED = 0x0003,
-   LMPM_CPU_UCODE_LOADING_COMPLETED= 0x0007,
-   LMPM_CPU_STATUS_NUM_OF_LAST_COMPLETED   = 0x00F8,
-   LMPM_CPU_STATUS_NUM_OF_LAST_LOADED_BLOCK= 0xFF00,
-};
-
-#define LMPM_SECURE_INSPECTOR_CODE_ADDR(0x1E38)
-#define LMPM_SECURE_INSPECTOR_DATA_ADDR(0x1E3C)
 #define LMPM_SECURE_UCODE_LOAD_CPU1_HDR_ADDR   (0x1E78)
 #define LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR   (0x1E7C)
 
-#define LMPM_SECURE_INSPECTOR_CODE_MEM_SPACE   (0x40)
-#define LMPM_SECURE_INSPECTOR_DATA_MEM_SPACE   (0x402000)
 #define LMPM_SECURE_CPU1_HDR_MEM_SPACE (0x42)
 #define LMPM_SECURE_CPU2_HDR_MEM_SPACE (0x420400)
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 039eeca..2f46eed 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -903,14 +903,6 @@ static int iwl_pcie_load_cpu_sections(struct iwl_trans 
*trans,
return ret;
}
 
-   if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)
-   iwl_set_bits_prph(trans,
- CSR_UCODE_LOAD_STATUS_ADDR,
- (LMPM_CPU_UCODE_LOADING_COMPLETED |
-  LMPM_CPU_HDRS_LOADING_COMPLETED |
-  LMPM_CPU_UCODE_LOADING_STARTED) <<
-   shift_param);
-
*first_ucode_section = last_read_idx;
 
return 0;
-- 
2.8.1



[PATCH 13/16] iwlwifi: add the new 9170 series

2016-08-30 Thread Luca Coelho
From: Oren Givon 

Add a new config struct for the new 9170 series and add
the first PCI ID for it.

Signed-off-by: Oren Givon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-9000.c   | 10 ++
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |  1 +
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   |  1 +
 3 files changed, 12 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c 
b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
index e442650..1fec6af 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
@@ -146,6 +146,16 @@ static const struct iwl_tt_params iwl9000_tt_params = {
.mac_addr_from_csr = true,  \
.rf_id = true
 
+const struct iwl_cfg iwl9160_2ac_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 9160",
+   .fw_name_pre = IWL9260_FW_PRE,
+   IWL_DEVICE_9000,
+   .ht_params = _ht_params,
+   .nvm_ver = IWL9000_NVM_VERSION,
+   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
+   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+};
+
 const struct iwl_cfg iwl9260_2ac_cfg = {
.name = "Intel(R) Dual Band Wireless AC 9260",
.fw_name_pre = IWL9260_FW_PRE,
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 0ab415c..7008319 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -450,6 +450,7 @@ extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl8265_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl4165_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl9000lc_2ac_cfg;
+extern const struct iwl_cfg iwl9160_2ac_cfg;
 extern const struct iwl_cfg iwl9260_2ac_cfg;
 extern const struct iwl_cfg iwl9270_2ac_cfg;
 extern const struct iwl_cfg iwl9460_2ac_cfg;
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 1be0ac2..c6e24fb 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -502,6 +502,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x24FD, 0x0850, iwl8265_2ac_cfg)},
 
 /* 9000 Series */
+   {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x, iwl9260_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x1410, iwl9270_2ac_cfg)},
-- 
2.8.1



[PATCH 15/16] iwlwifi: pcie: fix ucode load flow for a000 devices

2016-08-30 Thread Luca Coelho
From: Sara Sharon 

Turns out we should access TFH relative addresses.
Also, the FH_UCODE_LOAD_STATUS was replaced by
UREG_UCODE_LOAD_STATUS.

Signed-off-by: Sara Sharon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-fh.h | 15 ++-
 drivers/net/wireless/intel/iwlwifi/iwl-prph.h   |  8 ++
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 33 +++--
 3 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fh.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-fh.h
index 1d6f5d2..dd75ea7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-fh.h
@@ -77,7 +77,6 @@
  */
 #define FH_MEM_LOWER_BOUND   (0x1000)
 #define FH_MEM_UPPER_BOUND   (0x2000)
-#define TFH_MEM_LOWER_BOUND  (0xA06000)
 
 /**
  * Keep-Warm (KW) buffer base address.
@@ -120,7 +119,7 @@
 #define FH_MEM_CBBC_20_31_LOWER_BOUND  (FH_MEM_LOWER_BOUND + 0xB20)
 #define FH_MEM_CBBC_20_31_UPPER_BOUND  (FH_MEM_LOWER_BOUND + 0xB80)
 /* a000 TFD table address, 64 bit */
-#define TFH_TFDQ_CBB_TABLE (TFH_MEM_LOWER_BOUND + 0x1C00)
+#define TFH_TFDQ_CBB_TABLE (0x1C00)
 
 /* Find TFD CB base pointer for given queue */
 static inline unsigned int FH_MEM_CBBC_QUEUE(struct iwl_trans *trans,
@@ -156,7 +155,7 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(struct 
iwl_trans *trans,
  * In case of DRAM read address which is not aligned to 128B, the TFH will
  * enable transfer size which doesn't cross 64B DRAM address boundary.
 */
-#define TFH_TRANSFER_MODE  (TFH_MEM_LOWER_BOUND + 0x1F40)
+#define TFH_TRANSFER_MODE  (0x1F40)
 #define TFH_TRANSFER_MAX_PENDING_REQ   0xc
 #define TFH_CHUNK_SIZE_128 BIT(8)
 #define TFH_CHUNK_SPLIT_MODE   BIT(10)
@@ -167,7 +166,7 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(struct 
iwl_trans *trans,
  * the start of the TFD first TB.
  * In case of a DRAM Tx CMD update the TFH will update PN and Key ID
  */
-#define TFH_TXCMD_UPDATE_CFG   (TFH_MEM_LOWER_BOUND + 0x1F48)
+#define TFH_TXCMD_UPDATE_CFG   (0x1F48)
 /*
  * Controls TX DMA operation
  *
@@ -181,22 +180,22 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(struct 
iwl_trans *trans,
  * set to 1 - interrupt is sent to the driver
  * Bit 0: Indicates the snoop configuration
 */
-#define TFH_SRV_DMA_CHNL0_CTRL (TFH_MEM_LOWER_BOUND + 0x1F60)
+#define TFH_SRV_DMA_CHNL0_CTRL (0x1F60)
 #define TFH_SRV_DMA_SNOOP  BIT(0)
 #define TFH_SRV_DMA_TO_DRIVER  BIT(24)
 #define TFH_SRV_DMA_START  BIT(31)
 
 /* Defines the DMA SRAM write start address to transfer a data block */
-#define TFH_SRV_DMA_CHNL0_SRAM_ADDR(TFH_MEM_LOWER_BOUND + 0x1F64)
+#define TFH_SRV_DMA_CHNL0_SRAM_ADDR(0x1F64)
 
 /* Defines the 64bits DRAM start address to read the DMA data block from */
-#define TFH_SRV_DMA_CHNL0_DRAM_ADDR(TFH_MEM_LOWER_BOUND + 0x1F68)
+#define TFH_SRV_DMA_CHNL0_DRAM_ADDR(0x1F68)
 
 /*
  * Defines the number of bytes to transfer from DRAM to SRAM.
  * Note that this register may be configured with non-dword aligned size.
  */
-#define TFH_SRV_DMA_CHNL0_BC   (TFH_MEM_LOWER_BOUND + 0x1F70)
+#define TFH_SRV_DMA_CHNL0_BC   (0x1F70)
 
 /**
  * Rx SRAM Control and Status Registers (RSCSR)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
index 459bf73..849ee79 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
@@ -303,6 +303,14 @@
 
 #define FH_UCODE_LOAD_STATUS   (0x1AF0)
 #define CSR_UCODE_LOAD_STATUS_ADDR (0x1E70)
+
+/*
+ * Replacing FH_UCODE_LOAD_STATUS
+ * This register is writen by driver and is read by uCode during boot flow.
+ * Note this address is cleared after MAC reset.
+ */
+#define UREG_UCODE_LOAD_STATUS (0xa05c40)
+
 enum secure_load_status_reg {
LMPM_CPU_UCODE_LOADING_STARTED  = 0x0001,
LMPM_CPU_HDRS_LOADING_COMPLETED = 0x0003,
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 559f118..039eeca 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -827,10 +827,16 @@ static int iwl_pcie_load_cpu_sections_8000(struct 
iwl_trans *trans,
if (ret)
return ret;
 
-   /* Notify the ucode of the loaded section number and status */
-   val = iwl_read_direct32(trans, FH_UCODE_LOAD_STATUS);
-   val = val | (sec_num << shift_param);
-   iwl_write_direct32(trans, FH_UCODE_LOAD_STATUS, val);
+   /* Notify ucode of loaded section number and status */
+   if 

[PATCH 03/16] iwlwifi: mvm: support new paging command format

2016-08-30 Thread Luca Coelho
From: Sara Sharon 

For a000 devices there is a support of 64 bit DMA addressing.
The paging command was changed accordingly - support it.

Signed-off-by: Sara Sharon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h |  8 +--
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 28 ++---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h|  6 ++
 3 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
index 71076f0..57b574b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
@@ -482,13 +482,17 @@ struct iwl_nvm_access_cmd {
  * @block_size: the block size in powers of 2
  * @block_num: number of blocks specified in the command.
  * @device_phy_addr: virtual addresses from device side
+ * 32 bit address for API version 1, 64 bit address for API version 2.
 */
 struct iwl_fw_paging_cmd {
__le32 flags;
__le32 block_size;
__le32 block_num;
-   __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
-} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
+   union {
+   __le32 addr32[NUM_OF_FW_PAGING_BLOCKS];
+   __le64 addr64[NUM_OF_FW_PAGING_BLOCKS];
+   } device_phy_addr;
+} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
 
 /*
  * Fw items ID's
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 7e0cdbf..47e8e70 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -385,9 +385,7 @@ static int iwl_save_fw_paging(struct iwl_mvm *mvm,
 /* send paging cmd to FW in case CPU2 has paging image */
 static int iwl_send_paging_cmd(struct iwl_mvm *mvm, const struct fw_img *fw)
 {
-   int blk_idx;
-   __le32 dev_phy_addr;
-   struct iwl_fw_paging_cmd fw_paging_cmd = {
+   struct iwl_fw_paging_cmd paging_cmd = {
.flags =
cpu_to_le32(PAGING_CMD_IS_SECURED |
PAGING_CMD_IS_ENABLED |
@@ -396,18 +394,32 @@ static int iwl_send_paging_cmd(struct iwl_mvm *mvm, const 
struct fw_img *fw)
.block_size = cpu_to_le32(BLOCK_2_EXP_SIZE),
.block_num = cpu_to_le32(mvm->num_of_paging_blk),
};
+   int blk_idx, size = sizeof(paging_cmd);
+
+   /* A bit hard coded - but this is the old API and will be deprecated */
+   if (!iwl_mvm_has_new_tx_api(mvm))
+   size -= NUM_OF_FW_PAGING_BLOCKS * 4;
 
/* loop for for all paging blocks + CSS block */
for (blk_idx = 0; blk_idx < mvm->num_of_paging_blk + 1; blk_idx++) {
-   dev_phy_addr =
-   cpu_to_le32(mvm->fw_paging_db[blk_idx].fw_paging_phys >>
-   PAGE_2_EXP_SIZE);
-   fw_paging_cmd.device_phy_addr[blk_idx] = dev_phy_addr;
+   dma_addr_t addr = mvm->fw_paging_db[blk_idx].fw_paging_phys;
+
+   addr = addr >> PAGE_2_EXP_SIZE;
+
+   if (iwl_mvm_has_new_tx_api(mvm)) {
+   __le64 phy_addr = cpu_to_le64(addr);
+
+   paging_cmd.device_phy_addr.addr64[blk_idx] = phy_addr;
+   } else {
+   __le32 phy_addr = cpu_to_le32(addr);
+
+   paging_cmd.device_phy_addr.addr32[blk_idx] = phy_addr;
+   }
}
 
return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(FW_PAGING_BLOCK_CMD,
IWL_ALWAYS_LONG_GROUP, 0),
-   0, sizeof(fw_paging_cmd), _paging_cmd);
+   0, size, _cmd);
 }
 
 /*
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 0b0855a..28ebc12 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1192,6 +1192,12 @@ static inline bool iwl_mvm_has_new_rx_api(struct iwl_mvm 
*mvm)
   IWL_UCODE_TLV_CAPA_MULTI_QUEUE_RX_SUPPORT);
 }
 
+static inline bool iwl_mvm_has_new_tx_api(struct iwl_mvm *mvm)
+{
+   /* TODO - replace with TLV once defined */
+   return mvm->trans->cfg->use_tfh;
+}
+
 static inline bool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm)
 {
 #ifdef CONFIG_THERMAL
-- 
2.8.1



[PATCH 08/16] iwlwifi: mvm: support txq tid owner change

2016-08-30 Thread Luca Coelho
From: Liad Kaufman 

Every active TXQ is assigned to a TID given through the
SCD_CONFIG_CMD, and acts as an identifier in the FW. However,
there may be cases this ownership needs to be changed.

For example, in the following scenario:
 1. TID x is owner of a queue
 2. Due to a shortage of queues, TID y and z share with x
 3. TID x becomes inactive and needs to be removed from the
shared queue.
In this scenario, if another queue is freed and traffic on x
continues, we can't allocate it a new queue as long as it is
the owner of the first queue.

Support moving ownership of a TXQ to a different TID (same
STA) without stopping the queue.

Signed-off-by: Liad Kaufman 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 51 
 1 file changed, 51 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index e87473a..30fc3af 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -850,6 +850,41 @@ out_err:
return ret;
 }
 
+static void iwl_mvm_change_queue_owner(struct iwl_mvm *mvm, int queue)
+{
+   struct iwl_scd_txq_cfg_cmd cmd = {
+   .scd_queue = queue,
+   .action = SCD_CFG_UPDATE_QUEUE_TID,
+   };
+   s8 sta_id;
+   int tid;
+   unsigned long tid_bitmap;
+   int ret;
+
+   lockdep_assert_held(>mutex);
+
+   spin_lock_bh(>queue_info_lock);
+   sta_id = mvm->queue_info[queue].ra_sta_id;
+   tid_bitmap = mvm->queue_info[queue].tid_bitmap;
+   spin_unlock_bh(>queue_info_lock);
+
+   if (WARN(!tid_bitmap, "TXQ %d has no tids assigned to it\n", queue))
+   return;
+
+   /* Find any TID for queue */
+   tid = find_first_bit(_bitmap, IWL_MAX_TID_COUNT + 1);
+   cmd.tid = tid;
+   cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[tid_to_mac80211_ac[tid]];
+
+   ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd), );
+   if (ret)
+   IWL_ERR(mvm, "Failed to update owner of TXQ %d (ret=%d)\n",
+   queue, ret);
+   else
+   IWL_DEBUG_TX_QUEUES(mvm, "Changed TXQ %d ownership to tid %d\n",
+   queue, tid);
+}
+
 static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue)
 {
struct ieee80211_sta *sta;
@@ -1005,14 +1040,30 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct 
*wk)
/* Reconfigure queues requiring reconfiguation */
for (queue = 0; queue < IWL_MAX_HW_QUEUES; queue++) {
bool reconfig;
+   bool change_owner;
 
spin_lock_bh(>queue_info_lock);
reconfig = (mvm->queue_info[queue].status ==
IWL_MVM_QUEUE_RECONFIGURING);
+
+   /*
+* We need to take into account a situation in which a TXQ was
+* allocated to TID x, and then turned shared by adding TIDs y
+* and z. If TID x becomes inactive and is removed from the TXQ,
+* ownership must be given to one of the remaining TIDs.
+* This is mainly because if TID x continues - a new queue can't
+* be allocated for it as long as it is an owner of another TXQ.
+*/
+   change_owner = !(mvm->queue_info[queue].tid_bitmap &
+BIT(mvm->queue_info[queue].txq_tid)) &&
+  (mvm->queue_info[queue].status ==
+   IWL_MVM_QUEUE_SHARED);
spin_unlock_bh(>queue_info_lock);
 
if (reconfig)
iwl_mvm_unshare_queue(mvm, queue);
+   else if (change_owner)
+   iwl_mvm_change_queue_owner(mvm, queue);
}
 
/* Go over all stations with deferred traffic */
-- 
2.8.1



[PATCH 06/16] iwlwifi: mvm: re-assign old queues after hw restart in dqa mode

2016-08-30 Thread Luca Coelho
From: Liad Kaufman 

When working in DQA mode, if a queue is shared and a HW restart
occurs, there might be a possible race condition between
stations on the queues, and an existing queue might be left
with no queues.

To solve this, make sure in DQA mode to re-assign the same
queues as before the HW restart.

Signed-off-by: Liad Kaufman 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 72 +++-
 1 file changed, 70 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 730ba78..1ddcbea 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -759,8 +759,9 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
spin_unlock_bh(>queue_info_lock);
 
/* Disable the queue */
-   iwl_mvm_invalidate_sta_queue(mvm, queue, disable_agg_tids,
-true);
+   if (disable_agg_tids)
+   iwl_mvm_invalidate_sta_queue(mvm, queue,
+disable_agg_tids, false);
iwl_trans_txq_disable(mvm->trans, queue, false);
ret = iwl_mvm_send_cmd_pdu(mvm, SCD_QUEUE_CFG, 0, sizeof(cmd),
   );
@@ -776,6 +777,10 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
 
return ret;
}
+
+   /* If TXQ is allocated to another STA, update removal in FW */
+   if (cmd.sta_id != mvmsta->sta_id)
+   iwl_mvm_invalidate_sta_queue(mvm, queue, 0, true);
}
 
IWL_DEBUG_TX_QUEUES(mvm,
@@ -1072,6 +1077,61 @@ static int iwl_mvm_reserve_sta_stream(struct iwl_mvm 
*mvm,
return 0;
 }
 
+/*
+ * In DQA mode, after a HW restart the queues should be allocated as before, in
+ * order to avoid race conditions when there are shared queues. This function
+ * does the re-mapping and queue allocation.
+ *
+ * Note that re-enabling aggregations isn't done in this function.
+ */
+static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm,
+struct iwl_mvm_sta *mvm_sta)
+{
+   unsigned int wdg_timeout =
+   iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false);
+   int i;
+   struct iwl_trans_txq_scd_cfg cfg = {
+   .sta_id = mvm_sta->sta_id,
+   .frame_limit = IWL_FRAME_LIMIT,
+   };
+
+   /* Make sure reserved queue is still marked as such (or allocated) */
+   mvm->queue_info[mvm_sta->reserved_queue].status =
+   IWL_MVM_QUEUE_RESERVED;
+
+   for (i = 0; i <= IWL_MAX_TID_COUNT; i++) {
+   struct iwl_mvm_tid_data *tid_data = _sta->tid_data[i];
+   int txq_id = tid_data->txq_id;
+   int ac;
+   u8 mac_queue;
+
+   if (txq_id == IEEE80211_INVAL_HW_QUEUE)
+   continue;
+
+   skb_queue_head_init(_data->deferred_tx_frames);
+
+   ac = tid_to_mac80211_ac[i];
+   mac_queue = mvm_sta->vif->hw_queue[ac];
+
+   cfg.tid = i;
+   cfg.fifo = iwl_mvm_ac_to_tx_fifo[ac];
+   cfg.aggregate = (txq_id >= IWL_MVM_DQA_MIN_DATA_QUEUE ||
+txq_id == IWL_MVM_DQA_BSS_CLIENT_QUEUE);
+
+   IWL_DEBUG_TX_QUEUES(mvm,
+   "Re-mapping sta %d tid %d to queue %d\n",
+   mvm_sta->sta_id, i, txq_id);
+
+   iwl_mvm_enable_txq(mvm, txq_id, mac_queue,
+  IEEE80211_SEQ_TO_SN(tid_data->seq_number),
+  , wdg_timeout);
+
+   mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_READY;
+   }
+
+   atomic_set(>pending_frames[mvm_sta->sta_id], 0);
+}
+
 int iwl_mvm_add_sta(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
@@ -1094,6 +1154,13 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
 
spin_lock_init(_sta->lock);
 
+   /* In DQA mode, if this is a HW restart, re-alloc existing queues */
+   if (iwl_mvm_is_dqa_supported(mvm) &&
+   test_bit(IWL_MVM_STATUS_IN_HW_RESTART, >status)) {
+   iwl_mvm_realloc_queues_after_restart(mvm, mvm_sta);
+   goto update_fw;
+   }
+
mvm_sta->sta_id = sta_id;
mvm_sta->mac_id_n_color = FW_CMD_ID_AND_COLOR(mvmvif->id,
  mvmvif->color);
@@ -1157,6 +1224,7 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
goto err;
}
 
+update_fw:
ret = iwl_mvm_sta_send_to_fw(mvm, sta, false, 0);
  

[PATCH 14/16] iwlwifi: pcie: refrain from SCD accesses

2016-08-30 Thread Luca Coelho
From: Sara Sharon 

Up till now we accessed SCD configuration only for initial
configuration and for enabling command queue.
For a000 generation the command queue is open by default
and firmware configures the rest. No driver SCD accesses
are expected. Make sure this is the case.

Signed-off-by: Sara Sharon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c |  4 
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c| 13 -
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 74f2f03..559f118 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -1960,6 +1960,10 @@ void iwl_trans_pcie_log_scd_error(struct iwl_trans 
*trans, struct iwl_txq *txq)
IWL_ERR(trans, "Current SW read_ptr %d write_ptr %d\n",
txq->q.read_ptr, txq->q.write_ptr);
 
+   if (trans->cfg->use_tfh)
+   /* TODO: access new SCD registers and dump them */
+   return;
+
scd_sram_addr = trans_pcie->scd_base_addr +
SCD_TX_STTS_QUEUE_OFFSET(txq->q.id);
iwl_trans_read_mem_bytes(trans, scd_sram_addr, buf, sizeof(buf));
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
index 18650dc..9636dc8 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -703,6 +703,9 @@ void iwl_pcie_tx_start(struct iwl_trans *trans, u32 
scd_base_addr)
memset(trans_pcie->queue_stopped, 0, sizeof(trans_pcie->queue_stopped));
memset(trans_pcie->queue_used, 0, sizeof(trans_pcie->queue_used));
 
+   if (trans->cfg->use_tfh)
+   return;
+
trans_pcie->scd_base_addr =
iwl_read_prph(trans, SCD_SRAM_BASE_ADDR);
 
@@ -970,11 +973,13 @@ int iwl_pcie_tx_init(struct iwl_trans *trans)
}
}
 
-   if (trans->cfg->use_tfh)
+   if (trans->cfg->use_tfh) {
iwl_write_direct32(trans, TFH_TRANSFER_MODE,
   TFH_TRANSFER_MAX_PENDING_REQ |
   TFH_CHUNK_SIZE_128 |
   TFH_CHUNK_SPLIT_MODE);
+   return 0;
+   }
 
iwl_set_bits_prph(trans, SCD_GP_CTRL, SCD_GP_CTRL_AUTO_ACTIVE_MODE);
if (trans->cfg->base_params->num_of_queues > 20)
@@ -1249,6 +1254,9 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, 
int txq_id, u16 ssn,
if (test_and_set_bit(txq_id, trans_pcie->queue_used))
WARN_ONCE(1, "queue %d already used - expect issues", txq_id);
 
+   if (cfg && trans->cfg->use_tfh)
+   WARN_ONCE(1, "Expected no calls to SCD configuration");
+
txq->wd_timeout = msecs_to_jiffies(wdg_timeout);
 
if (cfg) {
@@ -1366,6 +1374,9 @@ void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, 
int txq_id,
return;
}
 
+   if (configure_scd && trans->cfg->use_tfh)
+   WARN_ONCE(1, "Expected no calls to SCD configuration");
+
if (configure_scd) {
iwl_scd_txq_set_inactive(trans, txq_id);
 
-- 
2.8.1



[PATCH 09/16] iwlwifi: rename and reorder 9000 series configuration structs

2016-08-30 Thread Luca Coelho
From: Oren Givon 

Rename and reorder the 9000 series configuration structs:
- struct containing configuration of 5165 was renamed to 9000.

Signed-off-by: Oren Givon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-9000.c   | 63 +
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |  4 +-
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   | 34 +++--
 3 files changed, 50 insertions(+), 51 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c 
b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
index fbaf705..b8356a8 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
@@ -72,15 +72,15 @@
 #define IWL9000_SMEM_OFFSET0x40
 #define IWL9000_SMEM_LEN   0x68000
 
-#define  IWL9000_FW_PRE "iwlwifi-9000-pu-a0-lc-a0-"
+#define  IWL9000_FW_PRE "iwlwifi-9000-pu-a0-jf-a0-"
 #define  IWL9260_FW_PRE "iwlwifi-9260-th-a0-jf-a0-"
-#define  IWL9260LC_FW_PRE "iwlwifi-9260-th-a0-lc-a0-"
+#define  IWL9000LC_FW_PRE "iwlwifi-9000-pu-a0-lc-a0-"
 #define IWL9000_MODULE_FIRMWARE(api) \
IWL9000_FW_PRE "-" __stringify(api) ".ucode"
 #define IWL9260_MODULE_FIRMWARE(api) \
IWL9260_FW_PRE "-" __stringify(api) ".ucode"
-#define IWL9260LC_MODULE_FIRMWARE(api) \
-   IWL9260LC_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL9000LC_MODULE_FIRMWARE(api) \
+   IWL9000LC_FW_PRE "-" __stringify(api) ".ucode"
 
 #define NVM_HW_SECTION_NUM_FAMILY_9000 10
 
@@ -147,40 +147,41 @@ static const struct iwl_tt_params iwl9000_tt_params = {
.rf_id = true
 
 const struct iwl_cfg iwl9260_2ac_cfg = {
-   .name = "Intel(R) Dual Band Wireless AC 9260",
-   .fw_name_pre = IWL9260_FW_PRE,
-   IWL_DEVICE_9000,
-   .ht_params = _ht_params,
-   .nvm_ver = IWL9000_NVM_VERSION,
-   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
-   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+   .name = "Intel(R) Dual Band Wireless AC 9260",
+   .fw_name_pre = IWL9260_FW_PRE,
+   IWL_DEVICE_9000,
+   .ht_params = _ht_params,
+   .nvm_ver = IWL9000_NVM_VERSION,
+   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
+   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+};
+
+const struct iwl_cfg iwl9000_2ac_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 9000",
+   .fw_name_pre = IWL9000_FW_PRE,
+   IWL_DEVICE_9000,
+   .ht_params = _ht_params,
+   .nvm_ver = IWL9000_NVM_VERSION,
+   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
+   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+   .integrated = true,
 };
 
 /*
  * TODO the struct below is for internal testing only this should be
  * removed by EO 2016~
  */
-const struct iwl_cfg iwl9260lc_2ac_cfg = {
-   .name = "Intel(R) Dual Band Wireless AC 9260",
-   .fw_name_pre = IWL9260LC_FW_PRE,
-   IWL_DEVICE_9000,
-   .ht_params = _ht_params,
-   .nvm_ver = IWL9000_NVM_VERSION,
-   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
-   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
-};
-
-const struct iwl_cfg iwl5165_2ac_cfg = {
-   .name = "Intel(R) Dual Band Wireless AC 5165",
-   .fw_name_pre = IWL9000_FW_PRE,
-   IWL_DEVICE_9000,
-   .ht_params = _ht_params,
-   .nvm_ver = IWL9000_NVM_VERSION,
-   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
-   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
-   .integrated = true,
+const struct iwl_cfg iwl9000lc_2ac_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 9000",
+   .fw_name_pre = IWL9000LC_FW_PRE,
+   IWL_DEVICE_9000,
+   .ht_params = _ht_params,
+   .nvm_ver = IWL9000_NVM_VERSION,
+   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
+   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+   .integrated = true,
 };
 
 MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
-MODULE_FIRMWARE(IWL9260LC_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL9000LC_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 423b233..04260fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -449,9 +449,9 @@ extern const struct iwl_cfg iwl4165_2ac_cfg;
 extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl8265_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl4165_2ac_sdio_cfg;
+extern const struct iwl_cfg iwl9000_2ac_cfg;
+extern const struct iwl_cfg iwl9000lc_2ac_cfg;
 extern const struct iwl_cfg 

[PATCH 11/16] iwlwifi: add new 9460 series PCI IDs

2016-08-30 Thread Luca Coelho
From: Oren Givon 

Add 4 more new 9460 series PCI IDs.

Signed-off-by: Oren Givon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index d053183..3e5a11a 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -517,6 +517,10 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0x9DF0, 0x0710, iwl9460_2ac_cfg)},
{IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl9460_2ac_cfg)},
{IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x2526, 0x0060, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0060, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0xA370, 0x0060, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg)},
 
 /* a000 Series */
{IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg)},
-- 
2.8.1



[PATCH 10/16] iwlwifi: add a new series 9460 with new PCI ID

2016-08-30 Thread Luca Coelho
From: Oren Givon 

Add a new series to the 9000 series called 9460.
In addition, add a new PCI ID that is the 9460 new series.

Signed-off-by: Oren Givon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-9000.c   |  4 ++--
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |  2 +-
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   | 27 +
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c 
b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
index b8356a8..5621cf2 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
@@ -156,8 +156,8 @@ const struct iwl_cfg iwl9260_2ac_cfg = {
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
 };
 
-const struct iwl_cfg iwl9000_2ac_cfg = {
-   .name = "Intel(R) Dual Band Wireless AC 9000",
+const struct iwl_cfg iwl9460_2ac_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 9460",
.fw_name_pre = IWL9000_FW_PRE,
IWL_DEVICE_9000,
.ht_params = _ht_params,
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 04260fc..a18b57f 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -449,9 +449,9 @@ extern const struct iwl_cfg iwl4165_2ac_cfg;
 extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl8265_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl4165_2ac_sdio_cfg;
-extern const struct iwl_cfg iwl9000_2ac_cfg;
 extern const struct iwl_cfg iwl9000lc_2ac_cfg;
 extern const struct iwl_cfg iwl9260_2ac_cfg;
+extern const struct iwl_cfg iwl9460_2ac_cfg;
 extern const struct iwl_cfg iwla000_2ac_cfg;
 #endif /* CONFIG_IWLMVM */
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index bf523f5..d053183 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -504,18 +504,19 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 /* 9000 Series */
{IWL_PCI_DEVICE(0x2526, 0x, iwl9260_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0410, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0610, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0310, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0510, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x2010, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x2526, 0x1420, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x0710, iwl9000_2ac_cfg)},
-   {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl9000_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0410, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0610, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0310, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0510, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x2010, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x2526, 0x1420, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x0710, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl9460_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg)},
 
 /* a000 Series */
{IWL_PCI_DEVICE(0x2720, 0x0A10, iwla000_2ac_cfg)},
@@ -636,7 +637,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
}
 
if (iwl_trans->cfg->rf_id) {
-   if (cfg == _2ac_cfg &&
+   if (cfg == _2ac_cfg &&
iwl_trans->hw_rf_id == CSR_HW_RF_ID_TYPE_LC) {
cfg = _2ac_cfg;
iwl_trans->cfg = cfg;
-- 
2.8.1



[PATCH 02/16] iwlwifi: mvm: support GMAC protocol

2016-08-30 Thread Luca Coelho
From: Ayala Beker 

Add support for installing and removing GMAC key
for newer FW versions that support GCM and MFP.
GMAC provides authentication and integrity for multicast management
frames.

Firmware API was changed, update the driver accordingly.

Signed-off-by: Ayala Beker 
Signed-off-by: Luca Coelho 
---
 .../net/wireless/intel/iwlwifi/mvm/fw-api-sta.h| 31 
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c  | 18 --
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h   |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   | 42 ++
 4 files changed, 76 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-sta.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-sta.h
index d1c4fb8..6c8e3ca 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-sta.h
@@ -433,25 +433,42 @@ struct iwl_mvm_rm_sta_cmd {
 } __packed; /* REMOVE_STA_CMD_API_S_VER_2 */
 
 /**
+ * struct iwl_mvm_mgmt_mcast_key_cmd_v1
+ * ( MGMT_MCAST_KEY = 0x1f )
+ * @ctrl_flags: %iwl_sta_key_flag
+ * @igtk:
+ * @k1: unused
+ * @k2: unused
+ * @sta_id: station ID that support IGTK
+ * @key_id:
+ * @receive_seq_cnt: initial RSC/PN needed for replay check
+ */
+struct iwl_mvm_mgmt_mcast_key_cmd_v1 {
+   __le32 ctrl_flags;
+   u8 igtk[16];
+   u8 k1[16];
+   u8 k2[16];
+   __le32 key_id;
+   __le32 sta_id;
+   __le64 receive_seq_cnt;
+} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
+
+/**
  * struct iwl_mvm_mgmt_mcast_key_cmd
  * ( MGMT_MCAST_KEY = 0x1f )
  * @ctrl_flags: %iwl_sta_key_flag
- * @IGTK:
- * @K1: unused
- * @K2: unused
+ * @igtk: IGTK master key
  * @sta_id: station ID that support IGTK
  * @key_id:
  * @receive_seq_cnt: initial RSC/PN needed for replay check
  */
 struct iwl_mvm_mgmt_mcast_key_cmd {
__le32 ctrl_flags;
-   u8 IGTK[16];
-   u8 K1[16];
-   u8 K2[16];
+   u8 igtk[32];
__le32 key_id;
__le32 sta_id;
__le64 receive_seq_cnt;
-} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_1 */
+} __packed; /* SEC_MGMT_MULTICAST_KEY_CMD_API_S_VER_2 */
 
 struct iwl_mvm_wep_key {
u8 key_index;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 6d60645..f5290c4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -465,7 +465,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES;
hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP;
 
-   BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 4);
+   BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6);
memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers));
hw->wiphy->n_cipher_suites = ARRAY_SIZE(mvm_ciphers);
hw->wiphy->cipher_suites = mvm->ciphers;
@@ -490,6 +490,14 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
mvm->ciphers[hw->wiphy->n_cipher_suites] =
WLAN_CIPHER_SUITE_AES_CMAC;
hw->wiphy->n_cipher_suites++;
+   if (iwl_mvm_has_new_rx_api(mvm)) {
+   mvm->ciphers[hw->wiphy->n_cipher_suites] =
+   WLAN_CIPHER_SUITE_BIP_GMAC_128;
+   hw->wiphy->n_cipher_suites++;
+   mvm->ciphers[hw->wiphy->n_cipher_suites] =
+   WLAN_CIPHER_SUITE_BIP_GMAC_256;
+   hw->wiphy->n_cipher_suites++;
+   }
}
 
/* currently FW API supports only one optional cipher scheme */
@@ -2746,6 +2754,8 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE;
break;
case WLAN_CIPHER_SUITE_AES_CMAC:
+   case WLAN_CIPHER_SUITE_BIP_GMAC_128:
+   case WLAN_CIPHER_SUITE_BIP_GMAC_256:
WARN_ON_ONCE(!ieee80211_hw_check(hw, MFP_CAPABLE));
break;
case WLAN_CIPHER_SUITE_WEP40:
@@ -2779,9 +2789,11 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
 * GTK on AP interface is a TX-only key, return 0;
 * on IBSS they're per-station and because we're lazy
 * we don't support them for RX, so do the same.
-* CMAC in AP/IBSS modes must be done in software.
+* CMAC/GMAC in AP/IBSS modes must be done in software.
 */
-   if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC)
+   if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
+   key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
+   key->cipher == 

[PATCH 01/16] iwlwifi: mvm: allow same PN for de-aggregated AMSDU

2016-08-30 Thread Luca Coelho
From: Sara Sharon 

The 9000 hardware will de-aggregate AMSDUs. In the process
it will copy the mac header "as is" to the new MPDUs.
This means driver should allow the same PN for MPDUs originated
from the same AMSDU.
Do that by incrementing the PN only for the last MPDU in the
sequence.

Signed-off-by: Sara Sharon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index df6c32c..08d8a8a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -132,7 +132,8 @@ static inline int iwl_mvm_check_pn(struct iwl_mvm *mvm, 
struct sk_buff *skb,
   IEEE80211_CCMP_PN_LEN) <= 0)
return -1;
 
-   memcpy(ptk_pn->q[queue].pn[tid], pn, IEEE80211_CCMP_PN_LEN);
+   if (!(stats->flag & RX_FLAG_AMSDU_MORE))
+   memcpy(ptk_pn->q[queue].pn[tid], pn, IEEE80211_CCMP_PN_LEN);
stats->flag |= RX_FLAG_PN_VALIDATED;
 
return 0;
@@ -883,6 +884,9 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct 
napi_struct *napi,
u8 *qc = ieee80211_get_qos_ctl(hdr);
 
*qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT;
+   if (!(desc->amsdu_info &
+ IWL_RX_MPDU_AMSDU_LAST_SUBFRAME))
+   rx_status->flag |= RX_FLAG_AMSDU_MORE;
}
if (baid != IWL_RX_REORDER_DATA_INVALID_BAID)
iwl_mvm_agg_rx_received(mvm, baid);
-- 
2.8.1



[PATCH 07/16] iwlwifi: mvm: use defines for SCD_CONFIG_CMD enablement

2016-08-30 Thread Luca Coelho
From: Liad Kaufman 

Due to the addition of another option in the SCD_CONFIG_CMD's
%enable field, change the assignment of this field to use
defines rather than hard-code the value itself.

Signed-off-by: Liad Kaufman 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h | 12 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   |  4 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 13 +++--
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
index 4144623..6b4c63a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
@@ -675,13 +675,21 @@ static inline u32 iwl_mvm_get_scd_ssn(struct 
iwl_mvm_tx_resp *tx_resp)
tx_resp->frame_count) & 0xfff;
 }
 
+/* Available options for the SCD_QUEUE_CFG HCMD */
+enum iwl_scd_cfg_actions {
+   SCD_CFG_DISABLE_QUEUE   = 0x0,
+   SCD_CFG_ENABLE_QUEUE= 0x1,
+   SCD_CFG_UPDATE_QUEUE_TID= 0x2,
+};
+
 /**
  * struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command
  * @token:
  * @sta_id: station id
  * @tid:
  * @scd_queue: scheduler queue to confiug
- * @enable: 1 queue enable, 0 queue disable
+ * @action: 1 queue enable, 0 queue disable, 2 change txq's tid owner
+ * Value is one of %iwl_scd_cfg_actions options
  * @aggregate: 1 aggregated queue, 0 otherwise
  * @tx_fifo: %enum iwl_mvm_tx_fifo
  * @window: BA window size
@@ -692,7 +700,7 @@ struct iwl_scd_txq_cfg_cmd {
u8 sta_id;
u8 tid;
u8 scd_queue;
-   u8 enable;
+   u8 action;
u8 aggregate;
u8 tx_fifo;
u8 window;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 1ddcbea..e87473a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -536,7 +536,7 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int 
queue, int tid,
 {
struct iwl_scd_txq_cfg_cmd cmd = {
.scd_queue = queue,
-   .enable = 0,
+   .action = SCD_CFG_DISABLE_QUEUE,
};
bool shared_queue;
unsigned long mq;
@@ -745,7 +745,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
if (using_inactive_queue) {
struct iwl_scd_txq_cfg_cmd cmd = {
.scd_queue = queue,
-   .enable = 0,
+   .action = SCD_CFG_DISABLE_QUEUE,
};
u8 ac;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 423efab..7c138fe 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -610,7 +610,7 @@ int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, 
int fifo, int sta_id,
 {
struct iwl_scd_txq_cfg_cmd cmd = {
.scd_queue = queue,
-   .enable = 1,
+   .action = SCD_CFG_ENABLE_QUEUE,
.window = frame_limit,
.sta_id = sta_id,
.ssn = cpu_to_le16(ssn),
@@ -684,7 +684,7 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int 
mac80211_queue,
if (enable_queue) {
struct iwl_scd_txq_cfg_cmd cmd = {
.scd_queue = queue,
-   .enable = 1,
+   .action = SCD_CFG_ENABLE_QUEUE,
.window = cfg->frame_limit,
.sta_id = cfg->sta_id,
.ssn = cpu_to_le16(ssn),
@@ -711,7 +711,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, 
int mac80211_queue,
 {
struct iwl_scd_txq_cfg_cmd cmd = {
.scd_queue = queue,
-   .enable = 0,
+   .action = SCD_CFG_DISABLE_QUEUE,
};
bool remove_mac_queue = true;
int ret;
@@ -746,8 +746,9 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, 
int mac80211_queue,
~BIT(mac80211_queue);
mvm->queue_info[queue].hw_queue_refcount--;
 
-   cmd.enable = mvm->queue_info[queue].hw_queue_refcount ? 1 : 0;
-   if (!cmd.enable)
+   cmd.action = mvm->queue_info[queue].hw_queue_refcount ?
+   SCD_CFG_ENABLE_QUEUE : SCD_CFG_DISABLE_QUEUE;
+   if (cmd.action == SCD_CFG_DISABLE_QUEUE)
mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE;
 
IWL_DEBUG_TX_QUEUES(mvm,
@@ -757,7 +758,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, 
int mac80211_queue,
mvm->queue_info[queue].hw_queue_to_mac80211);
 
/* If the queue is still enabled - nothing left to do in this 

[PATCH 12/16] iwlwifi: add the new 9270 series

2016-08-30 Thread Luca Coelho
From: Oren Givon 

Add a new config struct for the new 9270 series and add
the first PCI ID for it.

Signed-off-by: Oren Givon 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/iwl-9000.c   | 10 ++
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |  1 +
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   |  1 +
 3 files changed, 12 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c 
b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
index 5621cf2..e442650 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-9000.c
@@ -156,6 +156,16 @@ const struct iwl_cfg iwl9260_2ac_cfg = {
.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
 };
 
+const struct iwl_cfg iwl9270_2ac_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 9270",
+   .fw_name_pre = IWL9260_FW_PRE,
+   IWL_DEVICE_9000,
+   .ht_params = _ht_params,
+   .nvm_ver = IWL9000_NVM_VERSION,
+   .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
+   .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
+};
+
 const struct iwl_cfg iwl9460_2ac_cfg = {
.name = "Intel(R) Dual Band Wireless AC 9460",
.fw_name_pre = IWL9000_FW_PRE,
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h 
b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index a18b57f..0ab415c 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -451,6 +451,7 @@ extern const struct iwl_cfg iwl8265_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl4165_2ac_sdio_cfg;
 extern const struct iwl_cfg iwl9000lc_2ac_cfg;
 extern const struct iwl_cfg iwl9260_2ac_cfg;
+extern const struct iwl_cfg iwl9270_2ac_cfg;
 extern const struct iwl_cfg iwl9460_2ac_cfg;
 extern const struct iwl_cfg iwla000_2ac_cfg;
 #endif /* CONFIG_IWLMVM */
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c 
b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 3e5a11a..1be0ac2 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -504,6 +504,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 /* 9000 Series */
{IWL_PCI_DEVICE(0x2526, 0x, iwl9260_2ac_cfg)},
{IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_cfg)},
+   {IWL_PCI_DEVICE(0x2526, 0x1410, iwl9270_2ac_cfg)},
{IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9460_2ac_cfg)},
{IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg)},
{IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9460_2ac_cfg)},
-- 
2.8.1



[PATCH 05/16] iwlwifi: mvm: keep track of tid associated with each queue

2016-08-30 Thread Luca Coelho
From: Liad Kaufman 

When sending the SCD_QUEUE_CONFIG command, the queue is
associated to a specific TID. If later there is a need to
use this TID on a different queue instead, it first needs to
be unassociated from the first queue.

Keep track for every queue what TID is associated with it.

Signed-off-by: Liad Kaufman 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h   | 1 +
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   | 7 +++
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index ee5a9ad..1806495 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -772,6 +772,7 @@ struct iwl_mvm {
u8 ra_sta_id; /* The RA this queue is mapped to, if exists */
bool reserved; /* Is this the TXQ reserved for a STA */
u8 mac80211_ac; /* The mac80211 AC this queue is mapped to */
+   u8 txq_tid; /* The TID "owner" of this queue*/
u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */
/* Timestamp for inactivation per TID of this queue */
unsigned long last_frame_time[IWL_MAX_TID_COUNT + 1];
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 1f235e8..730ba78 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -562,6 +562,7 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int 
queue, int tid,
 
cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[mvm->queue_info[queue].mac80211_ac];
+   cmd.tid = mvm->queue_info[queue].txq_tid;
mq = mvm->queue_info[queue].hw_queue_to_mac80211;
shared_queue = (mvm->queue_info[queue].hw_queue_refcount > 1);
spin_unlock_bh(>queue_info_lock);
@@ -591,6 +592,11 @@ int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int 
queue, int tid,
 cmd.sta_id, tid, LINK_QUAL_AGG_FRAME_LIMIT_DEF,
 ssn, wdg_timeout);
 
+   /* Update the TID "owner" of the queue */
+   spin_lock_bh(>queue_info_lock);
+   mvm->queue_info[queue].txq_tid = tid;
+   spin_unlock_bh(>queue_info_lock);
+
/* TODO: Work-around SCD bug when moving back by multiples of 0x40 */
 
/* Redirect to lower AC */
@@ -749,6 +755,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
ac = mvm->queue_info[queue].mac80211_ac;
cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[ac];
+   cmd.tid = mvm->queue_info[queue].txq_tid;
spin_unlock_bh(>queue_info_lock);
 
/* Disable the queue */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index dae64a6..423efab 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -669,6 +669,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int 
mac80211_queue,
tid_to_mac80211_ac[cfg->tid];
else
mvm->queue_info[queue].mac80211_ac = IEEE80211_AC_VO;
+
+   mvm->queue_info[queue].txq_tid = cfg->tid;
}
 
IWL_DEBUG_TX_QUEUES(mvm,
@@ -761,6 +763,7 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, 
int mac80211_queue,
}
 
cmd.sta_id = mvm->queue_info[queue].ra_sta_id;
+   cmd.tid = mvm->queue_info[queue].txq_tid;
 
/* Make sure queue info is correct even though we overwrite it */
WARN(mvm->queue_info[queue].hw_queue_refcount ||
-- 
2.8.1



[PATCH 04/16] iwlwifi: mvm: re-aggregate shared queue after unsharing

2016-08-30 Thread Luca Coelho
From: Liad Kaufman 

When a shared queue becomes unshared, aggregations should be
re-enabled if they've existed before. Make sure that they do
this, if required.

Signed-off-by: Liad Kaufman 
Signed-off-by: Luca Coelho 
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h   |  17 +++
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c   | 166 +
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h   |   4 +
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c|  38 +-
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c |   8 +-
 5 files changed, 205 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h 
b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 28ebc12..ee5a9ad 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -697,6 +697,10 @@ struct iwl_mvm_baid_data {
  * it. In this state, when a new queue is needed to be allocated but no
  * such free queue exists, an inactive queue might be freed and given to
  * the new RA/TID.
+ * @IWL_MVM_QUEUE_RECONFIGURING: queue is being reconfigured
+ * This is the state of a queue that has had traffic pass through it, but
+ * needs to be reconfigured for some reason, e.g. the queue needs to
+ * become unshared and aggregations re-enabled on.
  */
 enum iwl_mvm_queue_status {
IWL_MVM_QUEUE_FREE,
@@ -704,6 +708,7 @@ enum iwl_mvm_queue_status {
IWL_MVM_QUEUE_READY,
IWL_MVM_QUEUE_SHARED,
IWL_MVM_QUEUE_INACTIVE,
+   IWL_MVM_QUEUE_RECONFIGURING,
 };
 
 #define IWL_MVM_DQA_QUEUE_TIMEOUT  (5 * HZ)
@@ -1122,6 +1127,18 @@ static inline bool iwl_mvm_enter_d0i3_on_suspend(struct 
iwl_mvm *mvm)
(mvm->trans->runtime_pm_mode != IWL_PLAT_PM_MODE_D0I3);
 }
 
+static inline bool iwl_mvm_is_dqa_data_queue(struct iwl_mvm *mvm, u8 queue)
+{
+   return (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE) &&
+  (queue <= IWL_MVM_DQA_MAX_DATA_QUEUE);
+}
+
+static inline bool iwl_mvm_is_dqa_mgmt_queue(struct iwl_mvm *mvm, u8 queue)
+{
+   return (queue >= IWL_MVM_DQA_MIN_MGMT_QUEUE) &&
+  (queue <= IWL_MVM_DQA_MAX_MGMT_QUEUE);
+}
+
 static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm)
 {
bool nvm_lar = mvm->nvm_data->lar_enabled;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 5960eb4..1f235e8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -468,6 +468,11 @@ static int iwl_mvm_get_shared_queue(struct iwl_mvm *mvm,
i != IWL_MVM_DQA_BSS_CLIENT_QUEUE)
continue;
 
+   /* Don't try and take queues being reconfigured */
+   if (mvm->queue_info[queue].status ==
+   IWL_MVM_QUEUE_RECONFIGURING)
+   continue;
+
ac_to_queue[mvm->queue_info[i].mac80211_ac] = i;
}
 
@@ -501,27 +506,33 @@ static int iwl_mvm_get_shared_queue(struct iwl_mvm *mvm,
queue = ac_to_queue[IEEE80211_AC_VO];
 
/* Make sure queue found (or not) is legal */
-   if (!((queue >= IWL_MVM_DQA_MIN_MGMT_QUEUE &&
-  queue <= IWL_MVM_DQA_MAX_MGMT_QUEUE) ||
- (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE &&
-  queue <= IWL_MVM_DQA_MAX_DATA_QUEUE) ||
- (queue == IWL_MVM_DQA_BSS_CLIENT_QUEUE))) {
+   if (!iwl_mvm_is_dqa_data_queue(mvm, queue) &&
+   !iwl_mvm_is_dqa_mgmt_queue(mvm, queue) &&
+   (queue != IWL_MVM_DQA_BSS_CLIENT_QUEUE)) {
IWL_ERR(mvm, "No DATA queues available to share\n");
-   queue = -ENOSPC;
+   return -ENOSPC;
+   }
+
+   /* Make sure the queue isn't in the middle of being reconfigured */
+   if (mvm->queue_info[queue].status == IWL_MVM_QUEUE_RECONFIGURING) {
+   IWL_ERR(mvm,
+   "TXQ %d is in the middle of re-config - try again\n",
+   queue);
+   return -EBUSY;
}
 
return queue;
 }
 
 /*
- * If a given queue has a higher AC than the TID stream that is being added to
- * it, the queue needs to be redirected to the lower AC. This function does 
that
+ * If a given queue has a higher AC than the TID stream that is being compared
+ * to, the queue needs to be redirected to the lower AC. This function does 
that
  * in such a case, otherwise - if no redirection required - it does nothing,
  * unless the %force param is true.
  */
-static int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid,
- int ac, int ssn, unsigned int wdg_timeout,
- bool force)
+int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid,
+  int ac, int ssn, unsigned int 

pull-request: iwlwifi-next 2016-08-30-2

2016-08-30 Thread Luca Coelho
Hi Kalle,

This is a v2 of my pull request with the potential below array bounds
access, reported by kbuild bot, fixed.

> Another pull request, this time intended for 4.9.  I have a lot of
> patches to send, but I'll send smaller batches this time. :)
> 
> These patches contain mostly preparation for new HW, but also some
> improvements in the dynamic queue allocation code and the
> implementation to support GMAC.

Let me know if everything's fine (or not). :)

Luca.


The following changes since commit 60747ef4d173c2747bf7f0377fb22846cb422195:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2016-08-18 
01:17:32 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git 
tags/iwlwifi-next-for-kalle-2016-08-30-2

for you to fetch changes up to 76f8c0e17edc6eba43f84952e5a87c7f50f69370:

  iwlwifi: pcie: remove dead code (2016-08-30 14:16:43 +0300)


* Preparation for new HW continues;
* Some DQA improvements;
* Support for GMAC;


Ayala Beker (1):
  iwlwifi: mvm: support GMAC protocol

Liad Kaufman (5):
  iwlwifi: mvm: re-aggregate shared queue after unsharing
  iwlwifi: mvm: keep track of tid associated with each queue
  iwlwifi: mvm: re-assign old queues after hw restart in dqa mode
  iwlwifi: mvm: use defines for SCD_CONFIG_CMD enablement
  iwlwifi: mvm: support txq tid owner change

Oren Givon (5):
  iwlwifi: rename and reorder 9000 series configuration structs
  iwlwifi: add a new series 9460 with new PCI ID
  iwlwifi: add new 9460 series PCI IDs
  iwlwifi: add the new 9270 series
  iwlwifi: add the new 9170 series

Sara Sharon (5):
  iwlwifi: mvm: allow same PN for de-aggregated AMSDU
  iwlwifi: mvm: support new paging command format
  iwlwifi: pcie: refrain from SCD accesses
  iwlwifi: pcie: fix ucode load flow for a000 devices
  iwlwifi: pcie: remove dead code

 drivers/net/wireless/intel/iwlwifi/iwl-9000.c   |  83 +++---
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |   6 +-
 drivers/net/wireless/intel/iwlwifi/iwl-fh.h |  15 ++--
 drivers/net/wireless/intel/iwlwifi/iwl-prph.h   |  19 ++---
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api-sta.h |  31 +--
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h  |  12 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h |   8 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c |  28 +--
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c   |  18 +++-
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h|  26 +-
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c   |   6 +-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c| 342 
+++
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h|   4 +
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c |  38 -
 drivers/net/wireless/intel/iwlwifi/mvm/utils.c  |  24 --
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   |  41 +
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c |  45 ++
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c|  13 ++-
 18 files changed, 603 insertions(+), 156 deletions(-)

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


Re: pull-request: iwlwifi-next 2016-08-30

2016-08-30 Thread Kalle Valo
Luca Coelho  writes:

> On Tue, 2016-08-30 at 00:23 +0300, Luca Coelho wrote:
>> Hi Kalle,
>> 
>> Another pull request, this time intended for 4.9.  I have a lot of
>> patches to send, but I'll send smaller batches this time. :)
>> 
>> These patches contain mostly preparation for new HW, but also some
>> improvements in the dynamic queue allocation code and the
>> implementation to support GMAC.
>> 
>> Let me know if everything's fine (or not). :)
>
> Kalle,
>
> The kbuild bot warning is valid.  I'll fix it and send a v2 of this
> pull request, so please hold it back for now.

Ok, I dropped this pull request. Please submit new one when it's ready.

-- 
Kalle Valo


Re: pull-request: iwlwifi-next 2016-08-30

2016-08-30 Thread Luca Coelho
On Tue, 2016-08-30 at 00:23 +0300, Luca Coelho wrote:
> Hi Kalle,
> 
> Another pull request, this time intended for 4.9.  I have a lot of
> patches to send, but I'll send smaller batches this time. :)
> 
> These patches contain mostly preparation for new HW, but also some
> improvements in the dynamic queue allocation code and the
> implementation to support GMAC.
> 
> Let me know if everything's fine (or not). :)

Kalle,

The kbuild bot warning is valid.  I'll fix it and send a v2 of this
pull request, so please hold it back for now.

--
Cheers,
Luca.


Re: [PATCH 5/5] ath9k: Make EEPROM endianness swapping configurable via devicetree

2016-08-30 Thread Arnd Bergmann
On Tuesday 30 August 2016, Martin Blumenstingl wrote:
> new logic (assuming that we went for __le16/__le32 fields):
> - reading data: use le16_to_cpu and le32_to_cpu for all fields
> 
> LE system:
> - LE EEPROM -> no swap will be applied
> - BE EEPROM -> be16_to_cpu / be32_to_cpu (or swab16 / swab32 as before)
> BE system:
> - LE EEPROM -> le16_to_cpu / le32_to_cpu (or swab16 / swab32 as before)
> - BE EEPROM -> no swap will be applied

I think this should be:

LE and BE systems:
 - LE EEPROM -> no swap will be applied
 - BE EEPROM -> or swab16 / swab32

The upside of this is that we no longer care about what the CPU is,
and in my opinion that makes the code easier to understand.

> There is one downside of the "new approach" I can think of: you need
> to swap the data twice in some cases (BE EEPROM on a BE machine).
> - first swap while writing the data to __le16/__le32 fields
> - second swap while reading the data from the __le16/__le32 fields
> If you forget to swap a field in either place then things will be broken.

Correct. Fortunately, "make C=1" with sparse helps you find those bugs
at compile time.

> Maybe someone else wants to state his/her opinion on this - I guess
> some fresh thoughts could help us a lot!

Yes, that would be helpful. It's possible I'm missing something here,
or that changing this will just add confusion with other people.

Arnd


Re: [PATCH] ath6kl: Allow the radio to report 0 dbm txpower without timing out

2016-08-30 Thread Valo, Kalle
Eric Bentley  writes:

> The ath6kl driver attempts to get the txpower value from the radio by first
> clearing the existing stored value and then watching the value to become
> non-zero.
>
> APs allow setting client power to values from -127..127, but this radio
> is not capable of setting values less then 0 and so will report txpower
> as 0dbm for both negative and 0 client power values.
>
> When the radio has txpower set to 0dbm txpower (equivalent to 1mw) the
> ath6kl_cfg80211_get_txpower() function will remain in the
> wait_event_interruptible_timeout() loop waiting for the value to be
> non-zero, and will eventually timeout. This results in a 5 second delay in
> response. However, the correct value of zero is eventually returned.
>
> The 6004 defaults to 63dbm which is then limited by regulatory and
> hardware limits with max of 18dbm (6003 max is 16dbm), therefore we can
> use values larger then these to be able to determine when the value has
> been updated.
>
> To correct the issue, set the value to a nonsensical value (255) and wait
> for it to change to the valid value.
>
> --
> Tested on both 6003 and 6004 based radios.  Return value of zero is
> correctly returned in an expected amount of time (similar to when
> returning non-zero values) when AP client power is set to both 0 and
> negative values.
>
> Signed-off-by: Eric Bentley 

This is perfect now, thanks. I'll just remove the "--" line from the
commit log, that looks a bit weird.

-- 
Kalle Valo

pull-request: mac80211 2016-08-30

2016-08-30 Thread Johannes Berg
Hi Dave,

Nothing much, but we have three little fixes, see below. I've included the
static inline so that BATMAN_ADV_BATMAN_V can be changed to be allowed w/o
cfg80211 sooner, and it's a trivial change.

Let me know if there's any problem.

Thanks,
johannes



The following changes since commit 2439ca0402091badb24415e1b073ba12b34ba423:

  mac80211: Add ieee80211_hw pointer to get_expected_throughput (2016-08-05 
14:23:25 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git 
tags/mac80211-for-davem-2016-08-30

for you to fetch changes up to 61aaa0e8c1c15d9e045f0577f046be50f2f571ab:

  cfg80211: Add stub for cfg80211_get_station() (2016-08-30 08:05:28 +0200)


Three little fixes:
 * revert a recent wext patch, which Ben Hutchings noticed was
   wrong, and it turns out not to be necessary for any driver

 * fix an infinite loop that can occur under certain conditions
   in mac80211's TDLS code (depending on regulatory information)

 * add a cfg80211_get_station() static inline when cfg80211 isn't
   built, to allow other modules to not have to depend on it for it


Arik Nemtsov (1):
  mac80211: TDLS: don't require beaconing for AP BW

Johannes Berg (1):
  Revert "wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel"

Linus Lüssing (1):
  cfg80211: Add stub for cfg80211_get_station()

 include/net/cfg80211.h   |  9 +
 net/mac80211/tdls.c  |  7 ---
 net/wireless/wext-core.c | 25 ++---
 3 files changed, 15 insertions(+), 26 deletions(-)


[PATCH] ath6kl: Allow the radio to report 0 dbm txpower without timing out

2016-08-30 Thread Eric Bentley
The ath6kl driver attempts to get the txpower value from the radio by first
clearing the existing stored value and then watching the value to become
non-zero.

APs allow setting client power to values from -127..127, but this radio
is not capable of setting values less then 0 and so will report txpower
as 0dbm for both negative and 0 client power values.

When the radio has txpower set to 0dbm txpower (equivalent to 1mw) the
ath6kl_cfg80211_get_txpower() function will remain in the
wait_event_interruptible_timeout() loop waiting for the value to be
non-zero, and will eventually timeout. This results in a 5 second delay in
response. However, the correct value of zero is eventually returned.

The 6004 defaults to 63dbm which is then limited by regulatory and
hardware limits with max of 18dbm (6003 max is 16dbm), therefore we can
use values larger then these to be able to determine when the value has
been updated.

To correct the issue, set the value to a nonsensical value (255) and wait
for it to change to the valid value.

--
Tested on both 6003 and 6004 based radios.  Return value of zero is
correctly returned in an expected amount of time (similar to when
returning non-zero values) when AP client power is set to both 0 and
negative values.

Signed-off-by: Eric Bentley 
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 72e2ec6..b7fe0af 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1449,14 +1449,14 @@ static int ath6kl_cfg80211_get_txpower(struct wiphy 
*wiphy,
return -EIO;
 
if (test_bit(CONNECTED, >flags)) {
-   ar->tx_pwr = 0;
+   ar->tx_pwr = 255;
 
if (ath6kl_wmi_get_tx_pwr_cmd(ar->wmi, vif->fw_vif_idx) != 0) {
ath6kl_err("ath6kl_wmi_get_tx_pwr_cmd failed\n");
return -EIO;
}
 
-   wait_event_interruptible_timeout(ar->event_wq, ar->tx_pwr != 0,
+   wait_event_interruptible_timeout(ar->event_wq, ar->tx_pwr != 
255,
 5 * HZ);
 
if (signal_pending(current)) {
-- 
2.6.0.GIT



Re: [PATCH 04/16] iwlwifi: mvm: re-aggregate shared queue after unsharing

2016-08-30 Thread kbuild test robot
Hi Liad,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Luca-Coelho/iwlwifi-mvm-allow-same-PN-for-de-aggregated-AMSDU/20160830-130755
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git 
master
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.

All warnings (new ones prefixed by >>):

   drivers/net/wireless/intel/iwlwifi/mvm/sta.c: In function 
'iwl_mvm_sta_alloc_queue':
>> drivers/net/wireless/intel/iwlwifi/mvm/sta.c:517:21: warning: array 
>> subscript is below array bounds [-Warray-bounds]
 if (mvm->queue_info[queue].status == IWL_MVM_QUEUE_RECONFIGURING) {
^

vim +517 drivers/net/wireless/intel/iwlwifi/mvm/sta.c

   501  /* Priority 4a: No BE nor BK - use VI if exists */
   502  else if (ac_to_queue[IEEE80211_AC_VI] != 
IEEE80211_INVAL_HW_QUEUE)
   503  queue = ac_to_queue[IEEE80211_AC_VI];
   504  /* Priority 4b: No BE, BK nor VI - use VO if exists */
   505  else if (ac_to_queue[IEEE80211_AC_VO] != 
IEEE80211_INVAL_HW_QUEUE)
   506  queue = ac_to_queue[IEEE80211_AC_VO];
   507  
   508  /* Make sure queue found (or not) is legal */
   509  if (!iwl_mvm_is_dqa_data_queue(mvm, queue) &&
   510  !iwl_mvm_is_dqa_mgmt_queue(mvm, queue) &&
   511  (queue != IWL_MVM_DQA_BSS_CLIENT_QUEUE)) {
   512  IWL_ERR(mvm, "No DATA queues available to share\n");
   513  queue = -ENOSPC;
   514  }
   515  
   516  /* Make sure the queue isn't in the middle of being 
reconfigured */
 > 517  if (mvm->queue_info[queue].status == 
 > IWL_MVM_QUEUE_RECONFIGURING) {
   518  IWL_ERR(mvm,
   519  "TXQ %d is in the middle of re-config - try 
again\n",
   520  queue);
   521  queue = -1;
   522  }
   523  
   524  return queue;
   525  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH] cfg80211: Add stub for cfg80211_get_station()

2016-08-30 Thread Johannes Berg
On Fri, 2016-08-19 at 22:02 +0200, Linus Lüssing wrote:
> This allows modules using this function (currently: batman-adv) to
> compile even if cfg80211 is not built at all, thus relaxing
> dependencies.
> 
Err, excuse the earlier empty email - editing mixup.

I've applied this and will send it to 4.8 so you can take advantage of
it sooner (to adjust the Kconfig dependencies, presumably).

johannes


Re: [PATCH] cfg80211: Add stub for cfg80211_get_station()

2016-08-30 Thread Johannes Berg
On Fri, 2016-08-19 at 22:02 +0200, Linus Lüssing wrote:
> This allows modules using this function (currently: batman-adv) to
> compile even if cfg80211 is not built at all, thus relaxing
> dependencies.


johannes


[PATCH] mac80211: TDLS: don't require beaconing for AP BW

2016-08-30 Thread Johannes Berg
From: Arik Nemtsov 

Stop downgrading TDLS chandef when reaching the AP BW. The AP provides
the necessary regulatory protection in this case.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=153961

Reported-by: Kamil Toman 
Signed-off-by: Arik Nemtsov 
Signed-off-by: Johannes Berg 
---
 net/mac80211/tdls.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index b5d28f14b9cf..afca7d103684 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -333,10 +333,11 @@ ieee80211_tdls_chandef_vht_upgrade(struct 
ieee80211_sub_if_data *sdata,
if (!uc.center_freq1)
return;
 
-   /* proceed to downgrade the chandef until usable or the same */
+   /* proceed to downgrade the chandef until usable or the same as AP BW */
while (uc.width > max_width ||
-  !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, ,
- sdata->wdev.iftype))
+  (uc.width > sta->tdls_chandef.width &&
+   !cfg80211_reg_can_beacon_relax(sdata->local->hw.wiphy, ,
+  sdata->wdev.iftype)))
ieee80211_chandef_downgrade();
 
if (!cfg80211_chandef_identical(, >tdls_chandef)) {
-- 
2.8.1