linux-block.git
5 years agoiwlwifi: Fix pre operational dumping flows
Shahar S Matityahu [Mon, 12 Nov 2018 11:27:51 +0000 (13:27 +0200)]
iwlwifi: Fix pre operational dumping flows

There are several dumping flows in the driver in case of a fail
prior to operational.

In some cases we get 2 dumps while in others we get none.

Fix this by uniting the different flows.
Add a different dump type to driver triggered dumps in case we want
a dump but did not got assert, and make all dumping go through
iwl_fw_dbg_collect_desc to avoid multiple dumps.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove duplicated include from ops.c
YueHaibing [Fri, 30 Nov 2018 11:24:26 +0000 (19:24 +0800)]
iwlwifi: mvm: remove duplicated include from ops.c

Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: support new format for the beacon notification
Emmanuel Grumbach [Mon, 26 Nov 2018 11:24:55 +0000 (13:24 +0200)]
iwlwifi: mvm: support new format for the beacon notification

The firmware is changing the format of the beacon
notification to remove the dependency on the Tx response
format.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: update max region id num to support 64 regions
Shahar S Matityahu [Tue, 27 Nov 2018 05:42:33 +0000 (07:42 +0200)]
iwlwifi: dbg_ini: update max region id num to  support 64 regions

The driver should support 64 region ids.  Update
IWL_FW_INI_MAX_REGION_ID accordingly.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: update ini triggers enum
Shahar S Matityahu [Thu, 29 Nov 2018 15:53:09 +0000 (17:53 +0200)]
iwlwifi: dbg_ini: update ini triggers enum

Align the triggers enum in the driver to the one in the FW.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: differentiate between alive timeout and alive flow failure
Shahar S Matityahu [Thu, 22 Nov 2018 07:12:08 +0000 (09:12 +0200)]
iwlwifi: differentiate between alive timeout and alive flow failure

There are two cases that can cause the alive flow to fail,
an assert or a timeout.
Currently we mask any incoming asserts when we wait for alive.

Solve this by differentiating between the two cases:
1. Let the regular error handling to handle a received assert
2. Do a dump collection in the case of a timeout

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: f38efdb29389 ("iwlwifi: add dump collection in case alive flow fails")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD command
Sara Sharon [Thu, 25 Oct 2018 11:12:05 +0000 (14:12 +0300)]
iwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD command

When we do channel switch, we used to schedule time events
ourselves. This was offloaded to FW. Support the new command
and flow.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: simplify some return conditions
Sara Sharon [Fri, 16 Nov 2018 09:18:26 +0000 (11:18 +0200)]
iwlwifi: mvm: simplify some return conditions

Simplify some return conditions found by running a semantic patch
to detect unnecessary assignments to local variables.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: fix bad dma handling in page_mem dumping flow
Shahar S Matityahu [Tue, 20 Nov 2018 07:46:33 +0000 (09:46 +0200)]
iwlwifi: fix bad dma handling in page_mem dumping flow

Prior to gen2 we allocate the paging memory via alloc_pages
which requires passing ownership on the memory between the
cpu and the device using dma_sync_single_for_cpu and
dma_sync_single_for_device.

Add missing dma_sync_single_for_device in iwl_dump_paging
after copying the memory.

since gen2, we allocate the paging memory using dma_alloc_coherent
which does not need passing ownership between the cpu and device.

Remove unneeded call to dma_sync_single_for_cpu in
iwl_trans_pcie_dump_data prior to copying the memory.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 5538409ba393 ("iwlwifi: pcie: support page dumping in wrt in gen2")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: give better naming to region struct fields
Shahar S Matityahu [Mon, 26 Nov 2018 08:15:35 +0000 (10:15 +0200)]
iwlwifi: dbg_ini: give better naming to region struct fields

Some of the region struct fields have misleading naming
change those fields to have an informative naming

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: fix iwl_fw_ini_buffer_location field enum bad naming
Shahar S Matityahu [Mon, 26 Nov 2018 08:25:44 +0000 (10:25 +0200)]
iwlwifi: dbg_ini: fix iwl_fw_ini_buffer_location field enum bad naming

change IWL_FW_INI_LOCATION_SRAM_INVALID into IWL_FW_INI_LOCATION_INVALID

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi dbg_ini: update ini structs doc
Shahar S Matityahu [Mon, 26 Nov 2018 08:23:11 +0000 (10:23 +0200)]
iwlwifi dbg_ini: update ini structs doc

update ini struct documentation to the structs being used in the FW

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: bump FW API to 44 for 9000 and 22000 series
Luca Coelho [Thu, 6 Sep 2018 14:56:58 +0000 (17:56 +0300)]
iwlwifi: bump FW API to 44 for 9000 and 22000 series

Start supporting API version 44 where applicable.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agowireless: prefix header search paths with $(srctree)/
Masahiro Yamada [Fri, 25 Jan 2019 15:18:00 +0000 (00:18 +0900)]
wireless: prefix header search paths with $(srctree)/

Currently, the Kbuild core manipulates header search paths in a crazy
way [1].

