]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
4 years agoiwlwifi: incorporate firmware filename into version
Johannes Berg [Thu, 31 Oct 2019 09:28:32 +0000 (10:28 +0100)]
iwlwifi: incorporate firmware filename into version

We have many different firmware images with the same version,
and it's sometimes cumbersome to figure out which image was
really used, especially as the marketing strings that we do
print out can be the same for (slightly) different hardware
using different firmware images.

Incorporate the firmware filename into the fw_version so it's
printed out all the time. Unfortunately, this will make the
string be longer than the 32 characters for ethtool, but we
almost never really use ethtool, so strip the "iwlwifi-"
prefix (if not overridden), and the remaining data that may
then be stripped at the end is not usually useful anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: yoyo: check for the domain on all TLV types during init
Luca Coelho [Wed, 30 Oct 2019 07:40:12 +0000 (09:40 +0200)]
iwlwifi: yoyo: check for the domain on all TLV types during init

Now that we don't have dynamically changing domains anymore, we can
simply skip all the TLVs with domains that are not enabled.  To do so,
remove the checks from the functions that handle the TLVs when a
timepoint is reached to the top allocation function.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: add new iwlax411 struct for type SoSnj
Oren Givon [Tue, 22 Oct 2019 11:14:24 +0000 (14:14 +0300)]
iwlwifi: add new iwlax411 struct for type SoSnj

Add new struct for SoSnj and add uhb support for ax411 structs.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: yoyo: remove the iwl_dbg_tlv_gen_active_trigs() function
Luca Coelho [Mon, 28 Oct 2019 10:57:00 +0000 (12:57 +0200)]
iwlwifi: yoyo: remove the iwl_dbg_tlv_gen_active_trigs() function

We only call this function from a single place and it's very
very small and self-contained anyway, so remove the function and move
the code into the caller.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: yoyo: remove unnecessary active triggers status flag
Luca Coelho [Mon, 28 Oct 2019 10:39:10 +0000 (12:39 +0200)]
iwlwifi: yoyo: remove unnecessary active triggers status flag

Now that we can't change the domain at runtime anymore, we don't have
to protect the active trigger status.  Remove it.  Additionally, we
don't need to flush the dumps at this point anymore, since this only
runs during initialization and there shouldn't be any dumps running.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: yoyo: don't allow changing the domain via debugfs
Luca Coelho [Mon, 28 Oct 2019 09:18:05 +0000 (11:18 +0200)]
iwlwifi: yoyo: don't allow changing the domain via debugfs

We don't want to allow changing the domain via debugfs so that we can
apply the domain to all TLV types more easily (doing some at runtime
is difficult due to buffer allocations etc.).  Change the
fw_dbg_domain debugfs file to be read-only and remove the write
function.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: mvm: Update BEACON_TEMPLATE_CMD firmware API
Andrei Otcheretianski [Sun, 27 Oct 2019 12:01:43 +0000 (14:01 +0200)]
iwlwifi: mvm: Update BEACON_TEMPLATE_CMD firmware API

The new API version adds support for FILS discovery frames.
It adds a new flag and a field for short SSID configuration.
The new API is backward compatible, so we can just switch to it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: remove CSR registers abstraction
Luca Coelho [Thu, 10 Oct 2019 08:59:30 +0000 (11:59 +0300)]
iwlwifi: remove CSR registers abstraction

We needed this abstraction for some CSR registers for
IWL_DEVICE_22560, but that has been removed, so we don't need the
abstraction anymore.  Remove it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: remove some outdated iwl22000 configurations
Luca Coelho [Thu, 10 Oct 2019 07:13:49 +0000 (10:13 +0300)]
iwlwifi: remove some outdated iwl22000 configurations

A few configuration structures were either not referenced anymore or
assigned to devices IDs that were not in use anymore.  Remove them.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: pcie: validate queue ID before array deref/bit ops
Johannes Berg [Tue, 8 Oct 2019 14:03:15 +0000 (16:03 +0200)]
iwlwifi: pcie: validate queue ID before array deref/bit ops

Validate that the queue ID is in range before trying to use it as
an index or for test_bit() - the previous bug showed that this has
in fact happened, and it was lucky that we caught it there, had the
bit been set then we'd have actually used the value despite being
far out of range.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: pcie: use partial pages if applicable
Johannes Berg [Wed, 2 Oct 2019 10:11:54 +0000 (12:11 +0200)]
iwlwifi: pcie: use partial pages if applicable

If we have only 2k RBs like on the latest (AX210) hardware, then
even on x86 where PAGE_SIZE is 4k we currently waste half of the
memory.

If this is the case, return partial pages from the allocator and
track the offset in each RBD (to be able to find the data in them
and remap them later.)

This might also address other platforms with larger PAGE_SIZE by
putting more RBs into a single large page.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: pcie: map only used part of RX buffers
Johannes Berg [Wed, 2 Oct 2019 09:33:46 +0000 (11:33 +0200)]
iwlwifi: pcie: map only used part of RX buffers

