Skip to content

Commit afa17cb

Browse files
committed
WRT3200ACM: reverted to network switch, instead of DSA
WRT3200ACM has switched to DSA, loosing the ability to configure the network switch from LiCI or use port mirroring. The physical ports are exposed as VLANs: lan1, lan2, lan3, lan4, and wan. Custom VLANs can be created, in an obfuscated way lan1.1, lan1.2, etc. This patch reverts the changes mentioned above. Two physical interfaces are exposed: lan, and wan with separate MAC addresses. The ability to create custom VLANs, and mirror ports in LuCI is restored. Signed-off-by: Georgi Valkov <[email protected]>
1 parent c48ca90 commit afa17cb

File tree

6 files changed

+1583
-2
lines changed

6 files changed

+1583
-2
lines changed

package/kernel/linux/modules/netdevices.mk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,21 @@ endef
794794
$(eval $(call KernelPackage,swconfig))
795795

796796

797+
define KernelPackage/switch-mvsw61xx
798+
SUBMENU:=$(NETWORK_DEVICES_MENU)
799+
TITLE:=Marvell 88E61xx switch support
800+
DEPENDS:=+kmod-swconfig
801+
KCONFIG:=CONFIG_MVSW61XX_PHY
802+
FILES:=$(LINUX_DIR)/drivers/net/phy/mvsw61xx.ko
803+
AUTOLOAD:=$(call AutoLoad,42,mvsw61xx)
804+
endef
805+
806+
define KernelPackage/switch-mvsw61xx/description
807+
Marvell 88E61xx switch support
808+
endef
809+
810+
$(eval $(call KernelPackage,switch-mvsw61xx))
811+
797812
define KernelPackage/switch-ip17xx
798813
SUBMENU:=$(NETWORK_DEVICES_MENU)
799814
TITLE:=IC+ IP17XX switch support

target/linux/mvebu/config-6.6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ CONFIG_MVNETA=y
284284
CONFIG_MVNETA_BM=y
285285
CONFIG_MVNETA_BM_ENABLE=y
286286
# CONFIG_MVPP2 is not set
287+
CONFIG_MVSW61XX_PHY=y
287288
CONFIG_MV_XOR=y
288289
CONFIG_NEED_DMA_MAP_STATE=y
289290
CONFIG_NEON=y
@@ -393,6 +394,7 @@ CONFIG_SPI_ORION=y
393394
CONFIG_SRAM=y
394395
CONFIG_SRAM_EXEC=y
395396
CONFIG_SRCU=y
397+
CONFIG_SWCONFIG=y
396398
CONFIG_SWPHY=y
397399
CONFIG_SWP_EMULATE=y
398400
CONFIG_SYS_SUPPORTS_APM_EMULATION=y

target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ mvebu_setup_interfaces()
2727
linksys,wrt1900acs|\
2828
linksys,wrt3200acm|\
2929
linksys,wrt32x)
30-
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
30+
ucidef_set_interfaces_lan_wan "lan.1" "wan.2"
31+
ucidef_add_switch "switch0" \
32+
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@lan" "4:wan" "6@wan"
3133
;;
3234
fortinet,fg-50e|\
3335
fortinet,fg-51e|\
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#
2+
# Copyright (C) 2014-2015 OpenWrt.org
3+
# Copyright (C) 2016 LEDE-Project.org
4+
#
5+
6+
preinit_set_mac_address() {
7+
local mac
8+
9+
. /lib/functions.sh
10+
11+
case $(board_name) in
12+
buffalo,ls421de)
13+
mac=$(mtd_get_mac_ascii u-boot-env eth1addr)
14+
ip link set dev eth0 address $mac 2>/dev/null
15+
;;
16+
linksys,wrt1200ac|linksys,wrt1900ac-v2|linksys,wrt1900acs|linksys,wrt3200acm|linksys,wrt32x)
17+
# rename interfaces back to the way they were with 4.4
18+
case "$(readlink /sys/class/net/eth0)" in
19+
*f1070000*)
20+
ip link set eth0 name wan
21+
ip link set eth1 name lan
22+
;;
23+
*)
24+
ip link set eth0 name lan
25+
ip link set eth1 name wan
26+
;;
27+
esac
28+
29+
mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
30+
mac_wan=$(macaddr_setbit_la "$mac")
31+
ip link set dev lan address $mac 2>/dev/null
32+
ip link set dev wan address $mac_wan 2>/dev/null
33+
;;
34+
linksys,wrt1900ac-v1)
35+
ip link set eth0 name lan
36+
ip link set eth1 name wan
37+
mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
38+
ip link set dev lan address $mac 2>/dev/null
39+
ip link set dev wan address $mac 2>/dev/null
40+
;;
41+
marvell,a385-db-ap|solidrun,clearfog*a1)
42+
# rename interfaces back to the way they were with 4.4
43+
case "$(readlink /sys/class/net/eth0)" in
44+
*f1070000*)
45+
ip link set eth0 name tmp0
46+
ip link set eth1 name eth0
47+
ip link set eth2 name eth1
48+
ip link set tmp0 name eth2
49+
;;
50+
esac
51+
;;
52+
esac
53+
}
54+
55+
boot_hook_add preinit_main preinit_set_mac_address

target/linux/mvebu/image/cortexa9.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ TARGET_DEVICES += kobol_helios4
238238
define Device/linksys
239239
$(Device/NAND-128K)
240240
DEVICE_VENDOR := Linksys
241-
DEVICE_PACKAGES := kmod-mwlwifi wpad-basic-mbedtls
241+
DEVICE_PACKAGES := kmod-mwlwifi swconfig wpad-basic-mbedtls
242242
IMAGES += factory.img
243243
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
244244
append-ubi | pad-to $$$$(PAGESIZE)

0 commit comments

Comments
 (0)