1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-19 05:58:53 +02:00
Commit Graph

880 Commits

Author SHA1 Message Date
Koen Vandeputte
8b804cae5e mac80211: backport upstream fix for unitialized lock usage
Backports upstream fix from 5.19

lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1],
for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif
that is being stopped") guards clear_bit() using fq.lock even before
fq_init() from ieee80211_txq_setup_flows() initializes this spinlock.

According to discussion [2], Toke was not happy with expanding usage of
fq.lock. Since __ieee80211_wake_txqs() is called under RCU read lock, we
can instead use synchronize_rcu() for flushing ieee80211_wake_txqs().

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2022-08-08 15:37:34 +02:00
Hauke Mehrtens
3aa18f71f9 mac80211: Update to version 5.15.58-1
This updates mac80211 to version 5.15.58-1 which is based on kernel
5.15.58.
The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-07-31 16:22:08 +02:00
Felix Fietkau
9f1d622328 mac80211: fix AQL issue with multicast traffic
Exclude multicast from pending AQL budget

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-13 10:35:39 +02:00
Felix Fietkau
24eee4b244 mac80211: rename patch to avoid duplicate patch number
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-02 16:59:38 +02:00
Felix Fietkau
51e9d496ba mac80211: fix mesh queue selection issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-02 16:55:41 +02:00
Stijn Tintel
a5526efde0 mac80211: read alternative brcm fw names from DT
This patch is required for the Raspberry Pi Zero 2 W.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-07-01 12:43:58 +03:00
Josef Schlehofer
7f1ac858e3 mac80211: add patch for mwifiex to fix cryptic errors/warnings
In Turris MOX SDIO card [1], which uses Marvell 88W997 and its driver
mwifiex, you might get cryptic messages, which are not helpful to use.
@pali created patch, which improves messages by the driver and he will
send this to Linux kernel soon.

Before:
[   81.026156] mwifiex_sdio mmc1:0001:1: CMD_RESP: cmd 0x20 error, result=0x1

After:
[   15.784018] mwifiex_sdio mmc1:0001:1: CMD_RESP: cmd RF_ANTENNA (0x20) error, result=0x1

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-06-29 20:09:05 +02:00
Josef Schlehofer
f8376ffbc1 mac80211: mwl: add patch to raise global limit of SSID up to 4
SDIO chip 88W9997 from NXP [1] is quite limited by its firmware and
driver. Add hacky patch to allow up to 4 SSID instead of 3 SSID.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-06-29 20:08:52 +02:00
Felix Fietkau
7bf5233a2a mac80211: increase airtime scheduler quantum
improves performance by requiring fewer iterations over tx queues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-26 11:48:11 +02:00
Felix Fietkau
6d49a25804 mac80211: add airtime fairness improvements
This reverts the airtime scheduler back from the virtual-time based scheduler
to the deficit round robin scheduler implementation.
This reduces burstiness and improves fairness by improving interaction with AQL.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-25 23:28:09 +02:00
Tomasz Maciej Nowak
946e42ed89 mac80211: brcmfmac: allow setting MAC from NVMEM cells
The MAC can be stored in OTP memory or in flash memory, currently the
driver could read it only from OTP. Backport the patch allowing setting
the MAC address from flash. Some modules have the OTP programmed but
the ODM/OEM decided to overwrite it with value stored in flash.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2022-06-24 17:10:24 +02:00
Zhijun You
00f64ed660 ath10k: backport encapsulation offload support
This backports encap offload support from upstream.
On some ath10k devices there can be about 10% improvement on tx throughput.
Users can turn it on by setting frame_mode=2.

Signed-off-by: Zhijun You <hujy652@gmail.com>
2022-06-19 12:31:02 +02:00
Felix Fietkau
7e627f12f6 Revert "mac80211: add airtime fairness rework/fixes"
This reverts commit 96012227e578a0d8dcfa86823db97345e98e2c8f.
Needs some more work until it is ready

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-18 10:34:18 +02:00
Felix Fietkau
1c377a176b Revert "mac80211: sync airtime fairness fixes with updated upstream submission"
This reverts commit 958785508cc802de75698607670f9a236883d24d.
Needs some more work until it is ready

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-18 10:34:00 +02:00
Felix Fietkau
958785508c mac80211: sync airtime fairness fixes with updated upstream submission
- fix ath10k latency issues
- reject too large weight values
- code cleanup

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-15 20:43:49 +02:00
David Bauer
a10e0d7d35 mac80211: sync nl80211.h with upstream
Sync nl80211.h with upstream in order to maintain parity with
nl80211_copy.h shipped with hostapd.