We don't need to map *everything* of the RX buffers, we won't use
that much, map only the part we're going to use. This save some
IOMMU space (if applicable and it can deal with that) and also
prepares a bit for mapping partial pages for 2K buffers later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: allocate more receive buffers for HE devices
Johannes Berg [Fri, 27 Sep 2019 08:36:02 +0000 (10:36 +0200)]
iwlwifi: allocate more receive buffers for HE devices

For HE-capable devices, we need to allocate more receive buffers as
there could be 256 frames aggregated into a single A-MPDU, and then
they might contain A-MSDUs as well. Until 22000 family, the devices
are able to put multiple frames into a single RB and the default RB
size is 4k, but starting from AX210 family this is no longer true.
On the other hand, those newer devices only use 2k receive buffers
(by default).

Modify the code and configuration to allocate an appropriate number
of RBs depending on the device capabilities:

 * 4096 for AX210 HE devices, which use 2k buffers by default,
 * 2048 for 22000 family devices which use 4k buffers by default,
 * 512 for existing 9000 family devices, which doesn't really
   change anything since that's the default before this patch,
 * 512 also for AX210/22000 family devices that don't do HE.

Theoretically, for devices lower than AX210, we wouldn't have to
allocate that many RBs if the RB size was manually increased, but
to support that the code got more complex, and it didn't really
seem necessary as that's a use case for monitor mode only, where
hopefully the wasted memory isn't really much of a concern.

Note that AX210 devices actually support bigger than 12-bit VID,
which is required here as we want to allocate 4096 buffers plus
some for quick recycling, so adjust the code for that as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: mvm: add support for responder config command version 7
Avraham Stern [Wed, 2 Oct 2019 10:44:27 +0000 (13:44 +0300)]
iwlwifi: mvm: add support for responder config command version 7

The new API requires the driver to config the supported frame format
(legacy, HT, VHT etc.).

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: mvm: add support for location range request version 8
Avraham Stern [Wed, 2 Oct 2019 09:20:32 +0000 (12:20 +0300)]
iwlwifi: mvm: add support for location range request version 8

The new API requires the driver to set the frame format
(legacy, HT, VHT etc.) to be used for the measurement.

The new API also supports 11az and secured measurement, but
these are not supported by the driver for now.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: scan: remove support for fw scan api v11
Tova Mussai [Thu, 3 Oct 2019 17:17:07 +0000 (20:17 +0300)]
iwlwifi: scan: remove support for fw scan api v11

The fw already support scan api v12,
v11 is not needed anymore.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: dbg_ini: don't skip a TX FIFO when dumping
Luca Coelho [Tue, 1 Oct 2019 11:42:28 +0000 (14:42 +0300)]
iwlwifi: dbg_ini: don't skip a TX FIFO when dumping

Before we start looping over the internal TX FIFOs increase the fifo
number, but that's incorrect and causes a FIFO to be skipped.  This is
probably due to a copy and paste from the previous loop.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoiwlwifi: mvm: update powersave correctly for D3
Johannes Berg [Mon, 30 Sep 2019 12:45:54 +0000 (14:45 +0200)]
iwlwifi: mvm: update powersave correctly for D3

This fixes a long-standing bug - we haven't been able to check the
firmware image that was loaded for D3/not-D3 since the introduction
of the unified image...

Fix this by keeping a status flag for D3 instead of checking for
the firmware image that's loaded.

This reduces occurrences of checks for IWL_UCODE_WOWLAN to just the
code that actually loads the image or deals with it in other ways.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
4 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Thu, 19 Dec 2019 16:27:36 +0000 (18:27 +0200)]
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for v5.6. Major changes:

wil6210

* support set_multicast_to_unicast cfg80211 operation

* support set_cqm_rssi_config cfg80211 operation

wcn36xx

* disable HW_CONNECTION_MONITOR as firmware is buggy

4 years agoath11k: Use sizeof_field() instead of FIELD_SIZEOF()
Kees Cook [Thu, 19 Dec 2019 00:58:02 +0000 (16:58 -0800)]
ath11k: Use sizeof_field() instead of FIELD_SIZEOF()

The FIELD_SIZEOF() macro was redundant, and is being removed from the
kernel. Since commit c593642c8be0 ("treewide: Use sizeof_field() macro")
this is one of the last users of the old macro, so replace it.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: explicitly cast wmi commands to their correct struct type
John Crispin [Thu, 5 Dec 2019 06:26:45 +0000 (07:26 +0100)]
ath11k: explicitly cast wmi commands to their correct struct type

Three of the WMI command handlers were not casting to the right data type.
Lets make the code consistent with the other handlers.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: add support for set_cqm_rssi_config
Dedy Lansky [Wed, 18 Dec 2019 18:10:24 +0000 (20:10 +0200)]
wil6210: add support for set_cqm_rssi_config

set_cqm_rssi_config() is used by the kernel to configure connection
quality monitor RSSI threshold.
wil6210 uses WMI_SET_LINK_MONITOR_CMDID to set the RSSI threshold to
FW which in turn reports RSSI threshold changes with
WMI_LINK_MONITOR_EVENTID.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: support set_multicast_to_unicast cfg80211 operation
Ahmad Masri [Wed, 18 Dec 2019 18:10:21 +0000 (20:10 +0200)]
wil6210: support set_multicast_to_unicast cfg80211 operation