To fix this mess, I want all Makefiles to add explicit $(srctree)/ to
the search paths in the srctree. Some Makefiles are already written in
that way, but not all. The goal of this work is to make the notation
consistent, and finally get rid of the gross hacks.

Having whitespaces after -I does not matter since commit 48f6e3cf5bc6
("kbuild: do not drop -I without parameter").

I also removed one header search path in:

  drivers/net/wireless/broadcom/brcm80211/brcmutil/Makefile

I was able to compile without it.

[1]: https://patchwork.kernel.org/patch/9632347/

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomt7601u: do not use WARN_ON in the datapath
Lorenzo Bianconi [Tue, 22 Jan 2019 15:39:34 +0000 (16:39 +0100)]
mt7601u: do not use WARN_ON in the datapath

Substitute WARN_ON with WARN_ON_ONCE in mt7601u_rx_next_seg_len
routine

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomwifiex: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:37 +0000 (16:21 +0100)]
mwifiex: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Amitkumar Karwar <amitkarwar@gmail.com>
Cc: Nishant Sarmukadam <nishants@marvell.com>
Cc: Ganapathi Bhat <gbhat@marvell.com>
Cc: Xinming Hu <huxinming820@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:36 +0000 (16:21 +0100)]
libertas: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: libertas-dev@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2x00: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:34 +0000 (16:21 +0100)]
rt2x00: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agorsi: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:32 +0000 (16:21 +0100)]
rsi: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmsmac: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:31 +0000 (16:21 +0100)]
brcmsmac: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Franky Lin <franky.lin@broadcom.com>
Cc: Hante Meuleman <hante.meuleman@broadcom.com>
Cc: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Cc: Wright Feng <wright.feng@cypress.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list.pdl@broadcom.com
Cc: brcm80211-dev-list@cypress.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Arend van Spriel
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agob43legacy: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:30 +0000 (16:21 +0100)]
b43legacy: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Cc: b43-dev@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agob43: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:29 +0000 (16:21 +0100)]
b43: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Cc: b43-dev@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agocw1200: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:28 +0000 (16:21 +0100)]
cw1200: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Solomon Peachy <pizza@shaftnet.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:35 +0000 (16:21 +0100)]
qtnfmac: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Igor Mitsyanko <imitsyanko@quantenna.com>
Cc: Avinash Patil <avinashp@quantenna.com>
Cc: Sergey Matyukevich <smatyukevich@quantenna.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:33 +0000 (16:21 +0100)]
rtlwifi: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowl18xx: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:27 +0000 (16:21 +0100)]
wl18xx: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowl12xx: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:26 +0000 (16:21 +0100)]
wl12xx: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowl1251: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:25 +0000 (16:21 +0100)]
wl1251: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowlcore: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:24 +0000 (16:21 +0100)]
wlcore: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoiwlegacy: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:18 +0000 (16:21 +0100)]
iwlegacy: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomt7601u: bump supported EEPROM version
Stanislaw Gruszka [Tue, 22 Jan 2019 12:47:54 +0000 (13:47 +0100)]
mt7601u: bump supported EEPROM version

As reported by Michael eeprom 0d is supported and work with the driver.

Dump of /sys/kernel/debug/ieee80211/phy1/mt7601u/eeprom_param
with 0d EEPORM looks like this:

RSSI offset: 0 0
Reference temp: f9
LNA gain: 8
Reg channels: 1-14
Per rate power:
 raw:05 bw20:05 bw40:05
 raw:05 bw20:05 bw40:05
 raw:03 bw20:03 bw40:03
 raw:03 bw20:03 bw40:03
 raw:04 bw20:04 bw40:04
 raw:00 bw20:00 bw40:00
 raw:00 bw20:00 bw40:00
 raw:00 bw20:00 bw40:00
 raw:02 bw20:02 bw40:02
 raw:00 bw20:00 bw40:00
Per channel power:
 tx_power  ch1:09 ch2:09
 tx_power  ch3:0a ch4:0a
 tx_power  ch5:0a ch6:0a
 tx_power  ch7:0b ch8:0b
 tx_power  ch9:0b ch10:0b
 tx_power  ch11:0b ch12:0b
 tx_power  ch13:0b ch14:0b

Reported-and-tested-by: Michael <ZeroBeat@gmx.de>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowlcore: clean up an indentation issue
Colin Ian King [Fri, 18 Jan 2019 23:12:31 +0000 (23:12 +0000)]
wlcore: clean up an indentation issue

There is a goto statement that is missing a tab for indentation. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agorsi: Suppress sdhci warnings in mmc
Siva Rebbagondla [Fri, 18 Jan 2019 09:18:07 +0000 (14:48 +0530)]
rsi: Suppress sdhci warnings in mmc

while inserting and removing sdio module multiple times, we are getting
sdhci warnings. This is because, improper assignment of ocr_avail value.
Fixed this by assigning proper value.