This is necessary, as currently the enum value for
NL80211_EXT_FEATURE_RADAR_BACKGROUND mismatches between hostapd and
mac80211. This breaks background radar capability detection in hostapd.

Reported-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-06-11 01:05:45 +02:00
Felix Fietkau
96012227e5 mac80211: add airtime fairness rework/fixes
latency and short-term fairness is improved by fixing the tx queue sorting
so that it considers the pending AQL budget

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-04 09:57:53 +02:00
Felix Fietkau
9a93b62f31 mac80211: add a bug fix for a rare crash
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-06-02 21:32:05 +02:00
David Bauer
7191d64d5d mac80211: introduce BSS color collision detection
Add ieee80211_rx_check_bss_color_collision routine in order to introduce
BSS color collision detection in mac80211 if it is not supported in HW/FW
(e.g. for mt7915 chipset).
Add IEEE80211_HW_DETECTS_COLOR_COLLISION flag to let the driver notify
BSS color collision detection is supported in HW/FW. Set this for ath11k
which apparently didn't need this code.

Tested-by: Peter Chiu <Chui-Hao.Chiu@mediatek.com>
Co-developed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/a05eeeb1841a84560dc5aaec77894fcb69a54f27.1648204871.git.lorenzo@kernel.org
[clarify commit message a bit, move flag to mac80211]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
2022-05-29 00:00:30 +02:00
Robert Marko
3daf2d477e mac80211: ath10k: backport bus and device specific API 1 BDF selection
Some ath10k IPQ40xx devices like the MikroTik hAP ac2 and ac3 require the
BDF-s to be extracted from the device storage instead of shipping packaged
API 2 BDF-s.

This is required as MikroTik has started shipping boards that require BDF-s
to be updated, as otherwise their WLAN performance really suffers.
This is however impossible as the devices that require this are release under
the same revision and its not possible to differentiate them from devices
using the older BDF-s.

In OpenWrt we are extracting the calibration data during runtime and we are
able to extract the BDF-s in the same manner, however we cannot package the
BDF-s to API 2 format on the fly and can only use API 1 to provide BDF-s on
the fly.
This is an issue as the ath10k driver explicitly looks only for the board.bin
file and not for something like board-bus-device.bin like it does for pre-cal
data.
Due to this we have no way of providing correct BDF-s on the fly, so lets
extend the ath10k driver to first look for BDF-s in the board-bus-device.bin
format, for example: board-ahb-a800000.wifi.bin
If that fails, look for the default board file name as defined previously.

So, backport the upstream ath10k patch.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-05-19 11:07:02 +02:00
Thibaut VARÈNE
7dc52a78ae mac80211: fix QCA9561 PA bias
This patch fixes an invalid TX PA DC bias level on QCA9561, which
results in a very low output power and very low throughput as devices
are further away from the AP (compared to other 2.4GHz APs),
following a suggestion from nbd[1].

This patch has been submitted upstream[2].

