Commit Graph

1337 Commits

Author SHA1 Message Date
Christian Marangi
cbf299c86c
mac80211: ath9k: handle error from copy_to_user in read_file_eeprom
Handle error from copy_to_user in read_file_eeprom.
Fix compilarion warning:
/__w/openwrt/openwrt/openwrt/build_dir/target-x86_64-openwrt-linux-musl_musl/linux-x86_64/backports-6.1.24/drivers/net/wireless/ath/ath9k/debug.c: In function 'read_file_eeprom':
/__w/openwrt/openwrt/openwrt/build_dir/target-x86_64-openwrt-linux-musl_musl/linux-x86_64/backports-6.1.24/drivers/net/wireless/ath/ath9k/debug.c:1451:17: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 1451 |                 copy_to_user(user_buf, from, bytes);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:36 +02:00
Robert Marko
15abf8d18b
mac80211: ath11k: sync with ath-next
Synchronize the ath11k backports with the current ath-next tree.

This replaces the 160MHz with the upstreamed one, fixes 6GHz only WIPHY
registration, allows SAR usage on WCN6750 and plenty of REO fixes.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-06 07:15:57 +02:00
Álvaro Fernández Rojas
77d85a1bd3 mac80211: b43: only enable bcma or ssb on bmips
By default both kmod-bcma and kmod-ssb are selected by kmod-b43.
However, only one of both modules is needed for bmips subtargets:
- bcma: bcm6318, bcm6328, bcm6362, bcm63268
- ssb: bcm6358, bcm6368

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:18:36 +02:00
Robert Marko
f7f47b1369
mac80211: ath11k: replace 160MHz fix with upstream pending one
QCA has finally sent a proper fixup for the 160MHz regression upstream,
so lets use the pending fix which also properly sets center frequency 2
in case 80+80 MHz is used.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-04-18 13:59:12 +02:00
Felix Fietkau
e722b667c5 mac80211: update to v6.1.24
Drop patches accepted upstream

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-18 10:43:06 +02:00
Robert Marko
930e702d72
mac80211: ath11k: sync with ath-next
Synchronize the ath11k backports with the current ath-next tree.

This replaces the management TLV pending fix with the upstreamed one,
fixes traffic flooding when AP and monitor modes are used at the same time,
fixes QCN9074 always showing -95 dBm for station RSSI in dumps,
fixes potential crash on boot if spectral scan is enabled due to writing to
unitialized memory and adds 11d scan offloading for WCN6750 and WCN6855.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-04-12 16:06:03 +02:00
Robert Marko
7475321f46 mac80211: ath11k: Remove regulatory intersection
Currently, during initialization ath11k will receive a regulatory event
from the firmware in which it will receive the default regulatory domain
code and accompanying rules list and report those to the kernel.

Then if you try to change the regulatory domain to a different country code
it will do a weird thing in which it will send that to the FW and after
receiving the appropriate regulatory event it will parse the rules.
However, while its parsing there is a weird thing being done, and that is
that new raw rules from FW get intersected with the rules from the default
domain.
This is creating a big issue as the default domain is almost always set to
"US" or just "00" aka world so ath11k will unfairly limit you to the most
restrictive combination of rules based on the default domain and your
desired domain.
For example, in ETSI countries this is causing channels 12 and 13 on 2.4GHz
to not be usable since "US" limits 2.4GHz to 2472MHz instead of 2482MHz
like ETSI countries do.

So, lets do what TIP and even QCA do in their ath11k downstream tree and
completely get rid of the interesection code in ath11k.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-04-11 20:20:18 +02:00
Robert Marko
3188480092
mac80211: ath11k: Fix invalid mgmt rx frame length issue
FW 2.9 uses multiple TLV-s for the RX mgmt even which driver currently does
not support, so import a pending upstream patch to fix that [1].