This patch is enhancement for commit 78e450719c702 ("rsi: Fix 'invalid
vdd' warning in mmc").

Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agowireless: remove unneeded semicolon
YueHaibing [Fri, 18 Jan 2019 03:32:15 +0000 (11:32 +0800)]
wireless: remove unneeded semicolon

remove unneeded semicolon

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Acked-by: Steve deRosier <derosier@cal-sierra.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl818x: fix indentation issue
Colin Ian King [Thu, 17 Jan 2019 15:28:59 +0000 (15:28 +0000)]
rtlwifi: rtl818x: fix indentation issue

There is a statement that is indented too deeply. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agocw1200: fix indentation issues
Colin Ian King [Thu, 17 Jan 2019 14:36:23 +0000 (14:36 +0000)]
cw1200: fix indentation issues

There are two lines that have indentation issues, fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas: fix indentation issue
Colin Ian King [Wed, 16 Jan 2019 17:25:33 +0000 (17:25 +0000)]
libertas: fix indentation issue

There is a statement that is incorrectly indented, fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2x00: Work around a firmware bug with shared keys
Bernd Edlinger [Tue, 15 Jan 2019 14:01:29 +0000 (14:01 +0000)]
rt2x00: Work around a firmware bug with shared keys

Apparently the rt2x61 firmware fails temporarily to decode
broadcast packets if the shared keys are not assigned
in the "correct" sequence. At the same time unicast
packets work fine, since they are encrypted with the
pairwise key.

At least with WPA2 CCMP mode the shared keys are
set in the following sequence: keyidx=1, 2, 1, 2.
After a while only keyidx 2 gets decrypted, and
keyidx 1 is ignored, probably because there is never
a keyidx 3.

Symptoms are arping -b works for 10 minutes, since
keyidx=2 is used for broadcast, and then it stops
working for 10 minutes, because keyidx=1 is used.
That failure mode repeats forever.

Note, the firmware does not even know which keyidx
corresponds to which hw_key_idx so the firmware is
trying to be smarter than the driver, which is bound
to fail.

As workaround the function rt61pci_config_shared_key
requests software decryption of the shared keys,
by returning EOPNOTSUPP. However, pairwise keys are
still handled by hardware which works just fine.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: qtnf_cmd_send_with_reply cleanup
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:51 +0000 (09:39 +0000)]
qtnfmac: qtnf_cmd_send_with_reply cleanup

Use existing variable with dereferenced cmd_id field.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: remove unused declarations
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:49 +0000 (09:39 +0000)]
qtnfmac: remove unused declarations

Remove declarations for inexistent functions from bus.h header.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: add missing bss record to host scan cache
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:47 +0000 (09:39 +0000)]
qtnfmac: add missing bss record to host scan cache

Make sure that valid BSS entry exists in wireless core record
even in the case of successful connect reported by firmware.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: convert to SPDX license identifiers
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:45 +0000 (09:39 +0000)]
qtnfmac: convert to SPDX license identifiers

Replace textual license with SPDX-License-Identifier.
Add an SPDX-License-Identifier for the Makefile.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: do not reject retry changes in driver
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:42 +0000 (09:39 +0000)]
qtnfmac: do not reject retry changes in driver

Do not reject RETRY changes in driver. This decision
should belong to firmware.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: switch to 32bit values for RTS/FRAG thresholds
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:40 +0000 (09:39 +0000)]
qtnfmac: switch to 32bit values for RTS/FRAG thresholds

Host wireless stack uses u32 type for RTS/FRAG threshold values.
Switch to u32 in driver: pass u32 values to firmware and let
firmware properly adapt these values according to its
internal representation.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: add support for 4addr mode
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:38 +0000 (09:39 +0000)]
qtnfmac: add support for 4addr mode

Advertise WIPHY_FLAG_4ADDR_STATION capability to wireless core. Send
use4addr interface change flag to firmware in change_virtual_intf
cfg80211 callback.

In order to enable adding wireless station interface to bridge
one should turn on 4addr mode using the following command:
$ iw dev wlan0 set 4addr on
$ brctl addif br0 wlan0

If this commands succeeds, then interface can be added to bridge.
Note that when wireless interface is added to bridge, wpa_supplicant
should be started with appropriate -b <brname> parameter, e.g:
$ wpa_supplicant -Dnl80211 -iwlan0 -c/path/to/wpa.conf -b br0

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: fix INTx interrupt handling
Sergey Matyukevich [Mon, 14 Jan 2019 09:39:36 +0000 (09:39 +0000)]
qtnfmac: fix INTx interrupt handling

In the current implementation INTx interrupt is deasserted after the
control path processing. However this may lead to missed interrupts
from the wireless card. For instance, this may happen as a result
of control path activity, when another interrupt arrives before
INTx is deasserted.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: support EBUSY errcode for QLINK protocol
Andrey Shevchenko [Mon, 14 Jan 2019 09:39:35 +0000 (09:39 +0000)]
qtnfmac: support EBUSY errcode for QLINK protocol

Add support of EBUSY error code for remote procedures over QLINK protocol.

Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomwifiex: add support for sd8977 chipset
Hemantkumar Suthar [Thu, 10 Jan 2019 08:45:54 +0000 (08:45 +0000)]
mwifiex: add support for sd8977 chipset

