Modifying uci-defaults/network

Hi,

I am developing an AP based on the IPQ50xx development kit. This kit includes 1GE integrated Ethernet PHY and 4 x 1 Gbps GE Ethernet LAN ports based on the S17c switch via the SGMII interface.

The Software User Guide mentions that the kit assigns eth0 using the internal PHY as the WAN interface, and eth1 connected to the switch as the LAN interface (the other 3 ports are not used), shown in the picture below.

When reading the (original) uci-defaults/network file, I see that it is set like this:

ucidef_add_switch "switch0"
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch1" "1" "0"

I am confused here:

  1. Are switch0 and switch1 representing the internal port and S17c switch, respectively?
  2. Does the last line mean that the AP's WAN port will "connect" to port 0 of switch1 and similarly, the LAN port will "connect" to port 1?
  3. And if the above two are correct, why does the user guide say that the WAN interface is connected to the internal PHY (switch0 in this case)?
  4. Besides, the AP that I am developing is required that: DO NOT use the internal PHY and USE all 4 channels of the switch (1 of WAN and 3 of LAN interface). Are my settings below correct?
ucidef_add_switch "switch0"
ucidef_set_interfaces_lan_wan "eth3 eth2 eth1" "eth0"
ucidef_add_switch "switch1" "3 2 1" "0"

Sorry if my questions are too basic, I've searched for information about the uci-defaults setting but nothing really clear about ucidef_*.

Any information is highly appreciated. Thanks!

Any questions you have concerning the SDK should be directed to your partner who provided it to you. All they (and QCA) do is leech off the OpenWrt codebase. OpenWrt itself has no support for IPQ50xx whatsoever.

UCI is documented on the OpenWrt wiki and the functions you are looking at are sourced from scripts in /lib somewhere I believe.

5 Likes