[1] https://patchwork.kernel.org/project/linux-wireless/patch/20230320133840.30162-1-quic_nmaran@quicinc.com/

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-04-07 11:11:44 +02:00
Robert Marko
da4f7e51f3 mac80211: ath11k: restore 160MHz support
Recent ath11k sync introduced a regression causing 80+80 and 160MHz to
stop being advertised and thus not selectable due to the respective feature
flags being cleared.

So, until we get answers upstream to what was the reasoning behind this and
it gets fixed, lets just remove the flag clearing to reanable 160MHz.

Fixes: 789a0bac35 ("mac80211: ath11k: sync with ath-next")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-04-01 19:30:48 +02:00
Felix Fietkau
d54c91bd9a mac80211, mt76: add fixes for recently discovered security issues
Fixes CVE-2022-47522

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-30 11:40:11 +02:00
Felix Fietkau
3ab670b24e mac80211: fix receiving mesh packets in forwarding=0 networks
When forwarding is set to 0, frames are typically sent with ttl=1.
Move the ttl decrement check below the check for local receive in order to
fix packet drops.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-26 17:19:39 +02:00
Felix Fietkau
9779ee021d mac80211: fix invalid calls to drv_sta_pre_rcu_remove
Potentially fixes some driver data structure corruption issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-24 13:32:51 +01:00
Felix Fietkau
d0a06965e8 mediatek: add kernel code for supporting offloading wlan->eth and wlan->wlan flows
Will be enabled by an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-23 17:54:18 +01:00
Robert Marko
789a0bac35 mac80211: ath11k: sync with ath-next
Synchronize the ath11k backports with the current ath-next tree.

This brings in actually setting the MU-MIMO parameters in HW and 6GHz
regulatory support along with some minor resource handling fixes.

This allows to easily backport further fixes as cherry picking them has
started requiring manual conflict resolution.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-03-20 12:23:11 +01:00
Nick Hainke
d033c3ba87
mac80211: mark patches accepted upstream
Add kernel tags to the patches that got accepted upstream.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-03-19 18:10:36 +01:00
Rosen Penev
d650ca9247 mac80211: enable ATH9K_HWRNG
in kernel 5.17, fcd09c90c3c5254b18ef34e30c57c65d34290a84 integrated it
better with thee random framework.

Gives boot time randomness on supported devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-05 19:13:22 +01:00
Nick Hainke
79c3f8ce24 mac80211: refresh patches
The last mac80211 commits did not refresh the patches.

Refresh:
- ath/402-ath_regd_optional.patch
- ath10k/080-ath10k_thermal_config.patch
- ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
- ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
- rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-03-05 01:32:08 +01:00
Felix Fietkau
f6a7ce2501 mac80211: fix regression in sw a-msdu tx introduced in mesh improvement patches
Fixes: 6262d3eb06 ("mac80211: sync mesh fast xmit patch with upstream requested changes")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-03 11:21:26 +01:00
Felix Fietkau
19817fa3f5 mac80211: add mesh fast-rx support
This helps bring down rx CPU usage by avoiding calls to the rx handlers in
the slow path. Supports forwarding and local rx, including A-MSDU.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-02 14:04:07 +01:00
Felix Fietkau
97a060dce2 mac80211: add patch for allowing the driver to refresh aggregation sessions
Required by a mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-02 11:18:27 +01:00
Felix Fietkau
ee9d706c20 mac80211: backport upstream HE/VHT capability handling changes
Will be required by an mt76 update at some point

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-02 11:17:34 +01:00
Felix Fietkau
6262d3eb06 mac80211: sync mesh fast xmit patch with upstream requested changes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-03-02 11:17:34 +01:00
Felix Fietkau
1272cb0a0d mac80211: fix mesh path discovery based on unicast packets
If a packet has reached its intended destination, it was bumped to the code
that accepts it, without first checking if a mesh_path needs to be created
based on the discovered source.
Fix this by moving the destination address check further down

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-26 23:45:07 +01:00
Felix Fietkau
2f96580c52 mac80211: rework mesh fast xmit implementation
Refactor in order to make use of generic fast xmit functions
Fix issues with mesh SA/DA addressing

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-26 23:45:07 +01:00
Felix Fietkau
1d82a47b49 mac80211: fix mesh fast xmit header cache flush
split into multiple functions depending on sta, mpath or mpp

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-26 08:13:44 +01:00
Robert Marko
524704e677
mac80211: ath11k: sync with ath-next
Synchronize the ath11k backports with the current ath-next tree.