This patch adds support for 8977 chipset to mwifiex with SDIO
interface. Register offsets and supported feature flags are
updated. Firmware image used will be mrvl/sd8977_uapsta.bin.

Signed-off-by: Hemantkumar Suthar <shemant@marvell.com>
Signed-off-by: Rakesh Parmar <rakeshp@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: Don't clear num_rx_inperiod too early
Bernd Edlinger [Tue, 8 Jan 2019 22:50:09 +0000 (22:50 +0000)]
rtlwifi: Don't clear num_rx_inperiod too early

This patch moves the clearing of rtlpriv->link_info.num_rx_inperiod in
rtl_watchdog_wq_callback a few lines down.

This is necessary since it is still used in the "AP off" detection
code block. Moved clearing of rtlpriv->link_info.num_rx_inperiod
as well for consistency.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortl8723ae: Re-introduce the adaptive rate control
Bernd Edlinger [Tue, 8 Jan 2019 22:49:52 +0000 (22:49 +0000)]
rtl8723ae: Re-introduce the adaptive rate control

This re-introduces the function rtl8723e_dm_refresh_rate_adaptive_mask.

This function was present in a previous version of the code base,
it works just fine for me -- as long as it is not using stale data.

Unlike the original version of this function it avoids using
dm.undec_sm_pwdb when no beacon was received.

Fixed a style nit in rtl8723e_dm_init_rate_adaptive_mask.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortl8723ae: Dont use old data for input gain control
Bernd Edlinger [Tue, 8 Jan 2019 22:49:40 +0000 (22:49 +0000)]
rtl8723ae: Dont use old data for input gain control

When no beacon was received, the value in dm.undec_sm_pwdb is most
likely out of date and should not be used to adjust the input path.
Assume instead that the signal level is low.

Fix the state machine in rtl8723e_dm_cck_packet_detection_thresh
which did not clear pre_cck_fa_state when changing cur_cck_pd_state
from CCK_PD_STAGE_LOWRSSI/CCK_FA_STAGE_LOW to CCK_PD_STAGE_HIGHRSSI
and back again to CCK_PD_STAGE_LOWRSSI/CCK_FA_STAGE_LOW, the register
RCCK0_CCA not written to 0x83 on the second change.

Explicitly initialize pre_cck_fa_state/cur_cck_fa_state in
rtl_dm_diginit.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortl8723ae: Take the FW LPS mode handling out
Bernd Edlinger [Tue, 8 Jan 2019 22:49:23 +0000 (22:49 +0000)]
rtl8723ae: Take the FW LPS mode handling out

This appears to trigger a firmware bug and causes severe
problems with rtl8723ae PCI devices.

When the power save mode is activated for longer periods
of time the firmware stops to receive any packets.

