hostapd.interfaces and hostapd.bss were null until the first call that
adds, removes or renames an interface. The first config of a phy calls
iface_reload_links(), which reads hostapd.interfaces[name] outside a
try block, so the config failed with "left-hand side expression is
null" and the phy did not come up.
Fill both objects before hostapd.uc runs, as wpa_supplicant does for
wpas.interfaces.
Fixes: 21b47bd63f ("hostapd: announce the removal of an MLD link before a radio restart")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
A regression in #21078 caused ip_tables.ko and x_tables.ko to be installed
by both kmod-nf-ipt and kmod-iptables, which results in build errors with
linux-6.18:
* check_data_file_clashes: Package kmod-nf-ipt wants to install file .../ip_tables.ko
But that file is already provided by package * kmod-iptables
* check_data_file_clashes: Package kmod-nf-ipt wants to install file .../x_tables.ko
Fix: drop kmod-iptables and move its flags:
- CONFIG_IP_NF_IPTABLES_LEGACY -> kmod-nf-ipt
- CONFIG_NETFILTER_XTABLES_LEGACY -> kmod-nf-ipt
- CONFIG_IP6_NF_IPTABLES_LEGACY -> kmod-nf-ipt6
- CONFIG_BRIDGE_NF_EBTABLES_LEGACY -> kmod-ebtables
Also drop CONFIG_NETFILTER_XTABLES, because it is already present in
KCONFIG_NF_IPT.
Fixes: 94c7f4a25f ("packages: 6.18: update modules files")
Fixes: https://github.com/openwrt/openwrt/issues/23630
Link: https://github.com/openwrt/openwrt/pull/21078
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23631
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add two pending fixes:
- mt76x0 and mt76x2 never requeue mac_work after a channel change, so
frames with lost TX status reports are never timed out. Their AQL
airtime and socket memory stay held, stalling senders for up to 30 s.
- At SuperSpeed the MT7612U wedges its bulk OUT path on TX frames
longer than 3072 bytes, which A-MSDUs of two full-size subframes
reach. Cap the A-MSDU length in that case.
Link: https://github.com/openwrt/mt76/issues/405
Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26147
Signed-off-by: Robert Marko <robimarko@gmail.com>
Host builds install libtool archives into staging_dir/host/lib, and
libssl.la, libtls.la, libgmpxx.la, libmpfr.la, libmpc.la and libisl.la
name their dependencies by absolute path in dependency_libs. A prebuilt
staging_dir/host used from another directory, as with scripts/ext-tools.sh
or the tools container in the CI of a fork, then fails to link any tool
that is rebuilt against them:
libtool: error: '/__w/openwrt/openwrt/openwrt/staging_dir/host/lib/libcrypto.la' is not a valid libtool archive
The .la files are now deleted after each host install, as they already
are for target staging. Consumers link through -L/-l and pkg-config.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Signed-off-by: Nick Hainke <vincent@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/25361
Signed-off-by: Robert Marko <robimarko@gmail.com>
c80f1f239926 tests: drop the helper chains that fw4 no longer emits
135420c4b039 fw4: add the npt target to nat sections
384d1a9a2f41 fw4: honour negated protocol matches in rules
e6f600c458bd Revert "fw4: list lower devices for software flow offloading"
Fixes: https://github.com/openwrt/firewall4/issues/114
Signed-off-by: Robert Marko <robimarko@gmail.com>
Bump libffi from 3.4.7 to 3.8.0 and backport fixes for complex type
handling and big-endian closure returns.
All patches are upstream commits. Patches 001-004 predate the complex
type work: they fix big-endian sub-word argument offsets in ARM
closures, handle page size lookup failure in closures, and correct
_Complex long double on powerpc64 where long double is 64 bits or
follows the ABI's long double layout.
Patches 005-022 are, in upstream merge order, the complex type fixes
that landed after the 3.8.0 release across x86, powerpc64, powerpc,
mips, riscv, loongarch and arm, together with the testsuite coverage
that exercises them.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The filogic 04_set_netdev_label preinit script renames interfaces
through netdev_name_set() with a plain "ip link set <netdev> name
<label>". The kernel refuses to rename an interface to a name that is
already in use (-EEXIST), and the result is not checked, so the rename
silently does not happen.
This breaks whenever the requested name is currently held by another
interface, most notably when two interfaces have to swap names, e.g.
because their probe order is not deterministic. Swapping them needs
an intermediate name, as each rename asks for the name the other
interface still holds.
Rename in two phases instead, like the other targets already do:
1. park: move every interface that needs a new name to a temporary
name ("tmp%d"), which the kernel expands to the lowest free
"tmpN"
2. rename: give each parked interface its final name
After the first phase none of the affected interfaces holds its old
name any more, so the target names are free in the second phase and
the result no longer depends on the order in which /sys/class/net is
walked. The label is read again in the second phase, which works
because the of_node of an interface follows it across renames. Letting
the kernel pick the temporary name means it cannot collide with an
existing interface and always fits in IFNAMSIZ, regardless of the
label length.
Unlike the other targets, filogic does the renaming in
netdev_name_set() from /lib/functions/netdev-name.sh, which is shared
with the preinit_netdev event handler that renames a single interface.
Add an optional "phase" argument to it: when it is "park" the
interface is moved to "tmp%d" instead of its label. The event handler
does not pass it and keeps renaming straight to the final name, as a
hotplugged interface cannot be parked together with the others.
Interfaces that already have the requested name are left alone in both
phases, so nothing changes (and nothing shows up in the boot log) when
the names are already correct. An interface that has to be renamed now
takes two renames at boot instead of one.
This does not help if the requested name is held by an interface that
has no label of its own, as there is nobody to move it out of the way.
Link: https://github.com/openwrt/openwrt/pull/25460
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/26278
Signed-off-by: Robert Marko <robimarko@gmail.com>
Read the username and password from a file to avoid exposing the
password in the `ujail` command line.
pppd parses options files itself, so backslash and double quote in
the username and password are escaped with a backslash when the file
is written. Values passed on the command line are not parsed and
needed no escaping.
Use `net-init-script` to delete the temporary file after `pppd` has
read its options, and unconditionally delete it when the interface
is brought down.
Fixes: b855f33ea9 ("ppp: run pppd in ujail as an unprivileged user")
Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/26293
Signed-off-by: Robert Marko <robimarko@gmail.com>
A management agent of a wired 802.1x supplicant needs the PAE state,
the port status, the timers and the dot1xSupp counters (IEEE 802.1X
MIB). The new method eapol_status of wpa_supplicant.<ifname> returns
them from STATUS-VERBOSE and MIB, together with the EAP successes and
failures counted from the control events. eapol_reset clears the two
counts.
A wired interface has no PHY, so it no longer goes to hostapd
apsta_state, which only logged "no PHY for ifname".
Signed-off-by: John Crispin <john@phrozen.org>
The gpio0 bank (ports A-D) of the RTL9607C has two extra registers
at 0x3338 and 0x333c that select which CPU an interrupt is delivered
to. They reset to zero, so the interrupts of this bank never reach a
CPU. gpio1 and gpio2 have no such registers.
This is the same layout as on the RTL930x, so use the rtl9300-gpio
compatible for gpio0, which makes the driver set the registers, and
pass their address as the second reg entry like rtl930x.dtsi does.
Tested on the Buffalo WSR-1500AX2S, which has its reset button and
mode switch on gpio0: with gpio-keys they now generate interrupts
and events. The WPS button on gpio1 worked before and still does.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Taiga Ogawa <zectaiga@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26258
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The root-complex memory windows registered by octeon_pcie_setup()
span 64 bits of bus address (mem_resource covers 4GB-256MB up to
mem_base + 2^36), so the PCI core places 64-bit BARs above 4GB. On
a CN7030 board with two QCA9984 wifi chips each BAR0 landed at bus
address 0x100000000 -- low half 0x00000000, high half 0x1.
That placement is fatal for endpoints whose inbound memory window is
32-bit internally even though their PCIe config space advertises a
64-bit BAR. The QCA9984 routes inbound memory requests through a
32-bit CORE_CTRL/BAR0-start register (see the "target writes BAR to
CORE_CTRL" comment in the ath10k driver), and after the chip's
SOC_GLOBAL_RESET -- which ath10k issues unconditionally during
probe -- its boot ROM re-establishes that window from the low half
of the BAR only. The chip then stops decoding the address the host
maps it at, while config space keeps working: setpci shows the full
BAR and command register intact, but every MMIO read is a failed
completion (devmem of the hardwired chip ID at BAR0+0xec returns
0xffffffff) and ath10k times out waiting for the firmware indicator
forever:
ath10k_pci 0000:01:00.0: failed to receive initialized event from target: 00000000
ath10k_pci 0000:01:00.0: failed to wait for target after cold reset: -145
The vendor SDK kernel avoids this by keeping the bootloader's 32-bit
BAR assignment (0xe0000000). Cap the controller memory windows at
the end of 32-bit bus address space so every device BAR is placed
where 32-bit-only endpoints can decode it. The window start already
sits at 4GB-256MB -- the x86 "big BAR" convention this code
emulates -- so each port keeps 256MB of device address space, ample
for the wifi and switch cards these SoCs ship with, and matching
what x86 BIOSes do by default. Device DMA (inbound) is unaffected:
it is translated by the BAR2 window, not by these resources.
Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26272
Signed-off-by: Robert Marko <robimarko@gmail.com>
arch/mips/pci/pcie-octeon.c was ported from the Cavium SDK cvmx-pcie.c,
but the OCTEON_IS_OCTEON3() branches of the port reset sequence were
dropped: __cvmx_pcie_rc_initialize_gen2() unconditionally pulses
CIU_SOFT_PRST/CIU_SOFT_PRST1 and checks MIO_RST_CTLX. Those are Octeon II
blocks; on Octeon III (CN7xxx) they are unclaimed -- reads return garbage
and writes are silently dropped. The kernel therefore never resets the
PEM port, never drives PERST# to the endpoint, and never clears a
SOFT_PRST that the RST block has latched.
On Octeon III the per-port reset logic lives in the RST block:
RST_SOFT_PRSTX[n] requests a port reset and RST_CTLX[n] configures the
reset behavior and reports status. RST_CTLX[PRST_LINK] controls whether
a link-down or hot-reset from the endpoint asserts SOFT_PRST, and
RST_CTLX[RST_LINK] whether it warm-resets the whole chip. If PRST_LINK
is left set (it survives a soft reset, so whatever the bootloader or a
previous warm boot left behind persists), an endpoint that resets its
own PCIe link kills the PEM: SOFT_PRST latches, every PEM register then
reads zero, the link never retrains, and the port stays dead until the
next reboot. Observed on a CN7030 board with two QCA9984 wifi chips,
whose driver (ath10k qca99x0) issues SOC_GLOBAL_RESET -- "put target,
including PCIe, into reset" -- during probe:
ath10k_pci 0000:01:00.0: failed to receive initialized event from
target: 00000000
ath10k_pci 0000:01:00.0: failed to wait for target after cold reset:
-145
Program RST_CTLX for root-complex operation (clear PRST_LINK/RST_LINK,
drive PERST#, do not sample it, do not chain to a chip warm reset -- the
same values the SDK programs in __setup_pem_reset()) and route the port
reset pulse, the host-mode check and the rst_done wait through the RST
block on Octeon III, mirroring the SDK. The Octeon II path is unchanged.
Since the port reset now actually reaches the endpoint on Octeon III,
also add the SDK's post-reset device boot allowance: PCIe endpoints
that load firmware from a serial flash (such as the QCA99xx) can take
up to 900ms after PERST# before they answer configuration requests,
longer than the hardware cfg_rtry window covers.
While there, fix the PEMX_BIST_STATUS2 read in gen2 init: the register
does not exist on CN73XX/CN78XX, and on CN70XX it lives at block offset
0x440, not 0x420 (0x420 is PEMX_ON on CN70XX). Reading the generic
address on CN70XX reports pemon|pemoor as a bogus "BIST2 FAILED (0x3)"
on every boot.
Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26272
Signed-off-by: Robert Marko <robimarko@gmail.com>
ieee80211_txq_schedule_start() resets the TXQ scheduling round number
when an AC is over its airtime limit. A txq that was served in an
earlier round with the same number is then skipped in the next round.
The aqm debugfs file also prints fq_overlimit and fq_overmemory
swapped. Both fixes are in wireless-next. Patches 320, 360 and 412 are
refreshed for the new offsets.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
qca-ppe-qos is ipq807x and ipq60xx specific, so depend on those subtargets
instead of just qualcommax target.
Signed-off-by: Robert Marko <robimarko@gmail.com>
The package is limited to qualcommax, but has no nonshared flag.
Target buildbots select nonshared packages through
CONFIG_ALL_NONSHARED, so mark it nonshared. Drop PKGARCH:=all to use
the target package architecture.
Signed-off-by: Robert Marko <robimarko@gmail.com>
For EHT320, device_htmode_append() writes eht_oper_chwidth=7 and
he_oper_chwidth=3. In enum oper_chan_width of hostapd these are 8640 MHz
and 80+80 MHz, not 320 MHz and the 160 MHz that the HE comment asks for.
hostapd replaces both with the width of op_class 137 in
setup_interface2(), so only readers of the config such as hostapd.uc
see the wrong values.
Write 9 (320 MHz) and 2 (160 MHz), the values hostapd sets for op_class
137 in hostapd_set_oper_chwidth(), like mac80211.sh already does for
eht_oper_chwidth.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
scan() took the next NL80211_CMD_NEW_SCAN_RESULTS that nl80211.waitfor()
returned. The ucode nl80211 event socket stays subscribed for the life
of the process, so in a long running caller the results of an earlier
scan, or of a scan on another interface of the wiphy, were already
queued. scan() then returned within milliseconds, dumped the cache
before its own scan had finished, and left that scan running, so a scan
on another radio of a multi-radio wiphy failed with EBUSY.
Drop the queued scan events before the trigger, and wait for the event
of the interface that was scanned.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
switch_channel() takes the width from oper_chwidth and falls back to the
current width of the interface. freq_info() did not return it, so a
config change of the width alone made a channel switch with the old
width and the new centre frequency, which the kernel refuses, and the
radio restarted instead. Return oper_chwidth from freq_info(). start()
reads the same field, so a start with a frequency from wpa_supplicant
now also takes the width of the config, which matches the centre
frequency that freq_info() computes for it.
switch_channel() also returned the result of the last BSS only.
mac80211 does not finalise a channel switch that only part of the BSSes
of a radio take part in, so stop at the first BSS that fails and let the
caller restart the radio.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
mac80211 refuses to bring up an interface while any interface of the
wiphy is in a channel switch (ieee80211_check_concurrent_iface()), and
cfg80211 runs one scan per wiphy. On a multi-radio wiphy such as the
mt7996, the radios share both limits:
- A config change that switches the channel of one radio and restarts
another radio failed the restart with EBUSY, and the AP stayed down
until the next config change.
- While ACS ran on one radio, the 20/40 MHz coexistence scan of another
radio got EBUSY each second, and after 15 s hostapd starts that AP at
20 MHz.
Hold a pending interface setup back in steps of 100 ms while another AP
of the same wiphy is in a channel switch, an ACS or a coexistence scan,
for 30 s at most.
Also fix three cases of the config channel switch:
- iface_freq_info() took the oper_chwidth values of hostapd as the
width argument of freq_info() and ignored op_class. The EHT320 config
of wifi-scripts got 320 MHz only because its he_oper_chwidth=3
(80+80 MHz) equals the freq_info() width of 320 MHz. Take the width
from op_class where the config has one, as hostapd does, and map the
oper_chwidth values otherwise. Restart for 80+80 MHz, which
freq_info() lacks.
- A config change of the channel and of a BSS ran the channel switch and
then reloaded the BSS, which stops the BSS during the switch. Restart
instead.
- radio_base() dropped [HT40+] and [HT40-], so a change between HT20 and
HT40 on the same channel was not applied. Keep [HT40] without the sign.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Unplugging an az6007 based DVB-C tuner, such as the TechniSat CableStar
Combo HD CI, while tvheadend uses it floods the log and the USB
disconnect does not complete. The CA thread spins on failed CAM status
polls, drxk keeps retrying I2C transfers on the gone device, and dmxdev
and dvb_ca wait for users that are never woken.
Add v2 of the series submitted upstream to pending-6.12 and
pending-6.18. With it the disconnect completes in about 150 ms and
tvheadend picks the adapter up again when it is plugged back in.
v1 was tested on a Turris 1.x (mpc85xx/p2020) with 6.18, v2 on a Turris
Omnia (mvebu) with the 6.6 backport in Turris OS 9.1.2 and in QEMU with
vidtv on v7.3-rc2. The 6.12 copy, and patch 5 in the 6.18 copy, are
compile tested only.
Link: https://lore.kernel.org/all/20261004100741.71711-1-pepe.schlehofer@gmail.com/
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
d41981561d7f types: keep tostring exceptions pending during stringification
94562341453a vm: invoke standard library functions internally
a357bc0fd001 compiler: add typeof operator and throw statement
0de223bb2e49 vm, debug: show which function I_STCALL invokes
6004c5aad287 lexer: add a raw text skipper to find the end of a bracketed expression
e915e50fa79c compiler: add destructuring declarations and assignments
a250f159019d rtnl: look up the port attributes by the kind of the master
90b756787ff8 rtnl: decode the slave data of a port with the port attributes
f14b11ba2378 rtnl: send the port data of a link without a link kind
961af31de74a tests: ffi: add calls with complex arguments and return values
3f379cd7d5ed ubus: ignore a channel request after the channel was lost
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5e697c3982d7 wifi: mt76: mt7603: validate MCU response length
19901c7f3cc9 wifi: mt76: mt7915: validate MCU response lengths
0720e321afee wifi: mt76: mt7915: validate MURU statistics response
bbb18d7844e9 wifi: mt76: mt7915: validate EEPROM response length
7264a8a110c4 wifi: mt76: mt7915: validate free-block response length
8c534f59b4a9 wifi: mt76: mt7915: validate channel MIB response length
fa6b2367e281 wifi: mt76: mt7915: validate RX rate response length
07f248fe9830 wifi: mt76: mt7915: validate WED TX statistics response
f76151f8d04f wifi: mt76: mt7915: validate RF register response length
0d218afcbddb wifi: mt76: mt76x02: keep A-MSDU subframe buffers at even addresses
558c6aee6891 wifi: mt76: mt76x02: sync the group key PN before a restart
db39c8d4d6d9 wifi: mt76: fix NULL dereference reading napi_threaded in debugfs
6dcc00bb44c5 wifi: mt76: mt7925: deduplicate MLD support code in mt7925_mac_link_sta_add
859b54fabce0 wifi: mt76: mt7925: do not reset WPDMA before stopping NAPI on reset
2bb98336d469 wifi: mt76: mt7996: clamp VHT/HE beamforming NSS
d2712ce4ed84 wifi: mt76: mt7996: clamp EHT beamforming NSS
d973f6ec9a3d wifi: mt76: mt7921: validate MCU response lengths
1618141fbd29 wifi: mt76: mt7921: validate EEPROM response length
1fe8a56213ce wifi: mt76: mt7921: validate TX power response length
759e140bc76a wifi: mt76: mt7921: validate testmode query response
e06a746261e0 wifi: mt76: mt7925: validate MCU response lengths
ae20af438c32 wifi: mt76: mt7925: validate register query response
ad5b05038a34 wifi: mt76: mt7925: validate EEPROM response length
d0a80080eed9 wifi: mt76: mt7925: validate temperature response length
06deecb57b96 wifi: mt76: mt7925: validate TX power response length
a73af3f06db4 wifi: mt76: mt7925: validate radio status response
487aa470cada wifi: mt76: mt792x: bound firmware release-info parsing
a13a2be996e3 wifi: mt76: mt7996: validate MCU response lengths
e0670ce95e40 wifi: mt76: mt7996: validate EEPROM response lengths
8f71d66ad74e wifi: mt76: mt7996: validate free-block response length
90e7c0007d7f wifi: mt76: mt7996: validate channel MIB response length
e1e90bbe363c wifi: mt76: mt7996: validate temperature response length
f99c91725472 wifi: mt76: mt7996: validate RF register response length
8127e3ff88ff wifi: mt76: mt76x02: keep stations registered during watchdog recovery
247c4d987c39 wifi: mt76: honour the more-data flag when releasing buffered frames
f75d4f05974d wifi: mt76: mt76x02: serialise wcid drop mask updates
4af6beb07b88 wifi: mt76: mt76x02: clear the wcid drop mask for all powersave responses
304aa9be68dd wifi: mt76: mt7996: stop radios after add failure
1295868b85d3 wifi: mt76: mt7921: validate CLC event length
04bf44cd2cb5 wifi: mt76: mt7921: validate NIC capability TLV payload lengths
3c0806b4dfae wifi: mt76: mt7925: validate NIC capability TLV lengths
cb8537008b58 wifi: mt76: mt7925: free the MCU event when linearising fails
cd0c5fdf01b3 wifi: mt76: mt7996: validate radar, thermal and WED RRO event lengths
ba86572bd0d4 wifi: mt76: connac: validate the RAM firmware region table
3ecd7e69dbc9 wifi: mt76: mt7996: validate the RAM firmware region table
2871dc0e2b72 wifi: mt76: mt7925: validate CLC firmware regions and records
35d9c038be88 wifi: mt76: connac: validate the ROM patch section table
8356461aee79 wifi: mt76: mt7996: validate the ROM patch section table
d4c9872bbd9c wifi: mt76: mt792x: use mt76_connac2_fw_check()
8a8c857798f5 wifi: mt76: mt7996: add scan dwell time hw cap
451f47376280 wifi: mt76: mt7996: take the link of an 802.3 frame from its station
b4dd3d4f6d27 wifi: mt76: mt7996: do not update beacons while CSA is active
d343a85da6fe wifi: mt76: mt7996: only remove a BMC STA_REC that was added
46ed43b905d5 wifi: mt76: mt7996: pass the puncturing bitmap to the firmware
49892ef42067 wifi: mt76: abort a scan when the chanctx changes
1507666f034f wifi: mt76: set the channel again when the chanctx puncturing changes
ab907b18ddc9 wifi: mt76: mt7996: advertise preamble puncturing support
d55666f37245 wifi: mt76: mt7996: keep scan and ROC links out of the MLD group
fde06f678c30 wifi: mt76: mt7996: factor the vif link teardown out of remove_interface
25dbe41cf7c9 wifi: mt76: mt7996: destroy station links before the MLD group is freed
fecc93e7f1ed wifi: mt76: mt7996: send MLD link operations for an AP MLD only
78084e732159 wifi: mt76: mt7996: set up a vif link again on another radio
1e1ca91c2b70 wifi: mt76: mt7996: describe an MLD peer with the PEER_MLD command
43008928840b wifi: mt76: mt7915: honour the valid flag in efuse block reads
a60235641e8f wifi: mt76: mt7996: skip MLD address translation for encap offload frames
1152058aee06 wifi: mt76: mt7921: honour the valid flag in efuse block reads
2356292ae38f wifi: mt76: mt7915: upload the CSA beacon only once
801f6a53f2f1 wifi: mt76: read the chanctx of a link once
47665de41b5d wifi: mt76: restart the beacon monitor of a link that gets a chanctx again
9c4ada3a37eb wifi: mt76: publish the beacon monitor interval after its timestamp
ba30cf5adb2b wifi: mt76: mt7996: keep rx header translation off while a monitor runs
6611f0126ccd wifi: mt76: mt7996: apply monitor mode again after a full reset
59b149d24e27 wifi: mt76: check the RX PN of an MLD peer once per peer
d8d24d7cbf5d wifi: mt76: mt7996: send no MLD_SETUP when station links only go away
46b67e5b7c49 wifi: mt76: mt7996: keep a unicast management frame on its MLO link
d7e3bee841a5 wifi: mt76: mt7996: pass the default DSCP map to the firmware
6428114db709 wifi: mt76: mt7996: write the TXD of stream classified 802.3 frames
2b926d2d7776 wifi: mt76: mt7996: support SCS and MSCS
7f2f67eebb54 wifi: mt76: mt7996: implement the flow offload flush op
eb9e675d4cfc wifi: mt76: mt7996: implement the flow offload idle op
238538d7d1cf wifi: mt76: answer the flow priority query
f349872e5149 firmware: update mt7990, mt7992 and mt7996 firmware to 202607
0936617dc529 wifi: mt76: mt7996: write the TXD of 802.3 frames with an explicit UP
Signed-off-by: Felix Fietkau <nbd@nbd.name>
iface_rrm() appends ftm_responder to the BSS config with no feature
check, so iface_ftm() only decides about lci and civic. A UCI
ftm_responder=1 thus always reaches hostapd, which then sets the FTM
responder bit of the Extended Capabilities element from the config
alone, also where the driver has no FTM responder.
Leave ftm_responder to iface_ftm(), which writes it, lci and civic
where the phy sets NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER, as
hostapd.sh does.
Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
hostapd.uc tests NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER as bit 33 and
NL80211_EXT_FEATURE_RADAR_BACKGROUND as bit 61. In nl80211.h they are
32 and 60; bits 33 and 61 are AIRTIME_FAIRNESS and
POWERED_ADDR_CHANGE. The values had no effect until commit
28c6f5e6f7 ("wifi-scripts: fix extended-feature bit test").
Since then mt76 radios, which set AIRTIME_FAIRNESS, read as FTM
responders, and mac80211_hwsim, which has an FTM responder, does not.
Every mac80211 radio sets POWERED_ADDR_CHANGE, so every 5 GHz radio
reads as capable of background radar.
Use the values of nl80211.h.
Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
With hw_rro on WED v3, the WLAN chip reorders RX frames, and WED takes
them from the RRO rings into the RRO ingress of the route QM. The RROQM,
whose MIOD and feedback rings serve the WO firmware, and the legacy
ingress of the route QM (IGRS1) are still configured as for WED v2.
Add pending patch 794, based on the MediaTek SDK patch "add wedv3
support RROQM bypass WO", which sets the RROQM bypass and forces the
destination of IGRS1. Apply it only when hw_rro is used: without
hw_rro, for example with mt7915 on WED v3, RX reordering still goes
through the WO firmware and the RROQM. Refresh 797-01, 797-02, 798 and
799, whose hunks the patch shifts.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Add the four mtk_wed patches that Zhi-Jun You sent to netdev as v6 on
2026-10-26:
- skip the generic ring reset of the WDMA TX rings on WED v3, whose
descriptors have a different size and initial values;
- reset the CPU index of the WDMA RX rings that are set up, instead of
the ones that are not;
- free the RX rings and the WDMA TX rings on detach;
- set up WDMA_RING_TX(0) for WED RX on a non-DBDC MT7986.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtk_wed_wo_queue_refill() maps a WO receive buffer with q->buf_size, but
mtk_wed_wo_dequeue() unmaps it with SKB_WITH_OVERHEAD(q->buf_size).
Backport upstream commit ff5a2a7acec1 ("net: ethernet: mtk_wed: Fix
dma_unmap_single() size") from net, which unmaps the buffer with the
size it was mapped with.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
hapd_drv_send_action() sends the action frames that IEEE Std
802.11be-2024, 35.3.14 makes link-agnostic (Robust AV Streaming SCS and
MSCS, WNM BSS Transition Management and WNM Sleep Mode) with link ID -1
to every station of an AP MLD. For a station that is not a non-AP MLD,
the SA and the BSSID are the link address of the BSS, and
cfg80211_mlme_mgmt_tx() refuses the frame with -EINVAL where that
address is not the address of the interface. A non-MLO station on such
a link gets no SCS Response and no MSCS Response.
The rule of 35.3.14 holds between an AP MLD and a non-AP MLD only. Add
patch 196, which sends these frames to a non-MLD station of the BSS on
the link of the BSS, as hostapd_drv_sta_disassoc() does with patch 187.
A destination without an entry in the BSS keeps link ID -1. Patches 834
and 853 are refreshed on top of it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtk_wed_attach() refuses a PCIe device in a PCI domain above 1. The
second PCIe interface of the MT7996 on the ASUS ZenWiFi BT8 is on the
controller at 0x11290000, which is domain 2, so it runs without WED
while the first interface runs WED with hw_rro. In that mixed setup the
first interface reports a "Message 001a0002 timeout" about 87 s after
boot, the root port reports a completion timeout (AER CmpltTO), and the
driver restarts the hardware about every 54 s.
Add pending patch 799, which accepts every domain that indexes the three
WED instances of MT7988, like the MediaTek SDK patch "refactor
mtk_wed_attach for support wed2". The second interface then attaches
WED 2, and the BT8 runs without a timeout or a restart. Refresh 944,
whose hunk the patch shifts.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
handle_assoc() keeps a copy of each (Re)Association Request frame in
sta->assoc_frame_taxonomy for the get_sta_ies ubus method, but
ap_free_sta() frees only probe_ie_taxonomy and assoc_ie_taxonomy. Each
freed station that sent a (Re)Association Request thus leaks the copy
of its last request. A request of a station that is still present
frees the previous copy in taxonomy_sta_info_assoc_frame().
Free the copy in ap_free_sta() with the other taxonomy data, and
refresh the later patches whose hunks the two lines shift.
Fixes: 79cd45ddee ("hostapd: add association frame to taxonomy data")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Patch 170 reads hapd->iface->current_mode->vht_capab in
hostapd_eid_ht_operation() and hostapd_eid_vht_operation() without a
check of current_mode. A BSS of driver=none has no hardware modes, so
current_mode stays NULL, and hostapd crashes at the start of such a BSS
with ieee80211n=1 or ieee80211ac=1:
WPA_TRACE: eloop SIGSEGV - START
hostapd_eid_ht_operation() ../src/ap/ieee802_11_ht.c:150
ieee802_11_build_ap_params() ../src/ap/beacon.c:2427
hostapd_setup_bss() ../src/ap/hostapd.c:2566
Take the extended NSS BW capability only from a present mode, like
hostapd_eid_vht_capabilities() already does.
Fixes: adfeda8491 ("hostapd: add fix for dealing with VHT 160 MHz via ext nss bw")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The ubus object of an AP MLD resolves to one link, the MLD's first BSS
or else its first link (hostapd_ubus_mld_hapd()). wps_start arms the
link that its link_id names, but wps_cancel takes no link_id and acts on
the resolved link. With wps_independent, which is the default,
hostapd_wps_cancel() reaches only that BSS, so a push button armed on
another link stays active until its walk time ends.
wps_cancel takes the optional link_id of wps_start and ends the push
button on that link's BSS; NOT_FOUND where the object has no such link.
get_features reports wps_link_cancel, so that a caller can tell a
hostapd that takes the argument from one that ignores it.
Refresh patches 863 and 869, whose ubus.c hunks moved by 11 lines.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Since commit afaa34ccd7 ("base-files: don't modify enabled state of
service on upgrade"), default_postinst() starts every init script of
the package on an upgrade, and leaves out only the enable. With opkg the
prerm stops the service first, so the pair acts as a restart. apk runs
no prerm on an upgrade, and its post-upgrade script calls
default_postinst() with PKG_UPGRADE=1. A reinstall or an upgrade with
apk thus starts a service that the system has disabled and stopped.
On an upgrade, start an init script only where it reports itself
enabled. A fresh install still enables and starts each service, and an
offline root still only enables it.
With opkg, a service that the system has disabled but that was started
by hand now stays stopped after an upgrade, since the prerm stops it
and the postinst no longer starts it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
mld_set_iface_config() sets the present bit for every radio with a
station config for the MLD, also for a radio outside the radios that
mld_set names. The MLD netdev spans only those radios, but such a radio
joins the Add, its frequencies enter the scan list and phy_status of
that radio names the MLD. A later phy_set_state stop of that radio
removes the MLD, and the start skips the radio because it is outside
data.radio_mask, so the MLD stays down although another radio has a
config.
Set the present bit only for a radio of the MLD, as the phy_set_state
start and mld_radios_held() already count only those radios.
Fixes: 9aca8a97d7 ("wpa_supplicant: add MLO client support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
DEAUTHENTICATE and DISASSOCIATE of ff:ff:ff:ff:ff:ff on the control
interface, and ubus del_client of the broadcast address, send the group
addressed frame on one link and then free the stations of that BSS with
hostapd_free_stas(). The frame ends the association of a non-AP MLD on
all its links, but on a link that is not its association link only its
link STA was freed. hostapd kept the associated, authorized STA of the
association link, and the driver kept the station.
Free such a non-AP MLD on all its links, as the BSS stop and deinit of
patches 878 and 879 already do.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
iface_reload_config() gives a kept BSS the temporary name "tmp_" plus
8 hex digits when its new name is still held by another kept BSS. For
each WDS station, the rename also renames the AP_VLAN "<bss>.sta<aid>",
and "tmp_xxxxxxxx.sta1" exceeds IFNAMSIZ. The kernel refuses that
name, the rename back from the temporary name finds no interface, and
the AP_VLAN keeps the old BSS name while its BSS runs under the new
one. hostapd only logs "nl80211: Renaming device ... failed", and the
reload reports success. A reload that adds a BSS in front of a
backhaul BSS, with another kept BSS after it, reaches this.
Use "tmp" plus the BSS index as the temporary name. It is unique
within one reload, and "<tmp>.sta<aid>" fits IFNAMSIZ for every AID up
to 2007.
Fixes: 20c667cc88 ("hostapd: rework reload support and MAC address handling")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
A non-AP MLD sends its EAPOL frames on any of its links, and
ieee802_1x_receive() handles each on the STA of the receiving link. A
link STA has no EAPOL state machine, so the first such frame allocates
a second one there. A reauthentication of the MLD then stalls until a
retransmission takes the link whose state machine waits for it.
Patch 881 hands each EAPOL frame of a non-AP MLD to its association
STA, with the helper of the SCS and MSCS handlers.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
DEAUTHENTICATE and DISASSOCIATE with tx=0 remove the station from the
driver and free its entry on the BSS of the command. The driver removes
a non-AP MLD with all its links, but hostapd kept the STA on the other
links: the link STA after the command on the association link, and the
associated, authorized STA of the association link after the command on
another link. A frame on such a link then found the stale entry, and
the next association could not set up that link.
Free the non-AP MLD on all its links with the new
ap_free_sta_all_links(), which hostapd_free_link_sta_mlds() of patch
878 now uses as well.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
ctrl DISABLE of a link stops it with hostapd_bss_deinit_no_free(): the
driver flush of the link and the broadcast Deauthentication. mac80211
then drops every non-AP MLD that holds the link with all its links, and
the Deauthentication ends the association of such a non-AP MLD on all
its links. hostapd freed only the link STA of a non-AP MLD whose
association link is another link of the AP MLD, and kept it associated
and authorized on that link, so its next association failed.
Share the part of hostapd_bss_stop_ap() (patch 878) that frees such a
non-AP MLD on all its links with hostapd_bss_deinit_no_free().
Signed-off-by: Felix Fietkau <nbd@nbd.name>
iface_channel_switch() hands the channel switch of a station to the AP
side of its radio with the apsta_state call and ignores the result.
hostapd logs a channel switch that the driver refuses only at debug
level, so a refused follow leaves no trace, and the station later loses
its link when the channel context reservation cannot be finalised.
Log the error of the apsta_state call with the interface and the target
frequency.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
uc_wpa_freq_info() derives center_freq1 from the 5 GHz channel block
arithmetic for every band. Below 3000 MHz the u8 channel wraps, so
channel 1 HT40+ gives a centre of 3677 MHz instead of 2422 MHz, and the
secondary channel offset is ignored. cfg80211 refuses such a chandef,
so iface.switch_channel() fails for any 2.4 GHz HT40 AP. Reachable via
the apsta_state handler of hostapd.uc: when the station of the same
radio follows a channel switch of its uplink, the AP does not switch,
and mac80211 cannot finalise the station's channel context reservation
and disconnects it.
Give a 2.4 GHz 40 MHz channel the centre between the primary and the
secondary channel, at the primary +/- 10 MHz (IEEE Std 802.11-2024,
19.3.15.4). center_seg0_idx stays 0 there, as before.
Fixes: 847984c773 ("hostapd: reimplement AP/STA support via ucode")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
json_file_read() returns null for a missing or empty file, but json()
raises for a truncated file or for invalid JSON. A damaged board.json,
wifi_devices.json or iso3166.json thus still fails the import of
iwinfo.uc, `wifi config` in lib/wifi/mac80211.uc and find_phy().
Return null for such a file as well, and warn with its path and the
parse error, so the damaged file stays visible. A handler that netifd
runs passes the warning to the netifd log.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
htmodelist() reads iface.radio.band, but update() sets iface.radio only
for an interface that network.wireless status lists. For any other
interface, for example a monitor added by hand, `iwinfo <if> htmodelist`
raises "left-hand side expression is null". Both htmodelist() and
hwmodelist() also raise where the configured band of the radio has no
entry in the board.json data of its phy.
Give an interface without a radio, without a band or without board.json
modes for that band no HT modes and no hardware modes, as hwmodelist()
already does for an interface without a radio.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
mac80211.uc parses /etc/board.json with json(readfile()) before it
checks for wlan data. Without the file json() rejects the null from
readfile(), and the script dies with a type error in "wifi config".
Take the wlan data from board_wlan(), which gives none for a missing or
empty board.json, so that the script detects no radios and exits 0, as
it already does for a board.json without wlan data.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
iwinfo.uc parses /etc/board.json, /usr/share/wifi_devices.json and
/usr/share/iso3166.json with json(readfile()) at load. Where one of
them is absent, json() rejects the null from readfile(), and the import
of the module fails, so the iwinfo command fails for every interface.
Read the three files with a helper that gives no data for a missing or
empty file, and take board.json through board_wlan(), as find_phy()
does. Without board.json no interface lists HT or hardware modes,
without wifi_devices.json every device is a generic one, and without
iso3166.json the country list holds no names.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
wpa_supplicant marks an MLD start pending at every mld_set, also at one
that changes nothing, and mld_start() does nothing while that mark
stands. netifd sends mld_start only from wireless_config_done(), at the
end of a round that ran a handler. A reload that changes no device
sends an mld_set but runs no handler, so the mark stays until the next
round. A radio that hostapd gives back in that time does not start the
station MLD, and the MLD stays down.
Send mld_start after netifd started the wireless devices of a config
load, if no handler is queued or running at that time. A round that the
same load starts keeps the deferral, because its end sends mld_start as
before. Do not send the netifd.wireless.done event there, since no
round ended.
With the mark cleared after such a load, a later round that sends no
mld_set of its own, such as the network.wireless up call of `wifi up`,
a check_interfaces() round or the restart after a hostapd process
died, would start the MLD radio by radio as hostapd starts each AP.
Send the supplicant mld_set when a handler is queued while no other
handler runs or waits, so that every round defers the MLD start to its
end. That mld_set runs after setup() or teardown() set the device state,
so a raise in it would leave the device in setup or teardown with no
handler. The two previous commits make wpad_update_mlo() and find_phy()
return without a raise for a radio that cannot be resolved.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
find_phy() raises where /sys/class/ieee80211 is absent: lsdir() returns
null, and the path, macaddr and name lookups index the result. It also
raises where /etc/board.json is absent and the path or name lookup reads
it, because json() rejects the null from readfile().
Take a missing ieee80211 class as no phys, and a missing board.json as no
board data, so that find_phy() returns null or the phy that its path
matches. Every caller already handles null and logs it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>