This backports several memory leak issues, PCI IRQ fixup, peer add locking
fix as well as IPQ5018 support, though IPQ5018 support is unused for now.

This allows to easily backport further fixes as cherry picking them has
started requiring manual conflict resolution.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-02-22 10:31:48 +01:00
Felix Fietkau
57db2280a2 mac80211: fix mesh issues and improve performance
fix forwarding received mesh a-msdu packets
add fast xmit support for mesh to improve performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-20 12:59:51 +01:00
Felix Fietkau
ec33a6ca2c mac80211: add fixes for receiving A-MSDU packets on mesh interfaces
The standard defines the A-MSDU header length field differently for mesh
compared to other modes. Deal with this accordingly and work around broken
implementations (e.g. ath10k, ath11k).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-13 11:45:43 +01:00
Felix Fietkau
908397f6d2 mac80211: backport napi_build_skb for 5.10
It is needed for an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-01-29 10:08:21 +01:00
David Bauer
a63430eac3 mac80211: use 802.11ax iw modes
This adds missing HE modes to mac80211_prepare_ht_modes.

Previously mesh without wpa_supplicant would be initialized with 802.11g
/NO-HT only, as this method did not parse channel bandwidth for HE
operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-01-28 13:53:39 +01:00
Robert Marko
35f28f2838 mac80211: add ath11k AHB support
This is the follow up to the PCI support commit now providing support for
AHB variant as well, though currently only for ipq807x as that is only
OpenWrt supported SoC ath11k supports as well.

Currently, we are disabling coldboot calibration on ipq807x as it does not
work, there is a remoteproc bug that makes it come late out of reset so
disable coldboot until that is fixed.

Also, as ath11k is quite memory hungry, we are introducing a config option
to use the limits for 512MB of RAM, similar to what QCA does downstream but
in way simpler and cleaner way so that 512MB save some RAM.
512MB profile is also set as the default for now.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko
4f592fb819 mac80211: ath11k: hack for multiple card support
This is a temporary workaround for supporting multiple cards or AHB+PCI.

There is ongoing upstream work to properly support this based of
advertised FW features, but that is still ongoing.

This is only supported on QCN9074 cards due to FW limitation, so HW ID
is checked in order to prevent breaking QCA6390 and other popular cards.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko
c83dbcdf8f
mac80211: ath11k: fix monitor bringup
Currently, ath11k will crash the crash if we try to bringup the monitor
mode interface.
Luckily, it has already been fixed upstream, so backport the patches
fixing it.

Fixes: 93ae4353cd ("mac80211: add ath11k PCI support")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-12 15:17:18 +01:00
Felix Fietkau
12fdb4c9f4 mac80211: fix receiving multicast packets on multiple sta interfaces
Also fix MLO sta sdata link initialization

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-30 21:20:04 +01:00
Hauke Mehrtens
cb7d662dac mac80211: Do not build brcmsmac on bcm47xx_legacy
brcmsmac needs bcma. bcma is build into the kernel for the other bcm47xx
subtargets, but not for the legacy target because it only uses ssb. We
could build bcma as a module for bcm47xx_legacy, but none of these old
devices uses a wifi card supported by brcsmac.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-24 15:14:58 +01:00
Robert Marko
93ae4353cd
mac80211: add ath11k PCI support
ath11k is the upstream driver for Qualcomm 802.11ax radios, both for the
internal AHB and PCI based cards.
This commit does however only provide PCI support while AHB will follow
but its SoC specific so it will require an OpenWrt target first.

