Commit Graph

840 Commits

Author SHA1 Message Date
Felix Fietkau 12cb52bd06 mac80211: minstrel_ht: fix issue in calculating success probability
Missing braces in a macro were leading to badly working rates sometimes
getting a success probabilty of 1.0

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-28 21:08:29 +02:00
Felix Fietkau dfdb28c24a mac80211: add client mode connection monitor fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-11 19:44:07 +02:00
Felix Fietkau 7d8e14e44f mac80211: support rx timestamps for HE rates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-04-11 19:44:07 +02:00
Felix Fietkau 571aedbc6c mac80211: merge a few pending tx related fixes
Improve performance and fix potential mgmt tx hangs/warnings

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-03-28 12:16:24 +02:00
Rui Salvaterra b1d0f66388 mac80211: rtl: update RTL8821AE PHY/RF parameters
Create a new directory for Realtek patches and backport the updated PHY and RF
parameters patch. Improves the connectivity in the 5 GHz band [1].

[1] https://patchwork.kernel.org/project/linux-wireless/patch/20210219052607.7323-1-pkshih@realtek.com/#23988567

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-19 01:25:26 +01:00
Felix Fietkau 5dc5015072 mac80211: backport upstream patches for driver disconnect
Needed for an mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-03-15 14:05:43 +01:00
Hauke Mehrtens 1132340a22 mac80211: Update to version 5.10.16-1
The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-02-15 22:29:42 +01:00
Hauke Mehrtens 0cde9a0a65 mac80211: Refresh patches again
A wrong quilt configuration was used last time.

Fixes: ed1e234d87 ("mac80211: refresh patches")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-02-15 22:29:42 +01:00
Felix Fietkau f118be0712 ath9k: fix transmitting to stations in dynamic SMPS mode
When transmitting to a receiver in dynamic SMPS mode, all transmissions that
use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
give the receiver's extra chains some time to wake up.
This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
Intel ones, which make aggressive use of SMPS.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:55:45 +01:00
Felix Fietkau 9cb63f5360 mac80211: fix a regression in processing rx stats
A logic error caused rx rate update to be missed for any driver not using
fast-rx

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Felix Fietkau ed1e234d87 mac80211: refresh patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Felix Fietkau 072bfe2113 mac80211: add minstrel performance improvements
Reduce fluctuations in rate selection / statistics

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Felix Fietkau b6066846ad mac80211: add decapsulation offload support
On hardware that supports this, this will improve performance by passing
802.3 frames from the hardware to the stack

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Felix Fietkau 8fc2cfea87 mac80211: fix a corner case in encapsulation offload support
Fix encryption key selection with WEP

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Felix Fietkau 268210cec8 mac80211: add fq performace improvements
Improves performance under load

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-14 19:41:07 +01:00
Hauke Mehrtens 12424edff5 mac80211: Update to version 5.10-rc6-1
The removed patches were applied upstream.

This adapts ath10k-ct and mt76 to changed APIs.
nl80211.h in iw is updated to match the version from backports.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-02-14 15:15:29 +01:00
Hauke Mehrtens bf6f7cf29b mac80211: Update to version 5.9.12-1
The removed patches were applied upstream.