Wil6210 AP has a separate ring for transmitting multicast packets,
multicast packets are transmitted without an ack from the receiver side.
Therefore, 802.11 spec defines some low MCS rates for multicat packets.
However, there is no guarantee that these packets were really received
and handled on the client side.

Some applications that rely on multicast packets, may prefer to
transmit these packets as a unicast to ensure reliability, and also
to ensure better performance with high MCS rates.
multicast to unicast is done by duplicating multicast packets to all
clients and changing the DA (multicast) to the MAC address of the
client.
see NL80211_CMD_SET_MULTICAST_TO_UNICAST for more info.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: fix MID valid bits in Rx status message
Dedy Lansky [Wed, 18 Dec 2019 18:10:18 +0000 (20:10 +0200)]
wil6210: fix MID valid bits in Rx status message

Fix incorrect definitions of MAC ID bits inside Rx status message.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: reduce ucode_debug memory region
Dedy Lansky [Wed, 18 Dec 2019 18:10:16 +0000 (20:10 +0200)]
wil6210: reduce ucode_debug memory region

ucode_debug memory region defined as 4K bytes. Fix this according to
Talyn device memory map.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: add verification for cid upper bound
Alexei Avshalom Lazar [Wed, 18 Dec 2019 18:10:13 +0000 (20:10 +0200)]
wil6210: add verification for cid upper bound

max_assoc_sta can receive values (from the user or from the FW)
that are higher than WIL6210_MAX_CID.
Verify that cid doesn't exceed the upper bound of WIL6210_MAX_CID.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: take mem_lock for writing in crash dump collection
Alexei Avshalom Lazar [Wed, 18 Dec 2019 18:10:10 +0000 (20:10 +0200)]
wil6210: take mem_lock for writing in crash dump collection

On some crash dump cases mem_lock is already taken, error
returns and crash dump copy fails.
In this case wait until mem_lock available instead of failing
the operation.
Also take the mem_lock for writing to prevent other threads from
altering the state of the device while collecting crash dump.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: minimize the time that mem_lock is held
Alexei Avshalom Lazar [Wed, 18 Dec 2019 18:10:07 +0000 (20:10 +0200)]
wil6210: minimize the time that mem_lock is held

mem_lock is taken for the entire wil_reset().
Optimize this by taking mem_lock just before device is
being reset and release the lock after FW download.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowil6210: dump Rx status message on errors
Ahmad Masri [Wed, 18 Dec 2019 18:10:04 +0000 (20:10 +0200)]
wil6210: dump Rx status message on errors

Dump all the Rx status message on different errors to allow more
visibility of the case.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoorinoco: avoid assertion in case of NULL pointer
Aditya Pakki [Sun, 15 Dec 2019 19:58:58 +0000 (13:58 -0600)]
orinoco: avoid assertion in case of NULL pointer

In ezusb_init, if upriv is NULL, the code crashes. However, the caller
in ezusb_probe can handle the error and print the failure message.
The patch replaces the BUG_ON call to error return.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled
Dmitry Osipenko [Sun, 15 Dec 2019 18:42:24 +0000 (21:42 +0300)]
brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't be enabled

NVIDIA Tegra SoCs do not like when OOB wake is enabled and WiFi interface
is in DOWN state during suspend. This results in a CPU hang on programming
OOB wake-up state of the GPIO controller during of system's suspend.

The solution is trivial: don't enable wake for the OOB interrupt when it
should be disabled.

This fixes hang on Tegra20 (Acer A500) and Tegra30 (Nexus 7) devices which
are using BCM4329 and BCM4330 WiFi chips respectively.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: Fix memory leak in brcmf_usbdev_qinit
Navid Emamdoost [Sun, 15 Dec 2019 01:51:14 +0000 (19:51 -0600)]
brcmfmac: Fix memory leak in brcmf_usbdev_qinit

In the implementation of brcmf_usbdev_qinit() the allocated memory for
reqs is leaking if usb_alloc_urb() fails. Release reqs in the error
handling path.

Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: not set mbss in vif if firmware does not support MBSS
Wright Feng [Wed, 11 Dec 2019 23:52:51 +0000 (00:52 +0100)]
brcmfmac: not set mbss in vif if firmware does not support MBSS

With RSDB mode, FMAC and firmware are able to create 2 or more AP,
so we should not set mbss in vif structure if firmware does not
support MBSS feature.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: add RSDB condition when setting interface combinations
Wright Feng [Wed, 11 Dec 2019 23:52:50 +0000 (00:52 +0100)]
brcmfmac: add RSDB condition when setting interface combinations

With firmware RSDB feature
1. The maximum support interface is four.
2. The maximum difference channel is two.
3. The maximum interfaces of {station/p2p client/AP} are two.
4. The maximum interface of p2p device is one.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: add support for BCM4359 SDIO chipset
Soeren Moch [Wed, 11 Dec 2019 23:52:49 +0000 (00:52 +0100)]
brcmfmac: add support for BCM4359 SDIO chipset

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it
supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <wright.feng@cypress.com>

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: make errors when setting roaming parameters non-fatal
Soeren Moch [Wed, 11 Dec 2019 23:52:48 +0000 (00:52 +0100)]
brcmfmac: make errors when setting roaming parameters non-fatal