[1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name
[2] https://lore.kernel.org/linux-wireless/20220417145145.1847-1-hacks+kernel@slashdirt.org/

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2022-04-18 06:40:59 +02:00
Petr Å tetiar
c0a6fefd9b Revert "mac80211 adjust QCA9561 PA bias"
This reverts commit f9ff282d17ec652d63fa2404e47bb0e15ed95b69 as during
upstream patch review process nbd pointed out, that this patch needs
more work:

 "The patch looks wrong to me. I'm pretty sure that AR_CH0_TOP2 is the
  correct register, the definition has an explicit check for 9561 as well.
  I believe this patch works by accident because it avoids writing a wrong
  value to that register."

1. https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name

Signed-off-by: Petr Å tetiar <ynezz@true.cz>
2022-04-17 09:20:26 +02:00
Thibaut VARÈNE
f9ff282d17 mac80211 adjust QCA9561 PA bias
ath9k is setting the TX PA DC bias level different on QCA9561 and QCA9565
although they have the same radio IP-core, which results in a very low
output power and very low throughput as devices are further away from
the AP (compared to other 2.4GHz APs.)

In real life testing, without this patch the 2.4GHz throughput on Yuncore
XD3200 is around 10Mbps sitting close to the AP, and close to theoretical
maximum with the patch applied.

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
[edit commit message]
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2022-04-15 07:11:18 +02:00
Felix Fietkau
5d5afd5177 mac80211: backport minstrel_ht fix for legacy rates
Fixes OFDM rates on 5 GHz

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-04-12 09:33:22 +02:00
Hauke Mehrtens
3aa96efa24 mac80211: Update to version 5.15.33-1
This updates mac80211 to version 5.15.33-1 which is based on kernel
5.15.33.
The removed patches were applied upstream.

This new release contains many fixes which were merged into the upstream
Linux kernel.
This also contains the following new drivers which are needed for ath11k:
* net/qrtr/
* drivers/bus/mhi/

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-04-10 23:12:36 +02:00
Felix Fietkau
56ae4eb908 mac80211: backport patch that allows receiving packets with non-standard VHT MCS10-11 rates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-25 21:11:09 +01:00
Felix Fietkau
9c8cd1462d mac80211: backport MBSSID support
Required for an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-18 14:38:27 +01:00
Petr Å tetiar
9cdd15d8a5 mac80211: headers: fix lockdep_assert_not_held()
LOCK_STATE_HELD define was omitted during backport of
lockdep_assert_not_held() which leads to build failures of kernels with
CONFIG_LOCKDEP=y:

 backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function)

Fix it by adding missing LOCK_STATE_HELD define.

References: PR#9373
Reported-by: Oskari Rauta <oskari.rauta@gmail.com>
Signed-off-by: Petr Å tetiar <ynezz@true.cz>
2022-03-15 08:33:45 +01:00
Christian Lamparter
e126a1e413 mac80211: add #if guards against 5.4 compile failures
Both struct net_device_path_ctx and struct net_device_path
are not available in 5.4. This causes an build error on the
bcm63xx target.

