I have this travel-router WavLink (AKA WinStar) WL-WN575A3. It only has two physical ports: WAN and LAN. But luci shows a normal configuration for MediaTek rt305x:
I just checked the commit history and the dts: This was wrong from the very first commit and it has never been fixed.
If you can set up a development environment, we can guide you through fixing it. It doesn't seem hard, you will have to fix two files, if I'm not mistaken:
The DTS needs a proper mediatek,portdisable line and the network setup in 02_network needs to be fixed.
Yes, it seems nobody has paid attention to that detail until now.
I'm already on Ubuntu. Haven't built an OpenWrt image in a while, but nevertheless I think I can help. As you said, it doesn't seems so difficult. Please guide me on the steps and what to modify before building.
Edit your device's dts and add a similar line mediatek,portdisable=. I'm not sure about the value, check this explanation and look through other dts files with mediatek,portdisable set.
Edit the 02_network file for your target. You can see how the ports are defined for your device. You need to modify it according to one of the other device you can find there that only define "lan" and "wan" (and of course "6@eth0").
Once you've got the values correctly (I would start with getting mediatek,portdisable right first), you can submit a PR or send a patch to the Mailing List.
Well, I know the Xiaomi 4C and 4A are based on the same SoC. And here's what they enabled/disabled to make the 4C and 4A three ports be properly recognized. i.e.
As by the explanation provided by @braveheartleo, I suppose the 4C's 111101 means enabling 5 ports, whereas 101001 would only mean 3. Similar to 4A's 101111 -> 101010. That would make sense, but we still need to figure out which ones to disable.
Would the MSB be the WAN port?
Could we do something like that without having to build the image? if Wireless is disabled by default, and if we mess with the ports, I wouldn't like to have opening the device to attempt the serial connection. Better safe than sorry, you know.
Sorry, my bad: I would not flash such a testing build. Always use serial connection and an initramfs image when messing around with firmware.
However, your device could support TFTP recovery, giving you a way back to restore firmware without opening the device. Please read the note in the Wiki indicating hat it's no available for all versions.
wavlink,wl-wn575a3)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
#if the ports aren't reversed, "3:lan" is the right LAN
Additionaly difficulty: It's not clear to me how the gui ports are mapped to the esw ports.
As reference, for the somehow similar 4A, they declared:
+ xiaomi,mir4a-100m)
+ ucidef_add_switch "switch0" \
+ "4:lan:1" "2:lan:2" "0:wan" "6@eth0"
# If we take 101010 (1 meaning enabled) and reverse the ports, perhaps that's the mapping?