4359 dongles do not support setting roaming parameters (error -52).
Do not fail the 80211 configuration in this case.

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: fix rambase for 4359/9
Soeren Moch [Wed, 11 Dec 2019 23:52:47 +0000 (00:52 +0100)]
brcmfmac: fix rambase for 4359/9

Newer 4359 chip revisions need a different rambase address.
This fixes firmware download on such devices which fails otherwise.

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: set F2 blocksize and watermark for 4359
Chung-Hsien Hsu [Wed, 11 Dec 2019 23:52:46 +0000 (00:52 +0100)]
brcmfmac: set F2 blocksize and watermark for 4359

Set F2 blocksize to 256 bytes and watermark to 0x40 for 4359. Also
enable and configure F1 MesBusyCtrl. It fixes DMA error while having
UDP bi-directional traffic.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
[slightly adapted for rebase on mainline linux]
Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: reset two D11 cores if chip has two D11 cores
Wright Feng [Wed, 11 Dec 2019 23:52:45 +0000 (00:52 +0100)]
brcmfmac: reset two D11 cores if chip has two D11 cores

There are two D11 cores in RSDB chips like 4359. We have to reset two
D11 cores simutaneously before firmware download, or the firmware may
not be initialized correctly and cause "fw initialized failed" error.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: use generic rtl_signal_scale_mapping
Michael Straube [Wed, 11 Dec 2019 15:47:55 +0000 (16:47 +0100)]
rtlwifi: rtl8192de: use generic rtl_signal_scale_mapping

Function _rtl92de_signal_scale_mapping is identical to the generic
version rtl_signal_scale_mapping. Remove _rtl92de_signal_scale_mapping
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192cu: use generic rtl_signal_scale_mapping
Michael Straube [Wed, 11 Dec 2019 15:47:54 +0000 (16:47 +0100)]
rtlwifi: rtl8192cu: use generic rtl_signal_scale_mapping

Function _rtl92c_signal_scale_mapping is identical to the generic
version rtl_signal_scale_mapping. Remove _rtl92c_signal_scale_mapping
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192ce: use generic rtl_signal_scale_mapping
Michael Straube [Wed, 11 Dec 2019 15:47:53 +0000 (16:47 +0100)]
rtlwifi: rtl8192ce: use generic rtl_signal_scale_mapping

Function _rtl92ce_signal_scale_mapping is identical to the generic
version rtl_signal_scale_mapping. Remove _rtl92ce_signal_scale_mapping
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: use generic rtl_query_rxpwrpercentage
Michael Straube [Wed, 11 Dec 2019 15:47:52 +0000 (16:47 +0100)]
rtlwifi: rtl8192de: use generic rtl_query_rxpwrpercentage

Function _rtl92d_query_rxpwrpercentage is identical to the generic
version rtl_query_rxpwrpercentage. Remove _rtl92d_query_rxpwrpercentage
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192cu: use generic rtl_query_rxpwrpercentage
Michael Straube [Wed, 11 Dec 2019 15:47:51 +0000 (16:47 +0100)]
rtlwifi: rtl8192cu: use generic rtl_query_rxpwrpercentage

Function _rtl92c_query_rxpwrpercentage is identical to the generic
version rtl_query_rxpwrpercentage. Remove _rtl92c_query_rxpwrpercentage
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192ce: use generic rtl_query_rxpwrpercentage
Michael Straube [Wed, 11 Dec 2019 15:47:50 +0000 (16:47 +0100)]
rtlwifi: rtl8192ce: use generic rtl_query_rxpwrpercentage

Function _rtl92c_query_rxpwrpercentage is identical to the generic
version rtl_query_rxpwrpercentage. Remove _rtl92c_query_rxpwrpercentage
and use the generic function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agozd1211rw: fix storage endpoint lookup
Johan Hovold [Tue, 10 Dec 2019 11:44:26 +0000 (12:44 +0100)]
zd1211rw: fix storage endpoint lookup

Make sure to use the current alternate setting when verifying the
storage interface descriptors to avoid submitting an URB to an invalid
endpoint.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: a1030e92c150 ("[PATCH] zd1211rw: Convert installer CDROM device into WLAN device")
Cc: stable <stable@vger.kernel.org> # 2.6.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi_91x_usb: fix interface sanity check
Johan Hovold [Tue, 10 Dec 2019 11:44:25 +0000 (12:44 +0100)]
rsi_91x_usb: fix interface sanity check

Make sure to use the current alternate setting when verifying the
interface descriptors to avoid binding to an invalid interface.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: stable <stable@vger.kernel.org> # 3.15
Cc: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortl8xxxu: fix interface sanity check
Johan Hovold [Tue, 10 Dec 2019 11:44:24 +0000 (12:44 +0100)]
rtl8xxxu: fix interface sanity check

Make sure to use the current alternate setting when verifying the
interface descriptors to avoid binding to an invalid interface.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Cc: stable <stable@vger.kernel.org> # 4.4
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoorinoco_usb: fix interface sanity check
Johan Hovold [Tue, 10 Dec 2019 11:44:23 +0000 (12:44 +0100)]
orinoco_usb: fix interface sanity check