Remove the 300-mac80211-optimize-skb-resizing.patch.
This patch was not applied upstream, but it conflicts with upstream
changes and needs bigger changes. It was applied with Felix to remove
this patch for now. It should be reworked and then send upstream later.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-02-14 15:13:40 +01:00
Felix Fietkau 84fa59b5a8 mac80211: fix station rate table updates on assoc
If the driver uses .sta_add, station entries are only uploaded after the sta
is in assoc state. Fix early station rate table updates by deferring them
until the sta has been uploaded

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-02-01 10:00:23 +01:00
David Bauer 0c499f6068 mac80211: convert UniFi Outdoor+ HSR support to OF
Enable support for the Ubiquiti UniFi Outdoor+ RF filter via
device-tree. The old way of using platform data is not required anymore,
as it was only used on the now removed ar71xx target.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-02-01 00:47:36 +01:00
Felix Fietkau 7ca75a2d01 mac80211: fix an uninitialized variable warning
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:00:03 +01:00
Felix Fietkau 56c20f0a5a mac80211: minstrel_ht: fix regression in the max_prob_rate fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 16:46:45 +01:00
Felix Fietkau 1fdbb8779a mac80211: remove accidentally duplicated line in minstrel_ht patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 16:46:45 +01:00
Felix Fietkau 37752336bd mac80211: add significant minstrel_ht performance improvements
Completely redesign the rate sampling approach

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-25 12:19:22 +01:00
Felix Fietkau b0ad07e9a0 mac80211: fix rounding error in minstrel_ht throughput calculation
Fixes rate selection with lower data rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-15 13:05:40 +01:00
Felix Fietkau faeaf5a010 mac80211: fix an uninitialized stack variable in the minstrel update
It can lead to out-of-bounds access and invalid rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-14 20:12:29 +01:00
Felix Fietkau 3a12c6679e mac80211: replace legacy minstrel with minstrel_ht, improve rate selection
Legacy minstrel is essentially unmaintained and was showing poor performance
Replace it with minstrel_ht and improve rate selection and sampling behavior

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-03 12:56:40 +01:00
Felix Fietkau 3ab695368a mac80211: do not drop tx nulldata packets on encrypted links
Fixes sending out nulldata probing frames

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-18 23:05:50 +01:00
Hauke Mehrtens 6cdc21b20e mac80211: Update to version 5.8.18-1
The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-12-16 22:11:19 +01:00
Felix Fietkau 0bb5d39b7a mac80211: add minstrel fixes that fix mt76 issues in legacy mode
Remove deferred sampling code which does not work well with rate tables +
probing.
Fix tx status handling if the first invalid rate idx is not set to -1

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-12 11:24:42 +01:00
Felix Fietkau bf3158b620 mac80211: backport the new tasklet API
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-12 11:24:42 +01:00
Markov Mikhail 610843f3bc mac80211: rt2x00: save survey for every channel visited
rt2800 olny gives you survey for current channel.

Survey-based ACS algorithms are failing to perform their job when working
with rt2800.

Make rt2800 save survey for every channel visited and be able to give away
that information.

There is a bug registred https://dev.archive.openwrt.org/ticket/19081 and
this patch solves the issue.

Signed-off-by: Markov Mikhail <markov.mikhail@itmh.ru>
2020-10-21 11:56:26 +01:00
Felix Fietkau 08a42ef057 mac80211: fix memory leak on filtered powersave frames
After the status rework, ieee80211_tx_status_ext is leaking un-acknowledged
packets for stations in powersave mode.
To fix this, move the code handling those packets from __ieee80211_tx_status
into ieee80211_tx_status_ext

Reported-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-10-17 16:43:17 +02:00
Daniel Golle e0d482fdcf rt2x00: mt7620: differentiate based on SoC's CHIP_VER
The vendor driver does things differently based on what it finds in the
SoC's CHIP_VER register, which should tell whether this is MT7620N or
MT7620A (PKG) and probably also the revision (VER) and most likely
also something about the silicon implementer (ECO).
Introduce codepaths just like the ones in the vendor driver to handle
the different chips properly.

Some of those paths are most likely dead code and left-overs from FPGA
versions or early prototypes of the chip. It'd thus be great if people
can post their kernel logs, at least the line telling the chip version
and eco, so we know what's actually out there in the wild -- all I
could find is
[ 0.000000] SoC Type: Ralink MT7620A ver:2 eco:6
and
[ 0.000000] SoC Type: Ralink MT7620N ver:2 eco:6
which would make things easier, as then we really just need to know
whether it's MT7620N or MT7620A and not care about FPGA or prototypes
with ver <= 1 and eco <= 2.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-10-09 01:50:30 +01:00
Felix Fietkau 1ed6eb176c mac80211: backport sched_set_fifo_low
This is needed for newer mt76 updates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-29 17:32:26 +02:00
Felix Fietkau 5b296141c2 mac80211: another fix for the sta connection monitor
Make the code more closely match the original behavior

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-29 17:32:26 +02:00
Felix Fietkau 4bd7689d85 mac80211: update sta connection monitor regression fix
Reset the connection monitor on all acked frames

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-23 08:39:26 +02:00
Felix Fietkau 1c6d45644a mac80211: fix regression in station connection monitor optimization
When the nulldata frame was acked, the probe send count needs to be reset,
otherwise it will keep increasing until the connection is considered dead,
even though it fine.