This problem was exposed by commit 873ffe154ae0 ("rtlwifi:
Fix logic error in enter/exit power-save mode").

Previously the power save mode was only active rarely and
only for a short time so that the problem was not noticeable.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas: add checks for the return value of sysfs_create_group
Kangjie Lu [Tue, 8 Jan 2019 17:42:21 +0000 (11:42 -0600)]
libertas: add checks for the return value of sysfs_create_group

sysfs_create_group() could fail. The fix checkes its return values
and issue error messages if it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoqtnfmac: use struct_size() in kzalloc()
Gustavo A. R. Silva [Tue, 8 Jan 2019 17:26:32 +0000 (11:26 -0600)]
qtnfmac: use struct_size() in kzalloc()

One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2x00: reduce tx power to nominal level on RT6352
Tomislav Požega [Thu, 27 Dec 2018 14:05:25 +0000 (15:05 +0100)]
rt2x00: reduce tx power to nominal level on RT6352

Current implementation of RT6352 support provides too high tx power
at least on iPA/eLNA devices. Reduce amplification of variable gain
amplifier by 6dB to match board target power of 17dBm.
Transmited signal strength with this patch is similar to that of
stock firmware or pandorabox firmware. Throughput measured with iperf
improves. Device tested: Xiaomi Miwifi Mini.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoiwlwifi: mvm: fix merge damage in iwl_mvm_rx_mpdu_mq()
Luca Coelho [Wed, 30 Jan 2019 12:38:11 +0000 (14:38 +0200)]
iwlwifi: mvm: fix merge damage in iwl_mvm_rx_mpdu_mq()

A call to iwl_mvm_add_rtap_sniffer_config() was missing due to a merge
damage when I submitted the patch mentioned below.  And this causes
the following compilation warning:

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:195:13: warning: 'iwl_mvm_add_rtap_sniffer_config' defined but not used [-Wunused-function]
 static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix it by adding the if block that calls this function.

Fixes: 9bf13bee2d74 ("iwlwifi: mvm: include configured sniffer AID in radiotap")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoMerge tag 'iwlwifi-next-for-kalle-2019-01-29' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 30 Jan 2019 11:07:49 +0000 (13:07 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2019-01-29' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

Second batch of iwlwifi patches intended for v5.1

* A bunch of fixes for issues found with static analyzers;
* Relicense the pcie submodule to dual GPL/BSD;
* Reworked the TOF/CSI implementation;
* Work on new debugging infra continues;
* Some product name updates in the human-readable strings
* Some more cleanups for the device configuration refactoring;
* General bugfixes;
* Other cleanups and small fixes;

5 years agoMerge tag 'mt76-for-kvalo-2019-01-22' of https://github.com/nbd168/wireless
Kalle Valo [Wed, 30 Jan 2019 11:03:38 +0000 (13:03 +0200)]
Merge tag 'mt76-for-kvalo-2019-01-22' of https://github.com/nbd168/wireless

first batch of mt76 patches for 5.1

* fixes for mt76x0/mt76x2
* energy detect regulatory compliance fixes
* tx status handling fixes
* preparation for MT7603 support
* channel switch announcement support

5 years agoiwiwifi: fix bad monitor buffer register addresses
Shahar S Matityahu [Mon, 26 Nov 2018 09:33:09 +0000 (11:33 +0200)]
iwiwifi: fix bad monitor buffer register addresses

The monitor buffer register address is wrong.
Set the right address

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: c2d202017da1 ("iwlwifi: pcie: add firmware monitor capabilities")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: set dump mask BIT(n) instead of n
Shahar S Matityahu [Mon, 26 Nov 2018 08:29:15 +0000 (10:29 +0200)]
iwlwifi: dbg_ini: set dump mask BIT(n) instead of n

The driver sets dump_mask value instead of BIT(value).
fix it by updating dump_mask correctly.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: retrieve dump_delay value properly
Shahar S Matityahu [Mon, 26 Nov 2018 08:34:37 +0000 (10:34 +0200)]
iwlwifi: dbg_ini: retrieve dump_delay value properly

The driver uses ignore_consec instead of dump_delay.
Fix it by using dump_delay as expected.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: fe1b7d6c2888 ("iwlwifi: add support for triggering ini triggers")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: properly handle ini user trigger
Shahar S Matityahu [Mon, 26 Nov 2018 09:02:54 +0000 (11:02 +0200)]
iwlwifi: dbg_ini: properly handle ini user trigger

in case of a user trigger while ini is enable we change
FW_DBG_TRIGGER_USER to IWL_FW_TRIGGER_ID_USER_TRIGGER in
iwl_fw_dbg_collect and then again we attempt to do so in
_iwl_fw_error_ini_dump which causes to abort the dump.

Fix it by removing the second check in _iwl_fw_error_ini_dump.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: allocate dram buffer with proper flags
Shahar S Matityahu [Mon, 26 Nov 2018 09:19:00 +0000 (11:19 +0200)]
iwlwifi: dbg_ini: allocate dram buffer with proper flags

Use the same flags we use in the legacy buffer allocation.
Missing __GFP_NOWARN will cause an unwanted warning incase
we fail to allocate.
Missing __GFP_ZERO will give a buffer initially filled with
garbage which can make debug difficult in case our wrap count is zero.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: d47902f9f71d ("iwlwifi: dbg: add apply point logic")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: update firmware when MU EDCA params change
Shaul Triebitz [Wed, 7 Nov 2018 16:51:06 +0000 (18:51 +0200)]
iwlwifi: mvm: update firmware when MU EDCA params change

When MU EDCA params change, resend the STA_HE_CTXT command
updating the MU EDCA params.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: trigger dump on assert prior to setting the device up
Shahar S Matityahu [Thu, 22 Nov 2018 06:01:30 +0000 (08:01 +0200)]
iwlwifi: trigger dump on assert prior to setting the device up

In the regular flow, when we receive an assert, ieee80211_reconfig is
called which reconfig the driver using iwl_mvm_mac_start.
iwl_mvm_mac_start is clearing the restart bit and does dump collection.

Prior to setting the device up, ieee80211_reconfig does not call
iwl_mvm_mac_start since there is nothing to reconfig and we miss the
dump collection of the assert.

solve it by checking the restart bit before we stop the device
and trigger a dump collection in case it is set.

note that we don't need to do it in the fmac case since in fmac
assert flow in iwl_fmac_nic_error we call iwl_fw_dbg_collect_desc
so we can be sure that there will a dump collection in
iwl_fmac_stop_device.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: include configured sniffer AID in radiotap
Johannes Berg [Tue, 20 Nov 2018 16:58:46 +0000 (17:58 +0100)]
iwlwifi: mvm: include configured sniffer AID in radiotap

In order to make more sense out of the captured radiotap data e.g.
when the configured AID changes, add the currently configured AID
to the radiotap data as a vendor extension field.

This is made race-free by updating the included value from inside
the RX path (using a notification wait) for the command response
from the firmware, which thus means it's serialized with frame RX.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: document monitor mode reorder buffer bypass
Johannes Berg [Tue, 20 Nov 2018 16:14:06 +0000 (17:14 +0100)]
iwlwifi: mvm: document monitor mode reorder buffer bypass

The reorder buffer is bypassed because the firmware won't have
any BA sessions, document this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: update product name for 9260 and 9560
Ihab Zhaika [Tue, 20 Nov 2018 07:33:57 +0000 (09:33 +0200)]
iwlwifi: update product name for 9260 and 9560

update the product name for the some of the cards from
the series of 9260 and 9560

Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: disable completely low latency mode with debugfs
Mordechay Goodstein [Tue, 13 Nov 2018 16:36:42 +0000 (18:36 +0200)]
iwlwifi: mvm: disable completely low latency mode with debugfs

We introduce a new state for latency, force mode, in force mode
you can enable always to be in low latency or always to be in non
low latency.

This is required for test mode in max TpT test.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: freeze management TXQ timer when station goes to sleep
Emmanuel Grumbach [Mon, 19 Nov 2018 07:32:39 +0000 (09:32 +0200)]
iwlwifi: mvm: freeze management TXQ timer when station goes to sleep

We maintain a timer for each Tx queue to detect stalls and
be able to recover / debug.
When we work in AP mode, we can freeze the Tx queue timer if
a station goes to sleep, because we don't want to warn about
stalls that are caused by faulty clients that don't wake up
on time.
This mechanism was applied to the queues of the clients, but
the management queue was omitted. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Change FW channel info API
David Spinadel [Sun, 18 Nov 2018 16:01:43 +0000 (18:01 +0200)]
iwlwifi: mvm: Change FW channel info API

Change iwl_fw_channel_info structure so it can have channel number
greater than 255. This is needed for 6 GHz channel numbers.
Change all relevant structs and member accesses accordingly.
The new API is indicated by a TLV capability bit.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: implement CSI reporting
Johannes Berg [Thu, 25 Oct 2018 07:15:21 +0000 (09:15 +0200)]
iwlwifi: mvm: implement CSI reporting

Implement CSI (channel estimation matrix) reporting in the mvm
driver, if the firmware has the capability.

Currently only a debugfs API is provided as the API is still
under discussion.

For now, RX aggregation must be disabled to use this feature
on data frames as we haven't found a good way to attach the
data to A-MPDUs, given complexities with multi-queue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: add location APIs
Johannes Berg [Wed, 31 Oct 2018 09:29:31 +0000 (10:29 +0100)]
iwlwifi: mvm: add location APIs

Add the location/time-of-flight/FTM APIs that we'll use in
follow-up patches to implement FTM responder and initiator.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Disconnect on large beacon loss
Andrei Otcheretianski [Sun, 4 Nov 2018 19:56:31 +0000 (21:56 +0200)]
iwlwifi: mvm: Disconnect on large beacon loss

Some buggy APs stop sending beacons, but continue to ack our null data
packets or even run some traffic. It's better not to stick connected to
such an AP forever, so disconnect after some larger beacon loss
threshold is crossed.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: use u32* argument to iwl_trans_get_fw_monitor_len()
Johannes Berg [Fri, 9 Nov 2018 09:58:53 +0000 (10:58 +0100)]
iwlwifi: pcie: use u32* argument to iwl_trans_get_fw_monitor_len()

That's what we pass, and we don't want/need any negative values.
Found by sparse/smatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dvm: remove useless condition
Johannes Berg [Fri, 9 Nov 2018 10:03:29 +0000 (11:03 +0100)]
iwlwifi: dvm: remove useless condition

If we're in the else branch of checking "tt->state == IWL_TI_CT_KILL"
so there's no point in checking "tt->state != IWL_TI_CT_KILL" again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove TOF implementation
Johannes Berg [Tue, 30 Oct 2018 13:47:52 +0000 (14:47 +0100)]
iwlwifi: remove TOF implementation

This is an ancient (~2015) implementation that no longer matches
the firmware in any way, and most likely never worked. Remove all
of it so it can be reintroduced properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: get rid of tx_path_lock
Sara Sharon [Thu, 25 Oct 2018 17:11:51 +0000 (20:11 +0300)]
iwlwifi: mvm: get rid of tx_path_lock

TX path lock was introduced in order to prevent out of order
invocations of TX.

This can happen in the following flow:

TX path invoked from net dev
Packet dequeued
TX path invoked from RX path
Packet dequeued
Packet TXed
Packet TXed

However, we don't really need a lock. If TX path is already
invoked from some location, other paths can simply abort their
execution, instead of waiting to the first path to finish, and
then discover queue is (likely) empty or stopped.

Replace the lock with an atomic variable to track TX ownership.
This simplifies the locking dependencies between RX and TX paths,
and should improve performance.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: fix A-MPDU reference assignment
Johannes Berg [Thu, 8 Nov 2018 08:51:56 +0000 (09:51 +0100)]
iwlwifi: mvm: fix A-MPDU reference assignment

The current code assigns the reference, and then goes to increment
it if the toggle bit has changed. That way, we get

Toggle  0  0  0  0  1  1  1  1
ID      1  1  1  1  1  2  2  2

Fix that by assigning the post-toggle ID to get

Toggle  0  0  0  0  1  1  1  1
ID      1  1  1  1  2  2  2  2

Reported-by: Danny Alexander <danny.alexander@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: fbe4112791b8 ("iwlwifi: mvm: update mpdu metadata API")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: add an option to dereference vif by id
Sara Sharon [Mon, 29 Oct 2018 09:23:45 +0000 (11:23 +0200)]
iwlwifi: mvm: add an option to dereference vif by id

Currently whenever we get firmware notification with mac id,
we iterate over all the interfaces to find the ID. This is a
bit cumbersome. Instead, adding an array of RCU pointers, like
we have for station IDs. This is not expensive space wise
since we have only up to 4 active MACs, and not complicated
code wise, since we have a clear point to init and de-init it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: monitor dumping flow cleanup
Shahar S Matityahu [Wed, 31 Oct 2018 11:29:21 +0000 (13:29 +0200)]
iwlwifi: monitor dumping flow cleanup

Since we use a dumping mask, checking if only monitor was requested
is redundant. Remove the unneeded code.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove sta key on wep ap
Liad Kaufman [Thu, 1 Nov 2018 14:30:15 +0000 (16:30 +0200)]
iwlwifi: mvm: remove sta key on wep ap

If WEP is used, no one removes the STA key upon STA
removal, leading to a situation where after 16
connect/disconnects - the AP could no longer decrypt
incoming data frames since iwl_mvm_set_fw_key_idx()
called from iwl_mvm_set_sta_key() during association
returns STA_KEY_IDX_INVALID, thus not setting the key
for that connecting STA.

Fix this by removing the key in the driver when the
STA is removed.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: make sure cur_fw_img is valid before accessing img
Luca Coelho [Tue, 6 Nov 2018 06:24:12 +0000 (08:24 +0200)]
iwlwifi: make sure cur_fw_img is valid before accessing img

Harden the fwrt->fw->img array access by making sure the cur_fw_img
value doesn't go out of bounds.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr
Luca Coelho [Mon, 5 Nov 2018 13:45:54 +0000 (15:45 +0200)]
iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr

The out_cmd structure starts with a header, so there's no need to use
&out_cmd->hdr, out_cmd alone is enough.  We use this when calculating
other addresses and klocwork gets confused with that because it thinks
we are trying to access hdr (as an array) beyond its size.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: pre-initialize alive_data in wait_alive()
Luca Coelho [Mon, 5 Nov 2018 09:07:58 +0000 (11:07 +0200)]
iwlwifi: mvm: pre-initialize alive_data in wait_alive()

The function we pass to the wait alive notification procedure may may
not even get called if the timeout occurs before the function is
called.  To prevent accessing unitialized data in alive_data, pre-set
it to zero in the declaration.  Found by static analyzers.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h
Johannes Berg [Wed, 31 Oct 2018 07:48:49 +0000 (08:48 +0100)]
iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h

These inlines just check the module parameters, so they don't
need a configuration parameter and can move to a better place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: make iwl_fw_dbg_start_stop_hcmd() inline
Luca Coelho [Wed, 31 Oct 2018 08:21:10 +0000 (10:21 +0200)]
iwlwifi: make iwl_fw_dbg_start_stop_hcmd() inline

This function is supposed to be used as an inline function and is in a
header file, so make it inline.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: save and export regdb blob from the NVM
Luca Coelho [Mon, 13 Aug 2018 12:30:35 +0000 (15:30 +0300)]
iwlwifi: mvm: save and export regdb blob from the NVM

Sometimes we want to debug issues related to the regulatory blob in
the NVM.  To make that easier, add a debugfs entry to export it
together with the other nvm blobs we export.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: clean up LDBG config command usage
Johannes Berg [Mon, 29 Oct 2018 12:50:05 +0000 (13:50 +0100)]
iwlwifi: mvm: clean up LDBG config command usage

Clean up the LDBG config command to not be called "continuous
recording", and while at it actually remove the continuous
recording implementation completely since it was only used for
store & forward architectures.

This also fixes a bug at least in iwl_fw_dbg_buffer_allocation()
because what's now "__le32 type" (matching the firmware) used to
be "__le16 enable_recording", so the buffer allocation config
sub-struct would erroneously have started at the wrong offset.
In the other cases this didn't actually lead to a bug as other
bytes in pad[] were all zeroes, so accessing the 16-bit value as
a 32-bit value wouldn't make a difference (in little endian.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: align licensing to dual GPL/BSD
Johannes Berg [Wed, 24 Oct 2018 07:04:36 +0000 (09:04 +0200)]
iwlwifi: pcie: align licensing to dual GPL/BSD

These files have a long history of code changes, but analysing
the remaining code leads to having only a few changes that are
not already owned by Intel, notably from
 - Andy Lutomirski <luto@amacapital.net>
 - Joonwoo Park <joonwpark81@gmail.com>
 - Kirtika Ruchandani <kirtika@chromium.org>
 - Rajat Jain <rajatja@google.com>
 - Stanislaw Gruszka <sgruszka@redhat.com>
remaining in the code today.

Note that
 - I myself was working for Intel and for any possibly code
   that might be before my employment there give permission
 - Wizery employees were working for Intel

More specifically, we identified the following commits that
(partially may) remain today:

25c03d8e8c13 Joonwoo Park <joonwpark81@gmail.com>      ("iwlwifi: do not schedule tasklet when rcv unused irq")
f36d04abe684 Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: use dma_alloc_coherent")
387f3381f732 Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: fix dma mappings and skbs leak")
2624e96ce16b Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: fix possible data overwrite in hcmd callback")
bfe4b80e9f73 Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: always check if got h/w access before write")
d536c32b45d2 Andy Lutomirski <luto@amacapital.net>     ("iwlwifi: pcie: log when waking the NIC for hcmd submission fails")
a6d24fad00d9 Rajat Jain <rajatja@google.com>           ("iwlwifi: pcie: dump registers when HW becomes inaccessible")
fb12777ab59b Kirtika Ruchandani <kirtika@chromium.org> ("iwlwifi: Add more call-sites for pcie reg dumper")
3a73a30049f2 Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: cleanup/fix memory barriers")
aa5affbacb24 Stanislaw Gruszka <sgruszka@redhat.com>   ("iwlwifi: dump stack when fail to gain access to the device")

Align the licenses with their permission to clean up and to
make it all identical.

CC: Joonwoo Park <joonwpark81@gmail.com>
CC: Stanislaw Gruszka <sgruszka@redhat.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Rajat Jain <rajatja@google.com>
CC: Kirtika Ruchandani <kirtika@chromium.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Kirtika Ruchandani <kirtika@chromium.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Joonwoo Park <joonwpark81@gmail.com>
Acked-by: Rajat Jain <rajatja@google.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCK
Johannes Berg [Mon, 29 Oct 2018 08:44:03 +0000 (09:44 +0100)]
iwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCK

Due to a general shortage of RX API bits, the firmware is going
to reuse this bit on non-CCK frames to mean something else. Use
it only on CCK frames to prepare for that change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: fix %16 to %016 print format
Johannes Berg [Fri, 26 Oct 2018 09:04:30 +0000 (11:04 +0200)]
iwlwifi: mvm: fix %16 to %016 print format

With just %16, it means 16 characters padding, but we really
don't want to print "0x         1F4547B", but instead want to
have this filled with zeroes, so we need the 0.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: add prints to track virtual ID
Sara Sharon [Wed, 24 Oct 2018 10:43:26 +0000 (13:43 +0300)]
iwlwifi: pcie: add prints to track virtual ID

In case there are bugs in this area, this data can
help with debugging.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec
Shaul Triebitz [Wed, 24 Oct 2018 15:37:46 +0000 (18:37 +0300)]
iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec

Take the NSS value from 'rx_vec' rather than from 'rate_n_flags'.
The rate_n_flags has only 2 bits for the NSS giving a max of 4SS
(0 = 1SS etc.). Since there may be up to 8SS use the rx_vec which
has 3 bits for the NSS.
While at it, fix the rx_vec array to length of 2.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: iwlmvm: ignore HE PPDU type regarding EOF
Shaul Triebitz [Wed, 24 Oct 2018 09:36:18 +0000 (12:36 +0300)]
iwlwifi: iwlmvm: ignore HE PPDU type regarding EOF

When setting the EOF bit in Rx flags (propagated
to radiotap) do not depend it on the PPDU type (SU/MU/TB)
since it doesn't.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: fix the use of a wrong define
Sara Sharon [Fri, 26 Oct 2018 07:01:39 +0000 (10:01 +0300)]
iwlwifi: pcie: fix the use of a wrong define

The code checks that we haven't exceeded the maximum number of
TBs by comparing to a define of gen1 instead of gen2, fix it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoMerge tag 'iwlwifi-next-for-kalle-2019-01-25' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Tue, 29 Jan 2019 12:56:05 +0000 (14:56 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2019-01-25' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

First batch of iwlwifi patches intended for v5.1

* Support for Target Wakeup Time (TWT) -- a feature that allows the AP
  to specify when individual stations can access the medium;
* Support for mac80211 AMSDU handling;
* Debugging infrastructure work;
* Preparations for improvements in the device selection code;
* Some new PCI IDs;
* Some updates in the documentation;
* A bunch of fixes for issues found with static analyzers;
* A couple of janitorial fixes from the community;
* Some fixes in P2P;
* Other cleanups and small fixes;

5 years agoiwlwifi: fw api: document WoWLAN patterns command
Johannes Berg [Wed, 24 Oct 2018 07:50:08 +0000 (09:50 +0200)]
iwlwifi: fw api: document WoWLAN patterns command

Document the WoWLAN patterns command structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: fw api: remove unused/deprecated filter status
Johannes Berg [Tue, 23 Oct 2018 18:51:56 +0000 (20:51 +0200)]
iwlwifi: fw api: remove unused/deprecated filter status

These are unused by both firmware and driver, remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: avoid access out of memory allocated
Mordechay Goodstein [Sun, 21 Oct 2018 15:48:13 +0000 (18:48 +0300)]
iwlwifi: avoid access out of memory allocated

The value in num_lmac can be bigger than mem_cfg->lmac array,
warn in case it's bigger.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Fixes: 68025d5f9bfe ("iwlwifi: dbg: refactor dump code to improve readability")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>