Make sure to use the current alternate setting when verifying the
interface descriptors to avoid binding to an invalid interface.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: 9afac70a7305 ("orinoco: add orinoco_usb driver")
Cc: stable <stable@vger.kernel.org> # 2.6.35
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: fix interface sanity check
Johan Hovold [Tue, 10 Dec 2019 11:44:22 +0000 (12:44 +0100)]
brcmfmac: fix interface sanity check

Make sure to use the current alternate setting when verifying the
interface descriptors to avoid binding to an invalid interface.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
Cc: stable <stable@vger.kernel.org> # 3.4
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoat76c50x-usb: fix endpoint debug message
Johan Hovold [Tue, 10 Dec 2019 11:44:21 +0000 (12:44 +0100)]
at76c50x-usb: fix endpoint debug message

Make sure to use the current alternate setting, which may not be the
same as the first alternate setting, also when printing the number of
endpoints at probe.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: set interface carrier to off by default
Rafał Miłecki [Tue, 10 Dec 2019 11:35:55 +0000 (12:35 +0100)]
brcmfmac: set interface carrier to off by default

It's important as brcmfmac creates one main interface for each PHY and
doesn't allow deleting it. Not setting carrier could result in other
subsystems misbehaving (e.g. LEDs "netdev" trigger turning LED on).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agomwifiex: delete unused mwifiex_get_intf_num()
Brian Norris [Tue, 10 Dec 2019 00:39:11 +0000 (16:39 -0800)]
mwifiex: delete unused mwifiex_get_intf_num()

Commit 7afb94da3cd8 ("mwifiex: update set_mac_address logic") fixed the
only user of this function, partly because the author seems to have
noticed that, as written, it's on the borderline between highly
misleading and buggy.

Anyway, no sense in keeping dead code around: let's drop it.

Fixes: 7afb94da3cd8 ("mwifiex: update set_mac_address logic")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoMAINTAINERS: update Ganapathi Bhat's email address
Ganapathi Bhat [Fri, 6 Dec 2019 08:17:48 +0000 (13:47 +0530)]
MAINTAINERS: update Ganapathi Bhat's email address

I'd like to use this email-id from now on.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agort2x00usb: Fix a warning message in 'rt2x00usb_watchdog_tx_dma()'
Christophe JAILLET [Wed, 4 Dec 2019 05:43:55 +0000 (06:43 +0100)]
rt2x00usb: Fix a warning message in 'rt2x00usb_watchdog_tx_dma()'

'forced' is duplicated in the message, axe one of them.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: Fix use after free in brcmf_sdio_readframes()
Dan Carpenter [Tue, 3 Dec 2019 09:58:55 +0000 (12:58 +0300)]
brcmfmac: Fix use after free in brcmf_sdio_readframes()

The brcmu_pkt_buf_free_skb() function frees "pkt" so it leads to a
static checker warning:

    drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1974 brcmf_sdio_readframes()
    error: dereferencing freed memory 'pkt'

It looks like there was supposed to be a continue after we free "pkt".

Fixes: 4754fceeb9a6 ("brcmfmac: streamline SDIO read frame routine")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi: add missing endpoint sanity checks
Johan Hovold [Thu, 28 Nov 2019 17:22:04 +0000 (18:22 +0100)]
rsi: add missing endpoint sanity checks

The driver expects at least one bulk-in endpoint when in "wifi-alone"
operating mode and two bulk-in endpoints otherwise, and would otherwise
fail to to submit the corresponding bulk URB to the default pipe during
probe with a somewhat cryptic message:

rsi_91x: rsi_rx_urb_submit: Failed in urb submission
rsi_91x: rsi_probe: Failed in probe...Exiting
RSI-USB WLAN: probe of 2-2.4:1.0 failed with error -8

The current endpoint sanity check looks broken and would only bail out
early if there was no bulk-in endpoint but at least one bulk-out
endpoint.

Tighten this check to always require at least one bulk-in and one
bulk-out endpoint, and add the missing sanity check for a Bluetooth
bulk-in endpoint when in a BT operating mode. Also make sure to log an
informative error message when the expected endpoints are missing.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi: fix non-atomic allocation in completion handler
Johan Hovold [Thu, 28 Nov 2019 17:22:03 +0000 (18:22 +0100)]
rsi: fix non-atomic allocation in completion handler

USB completion handlers are called in atomic context and must
specifically not allocate memory using GFP_KERNEL.

Fixes: a1854fae1414 ("rsi: improve RX packet handling in USB interface")
Cc: stable <stable@vger.kernel.org> # 4.17
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi: fix memory leak on failed URB submission
Johan Hovold [Thu, 28 Nov 2019 17:22:02 +0000 (18:22 +0100)]
rsi: fix memory leak on failed URB submission

Make sure to free the skb on failed receive-URB submission (e.g. on
disconnect or currently also due to a missing endpoint).

Fixes: a1854fae1414 ("rsi: improve RX packet handling in USB interface")
Cc: stable <stable@vger.kernel.org> # 4.17
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi: fix use-after-free on probe errors
Johan Hovold [Thu, 28 Nov 2019 17:22:01 +0000 (18:22 +0100)]
rsi: fix use-after-free on probe errors