Reported-by: Georgi Valkov <gvalkov@abv.bg>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-21 17:56:31 +02:00
Felix Fietkau caf727767a mac80211: do not allow bigger VHT MPDUs than the hardware supports
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-17 14:48:33 +02:00
Felix Fietkau 673062fc56 mac80211: allow bigger A-MSDU sizes in VHT, even if HT is limited
Improves tx throughput when connecting to some APs (e.g. Asus RT-AC88U)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-16 18:49:11 +02:00
Felix Fietkau d717343c85 mac80211: update encap offload patches to the latest version
Minor cleanup and code reorganization, along with a change to not disable
offload anymore when a tkip or sw crypto key is added

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-09 11:51:47 +02:00
Felix Fietkau 91fb3ce56b mac80211: remove an obsolete patch that is no longer doing anything useful
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-01 17:01:56 +02:00
Felix Fietkau 2c14710c54 mac80211: add more AQL fixes/improvements
Fix aggregation length estimation, add HE and VHT160 support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-01 17:01:56 +02:00
Hauke Mehrtens ca5ee6eba3 mac80211: Fix potential endless loop
Backport a fix from kernel 5.8.3.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-30 22:21:34 +02:00
Felix Fietkau e7f7101182 mac80211: rework encapsulation offload support
Fix a number of deficiencies in the existing API

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-22 07:02:01 +02:00
Felix Fietkau 010682067b mac80211: add missing return code checks in AQL improvements
Fixes throughput issues with some drivers (e.g. ath10k)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-21 18:29:52 +02:00
Felix Fietkau 6bdd4c967b mac80211: add missing backports for building with 4.14 kernels
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-14 17:27:31 +02:00
Felix Fietkau 431fb8cae9 mac80211: add AQL improvements
Add AQL support for HE drivers.
Improve assumed aggregation length based on tx rate

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-13 17:57:19 +02:00
Hauke Mehrtens fce0f1501b mac80211: Update to version 5.8
The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-08-10 19:34:37 +02:00
Felix Fietkau eff8c76aa0 mac80211: fix spurious disconnect issues with disassoc_low_ack=1 (default)
mac80211 reports a packet loss event to user space when 50 consecutive packets
were not acked. On a high throughput link with long aggregates and sudden
link changes, this can trigger way too easily.
Mitigate false positives by only triggering the event on a packet loss if
no ACK was received for at least a second

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-09 14:01:49 +02:00
David Bauer 1bfba18a36 mac80211: exchange mesh 6GHz IE patch for upstream accepted
Exchange the patch fixing the kernel ringbuffer WARNING flood for the
one accepted upstream.

Fixes commit a956c14d6a ("mac80211: util: don't warn on missing sband
iftype data")

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-08-08 10:31:57 +02:00
Felix Fietkau 3d731fc903 mac80211: merge performance improvement patches
Fix fq_codel performance issues
Add a new rx function for batch processing

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-06 12:43:25 +02:00
Felix Fietkau b7727a8005 mac80211: fix AQL issues
- Remove bogus STA txq pending airtime underflow warning
- Improve tx airtime estimation for A-MPDU traffic

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-08-06 12:42:29 +02:00
David Bauer a956c14d6a mac80211: util: don't warn on missing sband iftype data
The kernel currently floods the ringbuffer with warnings when adding a
mesh interface for a device not support HE 6GHz modes.

Return without warning in this case, as mesh_add_he_6ghz_cap_ie calls
ieee80211_ie_build_he_6ghz_cap regardless of the supported interface
modes.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-07-25 22:36:34 +02:00
Hauke Mehrtens ed2015c386 mac80211: Update to version 5.8-rc2-1
The following patches:
* 972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
* 973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
are replaced by this commit in the upstream kernel:
* 3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes")

The following patches were applied upstream:
* 001-rt2800-enable-MFP-support-unconditionally.patch
* 090-wireless-Use-linux-stddef.h-instead-of-stddef.h.patch

The rtw88 driver is now split into multiple kernel modules, just put it
all into one OpenWrt kernel package.

rtl8812au-ct was patched to compile against the mac80211 from kernel
5.8, but not runtime tested.

Add a patch which fixes ath10k on IPQ40XX, this patch was send upstream
and fixes a crash when loading ath10k on this SoC.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq40xx/ map-ac2200]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-07-23 23:39:56 +02:00
Hauke Mehrtens d1100c76b3 mac80211: Update to version 5.7.5-1
The b43 and b43legacy driver now support DRIVER_11W_SUPPORT.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-07-23 22:28:52 +02:00
Daniel Golle 727685c317 mac80211: rt2x00: define RF5592 in init_eeprom routine
Make sure RF5592 is set for RT5592 chip which apparently sometimes
doesn't have RF defined (but always comes with RF5592).
This patch was originally submitted on linux-wireless by
Tom Psyborg <pozega.tomislav@gmail.com> but got rejected.
Turns out the patch is actually needed.

Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-07-10 18:53:52 +01:00
David Bauer 870588b6eb mac80211: ath9k: enable MFP capability unconditionally
ath9k will already fallback on software-crypto for chipsets not
supporting IEEE802.11w (MFP). So advertising MFP is not dependent
on disabling HW crypto for all traffic entirely.