It differs a bit from ath10k as it requires stuff like QRTR, MHI and QMI
helpers.

PCI variant requires qrtr-mhi and mhi-bus which backports do provide,
however we are dropping those in a patch as they will conflict with
support for the AHB variant as that one requires qrtr-smd which in turn
requires RPMSG and GLINK and its not feasable to provide those in
backports as they are really SoC specific.

QRTR and MHI in kernel 5.10 are not usable and backporting the changes
is not easy as they have changed drastically from 5.10 to 5.15 ath11k will
only be available on targets that use kernel 5.15.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-12-19 01:01:57 +01:00
Felix Fietkau
d07d47d0e3 mac80211: fix a regression in processing management frames for AP VLAN interfaces
Fixes re-assoc of WDS stations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-16 14:32:47 +01:00
Felix Fietkau
133a1e2f37 mac80211: work around a race condition on detecting a phy while bringing it up
When reloading modules and running wifi, a phy can sometimes be renamed
while in the middle of a hotplug call that tries to detect new phys
This can lead to bogus wifi-device sections being created

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-16 14:32:47 +01:00
Felix Fietkau
92acd9f3e8 mac80211: fix uninitialized variable in rx->link/link_sta initialization fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-16 14:32:47 +01:00
Felix Fietkau
b7a7a97037 mac80211: fix connecting multiple wds stations to an AP
A faulty check prevented the AP_VLAN interfaces from being brought up

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-14 13:54:02 +01:00
Felix Fietkau
a4339c5a21 mac80211: add a fix for a crash in __ieee80211_rx_h_amsdu
Fix initialization of rx->link_sta

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-13 21:14:43 +01:00
Andre Heider
7c63295bf4 treewide: remove DRIVER_11N_SUPPORT
hostapd's compile time option CONFIG_IEEE80211N was removed almost 3 years
ago, 80.211n/HT is always included since then.

Noticed because `hostapd -v11n` confusingly returned an error.

See hostapd's commit:
f3bcd69603 "Remove CONFIG_IEEE80211N build option"

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-13 10:54:50 +01:00
Felix Fietkau
e046500fe9 ath9k: add missing dependency on random core
Reported-by: Hartmut Birr <e9hack@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-13 10:25:27 +01:00
Felix Fietkau
8d90b9fef1 mac80211: update to linux 6.1-rc8
This should help stay in sync with upstream development

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-10 15:15:19 +01:00
Felix Fietkau
a797f0e82a hostapd: use wpa_supplicant for unencrypted mesh connections
It's more reliable than using iw

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-12-10 12:38:46 +01:00
Hauke Mehrtens
077622a198 mac80211: Update to version 5.15.81
The removed patches were applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-12-03 18:32:19 +01:00
Nick Hainke
6640c788fe mac80211: subsys: complete patch files for use with git am
Adding proper fields to patch files allowing for `git am` to properly
function.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-11-27 13:18:29 +01:00
Felix Fietkau
161b22d103 mac80211: fix mesh airtime link metric estimation
fix reading the per-packet rate on devices with firmware rate control

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-10 14:47:07 +01:00
Felix Fietkau
a06e023b4e mac80211: remove old legacy legacy drivers
Get rid of drivers that are either limited to 802.11b/g or don't even support
cfg80211/mac80211. Most of these are either limited to boards that we don't even
support anymore because of firmware size, or were only used for custom hacks by
a really small number of users in the past.
Let's get rid of those to reduce the maintenance effort and the number of useless
packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 20:44:28 +01:00
Nick Hainke
2426dbb734
mac80211: subsys: add tags to upstreamed patches
Some patches were already upstreamed.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-11-09 17:10:03 +01:00