The driver would fail to stop the command timer in most error paths,
something which specifically could lead to the timer being freed while
still active on I/O errors during probe.

Fix this by making sure that each function starting the timer also stops
it in all relevant error paths.

Reported-by: syzbot+1d1597a5aa3679c65b9f@syzkaller.appspotmail.com
Fixes: b78e91bcfb33 ("rsi: Add new firmware loading method")
Cc: stable <stable@vger.kernel.org> # 4.12
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Cc: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agorsi: fix use-after-free on failed probe and unbind
Johan Hovold [Thu, 28 Nov 2019 17:22:00 +0000 (18:22 +0100)]
rsi: fix use-after-free on failed probe and unbind

Make sure to stop both URBs before returning after failed probe as well
as on disconnect to avoid use-after-free in the completion handler.

Reported-by: syzbot+b563b7f8dbe8223a51e8@syzkaller.appspotmail.com
Fixes: a4302bff28e2 ("rsi: add bluetooth rx endpoint")
Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: stable <stable@vger.kernel.org> # 3.15
Cc: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Cc: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Cc: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agort2x00: use RESET state bit to prevent IV changes on restart
Stanislaw Gruszka [Thu, 28 Nov 2019 09:11:24 +0000 (10:11 +0100)]
rt2x00: use RESET state bit to prevent IV changes on restart

We can not set IV when we are under reset. Previously we read previous
IV value from registers and zeroed IV registers when key was deleted,
but this could possibly not work if DEL_KEY command was not performed.

Now when we have ->reconfig_complete ops and we fully mark mac80211
reset state via DEVICE_STATE_RESET flag, we can just skip setting IV
when keys are set during reset.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agort2x00: implement reconfig_complete
Stanislaw Gruszka [Thu, 28 Nov 2019 09:11:23 +0000 (10:11 +0100)]
rt2x00: implement reconfig_complete

mac80211 has .reconfig_complete that can be used as indicator of
HW restart end. This will allow to configure keys/IV differently
for HW restart and normal configuration.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobcma: remove set but not used variable 'sizel'
yu kuai [Wed, 27 Nov 2019 12:44:33 +0000 (20:44 +0800)]
bcma: remove set but not used variable 'sizel'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/bcma/scan.c: In function ‘bcma_erom_get_addr_desc’:

drivers/bcma/scan.c:222:20: warning: variable ‘sizel’ set but
not used [-Wunused-but-set-variable]

It is never used, and so can be removed.

Fixes: 8369ae33b705 ("bcma: add Broadcom specific AMBA bus driver")
Signed-off-by: yu kuai <yukuai3@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl_pci: Fix -Wcast-function-type
Phong Tran [Tue, 26 Nov 2019 17:55:29 +0000 (00:55 +0700)]
rtlwifi: rtl_pci: Fix -Wcast-function-type

correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoiwlegacy: Fix -Wcast-function-type
Phong Tran [Tue, 26 Nov 2019 17:55:28 +0000 (00:55 +0700)]
iwlegacy: Fix -Wcast-function-type

correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoipw2x00: Fix -Wcast-function-type
Phong Tran [Tue, 26 Nov 2019 17:55:27 +0000 (00:55 +0700)]
ipw2x00: Fix -Wcast-function-type

correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agob43legacy: Fix -Wcast-function-type
Phong Tran [Tue, 26 Nov 2019 17:55:26 +0000 (00:55 +0700)]
b43legacy: Fix -Wcast-function-type

correct usage prototype of callback in tasklet_init().
Report by https://github.com/KSPP/linux/issues/20

Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmsmac: Remove always false 'channel < 0' statement
Austin Kim [Wed, 27 Nov 2019 05:43:58 +0000 (14:43 +0900)]
brcmsmac: Remove always false 'channel < 0' statement

As 'channel' is declared as u16, the following expression is always false.
   channel < 0

So we can remove unnecessary 'always false' statement.

Signed-off-by: Austin Kim <austindh.kim@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: Remove last definitions of local bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:34 +0000 (16:09 -0600)]
rtlwifi: Remove last definitions of local bit manipulation macros

All usage of the local macros have been removed, thus the remaining
definitions are deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8723be: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:33 +0000 (16:09 -0600)]
rtlwifi: rtl8723be: Remove usage of private bit manipulation macros

Besides the previously changed macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8723ae: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:32 +0000 (16:09 -0600)]
rtlwifi: rtl8723ae: Remove usage of private bit manipulation macros

Besides the previously changed macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192ee: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:31 +0000 (16:09 -0600)]
rtlwifi: rtl8192ee: Remove usage of private bit manipulation macros

Besides the previously changed macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl88821ae: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:30 +0000 (16:09 -0600)]
rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros

Besides the previously changed macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: Remove dependence on special bit manipulation macros for common driver
Larry Finger [Mon, 25 Nov 2019 22:09:29 +0000 (16:09 -0600)]
rtlwifi: Remove dependence on special bit manipulation macros for common driver

The special macros are used in several places in the base driver.
These are replaced by standard bit manipulation macros or code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192ce: rtl8192c_com: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:28 +0000 (16:09 -0600)]
rtlwifi: rtl8192ce: rtl8192c_com: Remove usage of private bit manipulation macros