Tested on Sonicwall SonicPoint Ni (AR9132)

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-25 02:36:19 +02:00
Daniel Golle a002a24536 mac80211: rt2x00: backport patch enabling MFP
From: Rui Salvaterra <rsalvaterra@gmail.com>
Date: Mon, 25 May 2020 14:49:07 +0100
Subject: [PATCH] rt2800: enable MFP support unconditionally

This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-05-30 09:37:36 +01:00
Hauke Mehrtens 04b1a11f5c mac80211: Fix build on mpc85xx target
This fixes the following compile error seen on the mpc85xx target:
  CC [M]  /linux-mpc85xx_p2020/backports-5.7-rc3-1/drivers/net/wireless/intersil/orinoco/main.o
In file included from /builder/shared-workdir/build/staging_dir/toolchain-powerpc_8540_gcc-8.4.0_musl/include/stddef.h:17,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/include/uapi/linux/wireless.h:77,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/include/linux/wireless.h:13,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/drivers/net/wireless/intersil/orinoco/main.c:89:
/builder/shared-workdir/build/staging_dir/toolchain-powerpc_8540_gcc-8.4.0_musl/include/bits/alltypes.h:106:15: error: conflicting types for 'ptrdiff_t'
 typedef _Addr ptrdiff_t;
               ^~~~~~~~~
In file included from /linux-mpc85xx_p2020/backports-5.7-rc3-1/backport-include/linux/types.h:4,
                 from ./include/linux/list.h:5,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/backport-include/linux/list.h:3,
                 from ./include/linux/module.h:9,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/backport-include/linux/module.h:3,
                 from /linux-mpc85xx_p2020/backports-5.7-rc3-1/drivers/net/wireless/intersil/orinoco/main.c:79:
./include/linux/types.h:65:28: note: previous declaration of 'ptrdiff_t' was here
 typedef __kernel_ptrdiff_t ptrdiff_t;
                            ^~~~~~~~~
scripts/Makefile.build:265: recipe for target '/linux-mpc85xx_p2020/backports-5.7-rc3-1/drivers/net/wireless/intersil/orinoco/main.o' failed

Fixes: 289c632425 ("mac80211: Update to version 5.7-rc3-1")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-05-21 21:53:14 +02:00
Hauke Mehrtens 289c632425 mac80211: Update to version 5.7-rc3-1
This updates the mac80211 backport.

The removed patches are already integrated in the upstream version.

The 131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch patch
was manually adapted to the changes in kernel 5.7.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-05-21 14:39:34 +02:00
Hauke Mehrtens 64f343a881 mac80211: Update to version 5.6.8-1
This updates the mac80211 backport.

The removed patches are already integrated in the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-05-21 14:39:34 +02:00
Hauke Mehrtens 9ca21dc7d5 mac80211: Update to version 5.5.19
This updates the mac80211 backport.

The removed patches are already integrated in the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-05-21 14:39:34 +02:00
Hauke Mehrtens a4b50c4bce mac80211: Update to version 5.4.36-1
This updates the mac80211 backport to the latest minor version.

The removed patch was a backport from the upstream kernel which is now
integrated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-05-21 14:39:34 +02:00
Linus Lüssing 066ec97167 mac80211: ath10k: increase rx buffer size to 2048
Before, only frames with a maximum size of 1528 bytes could be
transmitted between two 802.11s nodes.

For batman-adv for instance, which adds its own header to each frame,
we typically need an MTU of at least 1532 bytes to be able to transmit
without fragmentation.

This patch now increases the maxmimum frame size from 1528 to 1656
bytes.

