OpenWrt Forum Archive

Topic: configure configurable switches with swconfig

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

In case you want to configure your switch manually, you would use swconfig directly.

Unhurried people continue using the UCI configuration files, UCI will invoke swconfig et al. with the correct parameters for you.

Hi Orca !

Are You sure ?

I suppose that it depends on what version You are using.
In trunk some of configurable options via swconfig will not be available in UCI.

Regards,
Ralph

Wrong. Every option swconfig supports is also settable with uci.

jow wrote:

Wrong. Every option swconfig supports is also settable with uci.

Thank You for clarifying this.

Leading me to another question:
Would UCI also support patched versions e.g. https://dev.openwrt.org/ticket/7977 ?
Does UCI call swconfig with simply passing all parameters to swconfig
or does UCI read the driver's options directly from the driver ?

Regards,
Ralph

Swconfig links libuci and uses uci as native persistent config format.

sagemol wrote:
jow wrote:

Wrong. Every option swconfig supports is also settable with uci.

Thank You for clarifying this.

Leading me to another question:
Would UCI also support patched versions e.g. https://dev.openwrt.org/ticket/7977 ?
Does UCI call swconfig with simply passing all parameters to swconfig
or does UCI read the driver's options directly from the driver ?

Regards,
Ralph

Hi sagemol,
I am also using patched driver of the switch controller (rtl8366rb) and confirm it is working (also via UCI)

root@Core-Sf:~# swconfig dev rtl8366rb port 1 get priority       
0

# Modifying /etc/config/network
....................
config 'switch_port'
        option 'device' 'rtl8366rb'
        option 'port' '1'
        option 'pvid' '1'
        option 'led' '6'
        option 'priority' '7'
...............
root@Core-Sf:~# swconfig dev rtl8366rb load /etc/config/network 
root@Core-Sf:~# swconfig dev rtl8366rb port 1 get priority
7

Thanks to you, for contributing to this patch as well.
BR

jow wrote:

Swconfig links libuci and uses uci as native persistent config format.

Thank You again, that makes sense, now I understand the workflow much better...


dir2cas wrote:

Thanks to you, for contributing to this patch as well.

You're welcome.
Although I did it mainly for my own convenience... :-)

Regards
Ralph

@sagemol,

I asked in another thread, but got no answer, hope that you may know.

Do you know if there is a similar driver enhancement for rtl8366s found in WNDR3700 like the one for rtl8366rb found in 1034ND?

Could someone alter this one to be applicable for rtl8366s or it would not be that easy?

Sorry for late response, been on holiday...

I didn't review the code for the rtl8366s driver, but the driver should be very similar to rtl8366rb,
since the rtl8366rb was created from source of the rtl8366s.
Should not be to much work to make the rtl8366rb-patches available for rtl8366s.
But You'll have to find someone who owns a rtl8366s to do that...

Regards,
Ralph

The discussion might have continued from here.