|mac80211/driver-ops.h: In function 'drv_net_fill_forward_path':
|driver-ops.h:1502:57: error: passing argument 4 of
|'local->ops->net_fill_forward_path' from incompatible pointer type
| [-Werror=incompatible-pointer-types]
| 1502 |                          ctx, path);
|      |                          ^~~
|      |                            |
|      |                         struct net_device_path_ctx *

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-02-25 17:27:28 +01:00
Felix Fietkau
eae0dbf68c mac80211: fix traffic stalls on forwarded mesh packets due to wrong AC selection
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-15 15:17:01 +01:00
Felix Fietkau
2fd208e272 mac80211: fix rekey failure in drivers with 802.3 decap offload
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-12 23:03:51 +01:00
Felix Fietkau
0b5a547ef0 mac80211: backport support for background radar detection
Will be used in an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-03 15:16:47 +01:00
Felix Fietkau
03ea0405a6 mac80211: backport MBSSID/EMA support patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-03 15:16:47 +01:00
Felix Fietkau
543ada64ed mac80211: reorganize patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-03 15:16:47 +01:00
Felix Fietkau
02b9b6872a mac80211: backport support for ndo_fill_forward_path
Will be used in an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-02-03 15:16:47 +01:00
Nick Hainke
236c3ea730 kernel: mac80211: refresh patchset
Refreshed:
- 311-mac80211-use-coarse-boottime-for-airtime-fairness-co.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-12-24 22:15:50 +00:00
Nick Hainke
694757a08f kernel: ath10k: provide a build variant for small RAM devices
Based on: 1ac627024de9 ("kernel: ath10k-ct: provide a build variant for
small RAM devices")

Like described in the ath10k-ct-smallbuffers version, oom-killer gets
triggered frequently by devices with small RAM.

That change is necessary for many community mesh networks which use
ath10k based devices with too little RAM. The -ct driver has been
proven unstable if used with 11s meshing and only wave2 chipsets are
supporting 11s. Freifunk Berlin is nowadays assembling its
firmware-based completely of vanilla OpenWRT with some package additions
which are made through the imagebuilder. Therefore we cannot take the
approach other freifunk communities have taken to maintain that patch
downstream [1]. Other communities consider these devices as broken and
that change would pretty much give those devices a second life [2].
[1] - 450b306e54
[2] - https://github.com/freifunk-gluon/gluon/issues/1988#issuecomment-619532909

Signed-off-by: Simon Polack <spolack+git@mailbox.org>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-12-24 22:15:50 +00:00
Felix Fietkau
87def9efd8 mac80211: optimize airtime fairness code to reduce cpu usage
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-17 15:03:05 +01:00
Hauke Mehrtens
3531a96df7 mac80211: Update to version 5.15.8
The following patches were backported from upstream before and are not
needed any more:
  package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch
  package/kernel/mac80211/patches/ath10k/980-ath10k-fix-max-antenna-gain-unit.patch
  package/kernel/mac80211/patches/build/010-headers-Add-devm_platform_get_and_ioremap_resource.patch
  package/kernel/mac80211/patches/subsys/300-mac80211-drop-check-for-DONT_REORDER-in-__ieee80211_.patch
  package/kernel/mac80211/patches/subsys/307-mac80211-do-not-access-the-IV-when-it-was-stripped.patch
  package/kernel/mac80211/patches/subsys/308-mac80211-fix-radiotap-header-generation.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-12-14 22:15:06 +01:00
Felix Fietkau
a1a71a7199 mac80211: fix tx aggregation locking issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-02 14:11:21 +01:00
Felix Fietkau
15d8c7aa74 mac80211: fix queue assignment of aggregation start requests
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-02 13:52:18 +01:00
Christian Lamparter
49d400191d ath10k: support nvmem-cells for (pre-)calibration
refreshes mac80211 + ath10k-ct patches.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-28 01:13:08 +01:00
Felix Fietkau
b92a9f607b mac80211: fix a regression in generating radiotap headers
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-26 08:42:37 +01:00
Felix Fietkau
68189835ac mac80211: backport fix for dealing with stripped IV on rx
This fixes potental rx drop issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-26 08:42:36 +01:00
Felix Fietkau
d439c7d85a mac80211: add a fix for kernel warnings when forwarding packets in mesh mode
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-24 15:39:34 +01:00
Felix Fietkau
ddd977fcc5 mac80211: fix regression in SSN handling of addba tx
Some drivers that do their own sequence number allocation (e.g. ath9k, mwlwifi) rely
on being able to modify params->ssn on starting tx ampdu sessions.
This was broken by a change that modified it to use sta->tid_seq[tid] instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-24 15:39:34 +01:00
Felix Fietkau
d1ea575baa mac80211: fix crash in drivers relying on mac80211 retransmitting packets for powersave clients
This showed up primarily on rt2x00

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-23 16:49:37 +01:00
Hauke Mehrtens
c90e10b62e mac80211: Fix deadlock when configuring wifi
The nl80211_set_wiphy() function was changed between kernel 5.11 and
5.12 to take the rdev->wiphy lock which should be freed at the end
again. The 500-mac80211_configure_antenna_gain.patch added some code
which just returned in some cases without unlocking. This resulted in a
deadlock with brcmfmac.
This patch fixes this by also jumping to the out label in case we want
to leave the function.
This fixes a hanging system when brcmfmac is in use. I do not know why
we do not see this with other driver.

The kernel returns very useful debug details when setting these OpenWrt
configuration options:
CONFIG_KERNEL_DETECT_HUNG_TASK=y
CONFIG_KERNEL_PROVE_LOCKING=y

Fixes: FS#4122
Fixes: b96c2569ac76 ("mac80211: Update to version 5.12.19-1")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-11-13 19:09:22 +01:00
Felix Fietkau
49f615022c mac80211: fix queue selection issue
When __ieee80211_select_queue is called, skb->cb has not been cleared yet,
which means that info->control.flags can contain garbage.
In some cases this leads to IEEE80211_TX_CTRL_DONT_REORDER being set, causing
packets marked for other queues to randomly end up in BE instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-10 22:25:27 +01:00
Christian Lamparter
d91318662d ath9k: nvmem for ath9k caldata
With "getting WIFI MAC from NVMEM" working on ath79 on 5.10,
the next logical step I think is to utilize nvmem subsystem
to also get the calibration data from there.

This will tremendously speed up the wifi bring-up, since
we no longer need the userspace helper for the simple
devices that can just load them from there.

included with this patch is a package/mac80211/refresh.

Tested on: WNDR3700v2, TP-Link Archer C7v2

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-06 16:40:48 +01:00