Tested with two ath10k devices in 802.11s mode, as well as with
batman-adv on top of 802.11s with forwarding disabled.

Fix originally found and developed by Ben Greear.

Link: https://github.com/greearb/ath10k-ct/issues/89
Link: 9e5ab25027
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-04-26 21:20:47 +02:00
David Bauer 0f1b5ce2f5 mac80211: drop data frames without key on encrypted links
If we know that we have an encrypted link (based on having had
a key configured for TX in the past) then drop all data frames
in the key selection handler if there's no key anymore.

This fixes an issue with mac80211 internal TXQs - there we can
buffer frames for an encrypted link, but then if the key is no
longer there when they're dequeued, the frames are sent without
encryption. This happens if a station is disconnected while the
frames are still on the TXQ.

Detecting that a link should be encrypted based on a first key
having been configured for TX is fine as there are no use cases
for a connection going from with encryption to no encryption.
With extended key IDs, however, there is a case of having a key
configured for only decryption, so we can't just trigger this
behaviour on a key being configured.

Cc: stable@vger.kernel.org
Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-04-17 13:27:40 +02:00
Daniel Golle a24a9bbc8c mac80211: rt2x00: prune more unnecessary exports
The calibration patches for MT7620 unnecessarily export symbols and
populate never accessed function pointers. Remove all that and make
functions static as the only place where each of those functions is
called is within rt2800lib.c.
Also make code more readable by fixing indentation, removing
unnecessary parantheses and simplifying some instructions using
shorthands here and there.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-04-01 19:47:59 +01:00
Hauke Mehrtens f0aff72c2b mac80211: Update to version 5.4.27
The removed patches are all integrated in the upstream version now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-03-29 18:22:10 +02:00
Hauke Mehrtens 94949801de mac80211: Fix rt2x00 exports
Do not export static functions, they are anyway not referenced by any
code in a different module.

This fixes the following compile warning:
WARNING: "rt2800_rf_aux_tx0_loopback" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_write_dc" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_rf_configstore" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_do_sqrt_accumulation" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_rf_configrecover" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_loft_search" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_iq_search" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_setbbptonegenerator" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL
WARNING: "rt2800_rf_aux_tx1_loopback" [/drivers/net/wireless/ralink/rt2x00/rt2800lib] is a static EXPORT_SYMBOL_GPL

Acked-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-03-29 18:22:01 +02:00
Rafał Miłecki 038318f766 mac80211: fix brcmfmac monitor interface crash
This fixes bug in brcmfmac *exposed* by ipv6/addrconf fix.