Besides the previously changes macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8188ee: Remove usage of private bit manipulation
Larry Finger [Mon, 25 Nov 2019 22:09:27 +0000 (16:09 -0600)]
rtlwifi: rtl8188ee: Remove usage of private bit manipulation

Besides the previously changes macros for the RX and TX descriptors.
the local macros are used in other places. These are replaced with
standard bit manipulation macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: Remove usage of private bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 22:09:26 +0000 (16:09 -0600)]
rtlwifi: rtl8192de: Remove usage of private bit manipulation macros

Besides the previously changes macros in trx.h, there are some of these
local macros in the driver. These are replaced with standard bit
manipulations. Unused macros are deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: Convert inline routines to little-endian words
Larry Finger [Mon, 25 Nov 2019 18:32:29 +0000 (12:32 -0600)]
rtlwifi: rtl8192de: Convert inline routines to little-endian words

In this step, the read/write routines for the descriptors are converted
to use __le32 quantities, thus a lot of casts can be removed. Callback
routines still use the 8-bit arrays, but these are changed within the
specified routine.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: Convert macros that set descriptor
Larry Finger [Mon, 25 Nov 2019 18:32:28 +0000 (12:32 -0600)]
rtlwifi: rtl8192de: Convert macros that set descriptor

As a first step in the conversion, the macros that set the RX and TX
descriptors are converted to static inline routines, and the names are
changed from upper to lower case. To minimize the changes in a given
step, the input descriptor information is left as as a byte array
(u8 *), even though it should be a little-endian word array (__le32 *).
That will be changed in the next patch.

Several places where checkpatch.pl complains about a space after a cast
and other warnings are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: Replace local bit manipulation macros
Larry Finger [Mon, 25 Nov 2019 18:32:27 +0000 (12:32 -0600)]
rtlwifi: rtl8192de: Replace local bit manipulation macros

This driver uses a set of local macros to manipulate the RX and TX
descriptors, which are all little-endian quantities. These macros
are replaced by the bitfield macros le32p_replace_bits() and
le32_get_bits(). In several places, the macros operated on an entire
32-bit word. In these cases, a direct read or replacement is used.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agortlwifi: rtl8192de: Remove unused GET_XXX and SET_XXX macros
Larry Finger [Mon, 25 Nov 2019 18:32:26 +0000 (12:32 -0600)]
rtlwifi: rtl8192de: Remove unused GET_XXX and SET_XXX macros

As the first step in converting from macros that get/set information
in the RX and TX descriptors, unused macros are being removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agobrcmfmac: Fix memory leak in brcmf_p2p_create_p2pdev()
Navid Emamdoost [Fri, 22 Nov 2019 19:19:48 +0000 (13:19 -0600)]
brcmfmac: Fix memory leak in brcmf_p2p_create_p2pdev()

In the implementation of brcmf_p2p_create_p2pdev() the allocated memory
for p2p_vif is leaked when the mac address is the same as primary
interface. To fix this, go to error path to release p2p_vif via
brcmf_free_vif().

Fixes: cb746e47837a ("brcmfmac: check p2pdev mac address uniqueness")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agowcn36xx: disable HW_CONNECTION_MONITOR
Eduardo Abinader [Tue, 17 Dec 2019 14:12:47 +0000 (15:12 +0100)]
wcn36xx: disable HW_CONNECTION_MONITOR

Whenever the signal stregth decays smoothly and physical connnection
is already gone and no deauth has arrived, the qcom soc is not
able to indicate neither WCN36XX_HAL_MISSED_BEACON_IND nor
WCN36XX_HAL_MISSED_BEACON_IND. It was noticed that such situation gets
even more reproducible, when the driver fails to enter bmps mode - which is
highly likely to occur. Thus, in order to provide proper disconnection
of the connected STA, let mac80211 handle it, instead of wcn3xx driver.

Signed-off-by: Eduardo Abinader <eduardoabinader@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath9k: fix storage endpoint lookup
Johan Hovold [Tue, 10 Dec 2019 11:44:20 +0000 (12:44 +0100)]
ath9k: fix storage endpoint lookup

Make sure to use the current alternate setting when verifying the
storage interface descriptors to avoid submitting an URB to an invalid
endpoint.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: 36bcce430657 ("ath9k_htc: Handle storage devices")
Cc: stable <stable@vger.kernel.org> # 2.6.39
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: Remove unneeded semicolon
zhengbin [Sat, 14 Dec 2019 10:22:34 +0000 (18:22 +0800)]
ath11k: Remove unneeded semicolon

Fixes coccicheck warning:

drivers/net/wireless/ath/ath11k/wmi.h:2570:2-3: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: remove an unneeded NULL check
Dan Carpenter [Fri, 13 Dec 2019 10:52:19 +0000 (13:52 +0300)]
ath11k: remove an unneeded NULL check

The list iterator is always non-NULL so it doesn't need to be checked.
I also removed the unnecessary initializer because the list iterator is
always initialized.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: checking for NULL vs IS_ERR()
Dan Carpenter [Fri, 13 Dec 2019 10:51:27 +0000 (13:51 +0300)]
ath11k: checking for NULL vs IS_ERR()

