]> git.ipfire.org Git - thirdparty/openwrt.git/commit
ramips: mt7530: compile swconfig code conditionally 24574/head
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Wed, 5 Aug 2026 05:38:51 +0000 (07:38 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Fri, 7 Aug 2026 07:16:10 +0000 (09:16 +0200)
commit224a967ba1139bdab687d54dd60126e57159e52a
tree2699195f9314f058d3b4abd9f6418fb2e51da0d8
parent88fb272f3d03923a0d18b51e52dc2552505ddc02
ramips: mt7530: compile swconfig code conditionally

Wrap all swconfig-specific code in mt7530.c with #if IS_ENABLED(CONFIG_SWCONFIG),
including struct switch_dev, the vlan/port mapping tables and all
switch_dev_ops callbacks. Register access helpers (mt7530_r32/w32), the
PSC/HWTRAP definitions, and the small set of swconfig-only register
macros and MIB tables further up the file remain unconditional - the
latter two are unused-but-harmless when swconfig is disabled and are
left alone to keep the diff focused.

When swconfig is not compiled in, the driver performs only minimal
hardware init (disables MAC learning on all ports, applies the HWTRAP
fixup) and skips switch registration, mirroring the existing behaviour
of the "mediatek,no-swconfig" device tree property. This removes the
need for that property when building DSA-only images. The property is
still honoured whenever CONFIG_SWCONFIG is enabled (built-in or as a module).

A distinct log message is used for the compile-time case, to
distinguish it from the runtime "mediatek,no-swconfig" case in dmesg.
Also switch the existing runtime "swconfig disabled" message from
pr_info() to dev_info(), changing its dmesg prefix from "mt7620: " /
"mt7530: " to the device's own prefix.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24574
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c