Fixes: ec8e8e2ef0 ("kernel: backport out-of-memory fix for non-Ethernet devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-03-27 14:57:01 +01:00
Sven Over 5b13ea8d28 mac80211: fix symbol dependency of rt2x00lib kernel module
On platforms that do not have CONFIG_MTD enabled, loading the
rt2x00lib kernel module fails because it depends on symbols from
the mtd module ("Unknown symbol get_mtd_device_nm").

This commit disables the code that can read the eeprom from mtd if
mtd is not enabled.

Signed-off-by: Sven Over <sp@cedenti.st>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-03-07 20:18:30 +01:00
Hauke Mehrtens a9363914a3 mac80211: Allow IBSS mode and different beacon intervals
ath10k-ct supports the combination to select IBSS (ADHOC) mode and
different beacon intervals together. mac80211 does not like this
combination, but Ben says this is ok, so remove this check.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-02-24 23:23:46 +01:00
Fredrik Olofsson 9ad1ccbe15 mac80211: backport fix TID field in monitor mode transmit
Backport 753ffad3d6243303994227854d951ff5c70fa9e0 as merged in Linux v5.5-rc3.

Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
2020-02-22 16:38:41 +01:00
Rafał Miłecki aca274091a mac80211: brcm: backport remaining 5.6 kernel patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2020-02-06 11:36:15 +01:00
John Crispin df773ead9a bcm4xxx: fix iwinfo behaviour
Signed-off-by: John Crispin <john@phrozen.org>
2020-02-04 07:48:09 +01:00
Felix Fietkau ea5078014d mac80211: backport airtime queue limits support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-01-29 12:24:57 +01:00
Felix Fietkau e0ab33ea49 mac80211: backport fix for an no-ack tx status issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-01-29 12:24:57 +01:00
Michal Cieslakiewicz 4a0a1fc91c mac80211: ath9k: add GPIO mask dts property
This patch adds 'qca,gpio-mask=<u32>' device tree property to ath9k node.
This optional setting is a hack and should only be used in very special
(and rare) cases when a button or LED is wired to a GPIO pin normally
masked out (due to being one-way etc). Netgear WNDR4300 v2 is one such
example - it uses GPI9 for RFKILL.

See ath9k/reg.h *_GPIO_MASK constants.

Use with caution and expect to see stream of kernel warnings if wrong
mask value is provided.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2020-01-15 20:55:31 +01:00
Felix Fietkau 9501469e11 mac80211: fix a page refcounting issue leading to leaks/crashes in rx A-MSDU decap
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-01-14 14:56:59 +01:00
Felix Fietkau d5b3024139 mac80211: fix sta TID stats leak on a few nl80211 calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-01-14 14:56:54 +01:00
Felix Fietkau fe1818cdbc mac80211: renumber subsys patches accepted upstream
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-01-14 14:56:46 +01:00
Christian Lamparter 1e27befe63 mac80211: remove ath10k_pci memory hacks
These two hacks are no longer necessary as they've
been moved to a special variant of kmod-ath10k-ct.

So, if you have a device suffering from low-memory
situation and getting applications crashes due to
the OOM reaper or kernel panics with ath10k, please
use the "kmod-ath10k-ct-smallbuffers" package from
now on.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-01-05 19:02:55 +01:00
David Bauer 985ec835ae rt2x00: add throughput LED trigger
This adds a (currently missing) throughput LED trigger for the rt2x00
driver. Previously, LED triggers had to be assigned to the netdev, which
was limited to a single VAP.

Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Christoph Krapp <achterin@googlemail.com>
2019-12-30 13:09:14 +02:00
Rafał Miłecki 17e2246eca mac80211: brcm: add support for BCM4359 SDIO chipset
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-12-19 09:17:22 +01:00
Rafał Miłecki c3aa33bf70 mac80211: brcm: backport 5.5 and 5.6 kernel patches
This update doesn't include:
3b1e0a7bdfee brcmfmac: add support for SAE authentication offload
be898fed355e brcmfmac: send port authorized event for FT-802.1X
due to nl80211 dependencies.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-12-19 08:41:34 +01:00
Christian Lamparter 82a741c774 mac80211: switch to upstream owl-loader driver
The Owl Loader (named after the codename that Atheros gave
these devices back in the day) has been accepted upstream.

This patch removes the "misc" driver OpenWrt had and adds
the remaining differences against the version that ships
with 5.4-rc1 into a separate "120-owl-loader-compat.patch"
file that can be cut down once AR71XX is being dealt with.

Note: I decided to keep the existing (kmod-)owl-loader
package name around for now. The kernel module file in
the kmod package will be called ath9k_pci_owl_loader.ko
though.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2019-11-30 13:21:20 +01:00
Hauke Mehrtens a36c464efe mac80211: update to version 5.4-rc8
This updates mac80211 to backports based on kernel 5.4-rc8.

The deleted patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-11-22 20:35:54 +01:00
Koen Vandeputte a74095c68c mac80211: refresh patches
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2019-11-19 14:59:03 +01:00
Koen Vandeputte 2d6a062b22 mac80211: backport upstream fixes
This potentially fixes some issues seen on IBSS
when interfaces go out of range and then re-appear.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2019-11-19 14:59:03 +01:00
Hauke Mehrtens eaa047179a mac80211: Adapt to changes to skb_get_hash_perturb()
The skb_get_hash_perturb() function now takes a siphash_key_t instead of
an u32. This was changed in commit 55667441c84f ("net/flow_dissector:
switch to siphash"). Use the correct type in the fq header file
depending on the kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2019-11-18 20:12:12 +01:00
Rafał Miłecki cde8c2f2fb mac80211: brcmfmac: fix PCIe reset crash and WARNING
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2019-11-18 14:48:41 +01:00
David Bauer 4c6fe32468 mac80211 ath9k: force QCA953x clock to 25MHz
The QCA953x only supports 25 MHz refclk, however some OEMs set an
invalid bootstrap value for the REF_CLK option, which would break the
clock detection in ath9k.

Force the QCA953x refclk to 25MHz in ath9k, as this is (according to the
datasheet) the only valid frequency.

Signed-off-by: David Bauer <mail@david-bauer.net>
2019-11-05 22:55:54 +01:00
Felix Fietkau fa37dbbc43 mac80211: fix build without CONFIG_PCI
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-05 14:22:01 +01:00
Felix Fietkau d64daf7026 mac80211: add pcie apsm backport changes
Required for newer versions of mt76

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-05 12:09:26 +01:00
Daniel Golle 43ae50978a mac80211: rt2x00: remove errornous duplicate condition
https://patchwork.kernel.org/patch/11224189/
--
On 2019-10-28 06:07, wbob wrote:
> Hello Roman,
>
> while reading around drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> I stumbled on what I think is an edit of yours made in error in march
> 2017:
>
> https://github.com/torvalds/linux/commit/41977e86#diff-dae5dc10da180f3b055809a48118e18aR5281
>
> RT6352 in line 5281 should not have been introduced as the "else if"
> below line 5291 can then not take effect for a RT6352 device. Another
> possibility is for line 5291 to be not for RT6352, but this seems
> very unlikely. Are you able to clarify still after this substantial time?
>
> 5277: static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
> ...
> 5279:  } else if (rt2x00_rt(rt2x00dev, RT5390) ||
> 5280:         rt2x00_rt(rt2x00dev, RT5392) ||
> 5281:         rt2x00_rt(rt2x00dev, RT6352)) {
> ...
> 5291:  } else if (rt2x00_rt(rt2x00dev, RT6352)) {
> ...

Hence remove errornous line 5281 to make the driver actually
execute the correct initialization routine for MT7620 chips.

As it was requested by Stanislaw Gruszka remove setting values of
MIMO_PS_CFG and TX_PIN_CFG. MIMO_PS_CFG is responsible for MIMO
power-safe mode (which is disabled), hence we can drop setting it.
TX_PIN_CFG is set correctly in other functions, and as setting this
value breaks some devices, rather don't set it here during init, but
only modify it later on.

Fixes: 41977e86c984 ("rt2x00: add support for MT7620")
Reported-by: wbob <wbob@jify.de>
Reported-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
--

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-11-03 18:31:02 +01:00
Hauke Mehrtens e6cadb215c mac80211: Update to version 5.4-rc2
This updates mac80211 to backports based on kernel 5.4-rc2

ath10k-ct was updated to match the API changes and iw now uses the new
nl80211.h header file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-10-19 12:35:55 +02:00
Hauke Mehrtens 67dc023f87 mac80211: Update to version 5.3.6
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-10-19 12:35:55 +02:00
Stefan Lippers-Hollmann f690b6f472 mac80211: fix scan when operating on DFS channels in ETSI domains
In non-ETSI regulatory domains scan is blocked when operating channel
is a DFS channel. For ETSI, however, once DFS channel is marked as
available after the CAC, this channel will remain available (for some
time) even after leaving this channel.

Therefore a scan can be done without any impact on the availability
of the DFS channel as no new CAC is required after the scan.

Enable scan in mac80211 in these cases.

Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com>
Link: https://lore.kernel.org/r/1570024728-17284-1-git-send-email-aaron.komisar@tandemg.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
2019-10-09 21:00:02 +02:00
Felix Fietkau 9c033242b1 mac80211: add an improved moving average algorithm to minstrel
Improves rate control responsiveness and performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-10-08 19:34:45 +02:00
David Bauer 97c37f8dd0 mac80211: ath10k: fix latency issue for QCA988x
This backport fixes high latency (>100ms) on the WiFi link when using a
QCA988x Wave 1 radio. The ath10k-ct driver is not affected by this bug
from my testing, hence why it hasn't been discovered earlier.

Signed-off-by: David Bauer <mail@david-bauer.net>
2019-10-06 21:28:49 +02:00
Daniel Golle 0714a11bee mac80211: rt2x00: backport 'rt2x00: initialize last_reset'
https://patchwork.kernel.org/patch/11161981/
--
From: Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [PATCH] rt2x00: initialize last_reset

Initialize last_reset variable to INITIAL_JIFFIES, otherwise it is not
possible to test H/W reset for first 5 minutes of system run.

Fixes: e403fa31ed71 ("rt2x00: add restart hw")
Reported-and-tested-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
--

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-10-01 15:54:53 +02:00