The ath11k_ce_alloc_ring() function returns error pointers on error, not
NULL.  The rest of the driver assumes that "pipe->src_ring" is either
valid or NULL so this patch introduces a temporary varaible to avoid
leaving it as an error pointer.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: delete a stray unlock in ath11k_dbg_htt_stats_req()
Dan Carpenter [Fri, 13 Dec 2019 10:47:54 +0000 (13:47 +0300)]
ath11k: delete a stray unlock in ath11k_dbg_htt_stats_req()

The callers unlock this lock so this error path has a double unlock.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: fix missing free of skb on error return path
Colin Ian King [Thu, 12 Dec 2019 19:42:51 +0000 (19:42 +0000)]
ath11k: fix missing free of skb on error return path

The error handling when the call to ath11k_hal_srng_get_entrysize fails
leaks skb, fix this by returning via the err_free return path that will
ensure the skb is free'd.

Addresses-Coverity: ("Resource leak")
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: fix uninitialized variable radioup
Colin Ian King [Thu, 12 Dec 2019 19:10:44 +0000 (19:10 +0000)]
ath11k: fix uninitialized variable radioup

The variable radioup is not uninitalized so it may contain a garbage
value and hence the detection of a radio that is not up is buggy.
Fix this by initializing it to zero.

Addresses-Coverity: ("Uninitalized scalar variable")
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: fix memory leak on reg_info
Colin Ian King [Thu, 12 Dec 2019 18:32:28 +0000 (18:32 +0000)]
ath11k: fix memory leak on reg_info

Currently a return path is leaking the previously allocate reg_info. Fix
this by exiting via the return path mem_free.  Since the return value ret
is defaulted to 0, there is no need to re-assign ret to the 0 before
the goto.

Addresses-Coverity: ("Resource leak")
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: Remove unnecessary enum scan_priority
Nathan Chancellor [Wed, 11 Dec 2019 19:22:52 +0000 (12:22 -0700)]
ath11k: Remove unnecessary enum scan_priority

Clang warns:

drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit
conversion from enumeration type 'enum wmi_scan_priority' to different
enumeration type 'enum scan_priority' [-Wenum-conversion]
        arg->scan_priority = WMI_SCAN_PRIORITY_LOW;
                           ~ ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.

wmi_scan_priority and scan_priority have the same values but the wmi one
has WMI prefixed to the names. Since that enum is already being used,
get rid of scan_priority and switch its one use to wmi_scan_priority to
fix this warning.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Link: https://github.com/ClangBuiltLinux/linux/issues/808
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: fix several spelling mistakes
Colin Ian King [Wed, 11 Dec 2019 08:34:43 +0000 (08:34 +0000)]
ath11k: fix several spelling mistakes

There are several spelling mistakes in warning and debug messages,
fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: add some missing __packed qualifiers
John Crispin [Thu, 5 Dec 2019 06:26:44 +0000 (07:26 +0100)]
ath11k: add some missing __packed qualifiers

A few of the WMI parameter structs were missing this.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: set the BA buffer size to 256 when HE is enabled
Pradeep Kumar Chitrapu [Fri, 13 Dec 2019 15:34:57 +0000 (16:34 +0100)]
ath11k: set the BA buffer size to 256 when HE is enabled

This patch sets the correct BA buffer size when we are in HE mode.
Without this change we are not able to receive 256 bitmapped BA frames.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: fix pdev when invoking ath11k_wmi_send_twt_enable_cmd()
Pradeep Kumar Chitrapu [Fri, 13 Dec 2019 15:34:56 +0000 (16:34 +0100)]
ath11k: fix pdev when invoking ath11k_wmi_send_twt_enable_cmd()

The code currently uses the wrong pdev id when enabling TWT. Fix this by
using the correct ones.

Fixes: e65a616f4e74 ("ath11k: add TWT support")
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: optimize ath11k_hal_tx_status_parse
John Crispin [Fri, 13 Dec 2019 15:38:39 +0000 (16:38 +0100)]
ath11k: optimize ath11k_hal_tx_status_parse

Moving the function into dp_tx.c allows gcc to optimize the code better
and also avoid chace invalidates and context switches.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: optimise ath11k_dp_tx_completion_handler
John Crispin [Fri, 13 Dec 2019 15:38:38 +0000 (16:38 +0100)]
ath11k: optimise ath11k_dp_tx_completion_handler

the current code does 4 memcpys for each completion frame.
1) duplicate the desc
2 + 3) inside kfifo insertion
4) kfifo remove

The code simply drops the kfifo and uses a trivial ring buffer. This
requires a single memcpy for insertion. There is no removal needed as
we can simply use the inserted data for processing. As the code runs
inside the NAPI context it is atomic and there is no need for most of
the locking.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 years agoath11k: move some tx_status parsing to debugfs code
John Crispin [Fri, 13 Dec 2019 15:38:37 +0000 (16:38 +0100)]
ath11k: move some tx_status parsing to debugfs code

Some of the fields are only used by debugfs. Move the parsing of these
from the data hot path to the debugfs code.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>