Patchwork [OpenWrt-Devel] ar71xx: make failsafe for TL-WR720N-v3 work on port labelled as LAN.

login
register
Submitter Yousong Zhou
Date 2013-08-31 08:16:13
Message ID <1377936973-13826-1-git-send-email-yszhou4tech@gmail.com>
Download mbox | patch
Permalink /patch/4021/
State Rejected
Delegated to: Gabor Juhos
Headers show

Comments

Yousong Zhou - 2013-08-31 08:16:13
Failsafe listens on eth0 by default, but due to the order of eth registration
eth0 previously corresponded to the port labelled as WAN. This may cause some
inconvenience since people have to plug the cable out from LAN into WAN when
accessing failsafe mode and then plug back when recovery is done.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
A previous version of this patch [1] has been sent but was not receiving any
response and now can not be applied without conflict.

 [1] http://patchwork.openwrt.org/patch/3765/

 .../ar71xx/base-files/etc/uci-defaults/02_network  |    1 -
 .../files/arch/mips/ath79/mach-tl-wr720n-v3.c      |    2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)
Gabor Juhos - 2013-09-03 13:08:13
2013.08.31. 10:16 keltezéssel, Yousong Zhou írta:
> Failsafe listens on eth0 by default, but due to the order of eth registration
> eth0 previously corresponded to the port labelled as WAN. This may cause some
> inconvenience since people have to plug the cable out from LAN into WAN when
> accessing failsafe mode and then plug back when recovery is done.
> 
> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> ---
> A previous version of this patch [1] has been sent but was not receiving any
> response and now can not be applied without conflict.
> 
>  [1] http://patchwork.openwrt.org/patch/3765/
> 
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |    1 -
>  .../files/arch/mips/ath79/mach-tl-wr720n-v3.c      |    2 +-
>  2 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> index 176c485..482ad6b 100755
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -234,7 +234,6 @@ pb42 |\
>  pb44 |\
>  routerstation|\
>  tl-wr710n |\
> -tl-wr720n-v3|\
>  wpe72)
>  	ucidef_set_interfaces_lan_wan "eth1" "eth0"
>  	;;
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> index 80e8df6..71d18d2 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> @@ -98,8 +98,8 @@ static void __init tl_wr720n_v3_setup(void)
>  	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
>  
>  	ath79_register_mdio(0, 0x0);
> -	ath79_register_eth(0);
>  	ath79_register_eth(1);
> +	ath79_register_eth(0);
>  
>  	ath79_register_wmac(ee, mac);
>  }
> 

Swapping the registration order would cause problems for existing users. If
someone upgrades from a previous version of OpenWrt and keeps the existing
configuration then ethernet will be broken on that board.

This should be resolved in user-space rather than in the kernel.

-Gabor
Yousong Zhou - 2013-09-03 16:32:38
On Tue, Sep 03, 2013 at 03:08:13PM +0200, Gabor Juhos wrote:
> 2013.08.31. 10:16 keltezéssel, Yousong Zhou írta:
> > Failsafe listens on eth0 by default, but due to the order of eth registration
> > eth0 previously corresponded to the port labelled as WAN. This may cause some
> > inconvenience since people have to plug the cable out from LAN into WAN when
> > accessing failsafe mode and then plug back when recovery is done.
> > 
> > Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
> > ---
> > A previous version of this patch [1] has been sent but was not receiving any
> > response and now can not be applied without conflict.
> > 
> >  [1] http://patchwork.openwrt.org/patch/3765/
> > 
> >  .../ar71xx/base-files/etc/uci-defaults/02_network  |    1 -
> >  .../files/arch/mips/ath79/mach-tl-wr720n-v3.c      |    2 +-
> >  2 files changed, 1 insertions(+), 2 deletions(-)
> > 
> > diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > index 176c485..482ad6b 100755
> > --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > @@ -234,7 +234,6 @@ pb42 |\
> >  pb44 |\
> >  routerstation|\
> >  tl-wr710n |\
> > -tl-wr720n-v3|\
> >  wpe72)
> >  	ucidef_set_interfaces_lan_wan "eth1" "eth0"
> >  	;;
> > diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> > index 80e8df6..71d18d2 100644
> > --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> > +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
> > @@ -98,8 +98,8 @@ static void __init tl_wr720n_v3_setup(void)
> >  	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
> >  
> >  	ath79_register_mdio(0, 0x0);
> > -	ath79_register_eth(0);
> >  	ath79_register_eth(1);
> > +	ath79_register_eth(0);
> >  
> >  	ath79_register_wmac(ee, mac);
> >  }
> > 
> 
> Swapping the registration order would cause problems for existing users. If
> someone upgrades from a previous version of OpenWrt and keeps the existing
> configuration then ethernet will be broken on that board.

Hi, Gabor.

TL-WR720N-v3 is only supported in barrier breaker and I thought BB in
trunk is a work-in-progess and not officially released yet, thus should
be available for further polishment.

> 
> This should be resolved in user-space rather than in the kernel.
> 
> -Gabor
>

Patch

diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 176c485..482ad6b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -234,7 +234,6 @@  pb42 |\
 pb44 |\
 routerstation|\
 tl-wr710n |\
-tl-wr720n-v3|\
 wpe72)
 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
 	;;
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
index 80e8df6..71d18d2 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr720n-v3.c
@@ -98,8 +98,8 @@  static void __init tl_wr720n_v3_setup(void)
 	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 2);
 
 	ath79_register_mdio(0, 0x0);
-	ath79_register_eth(0);
 	ath79_register_eth(1);
+	ath79_register_eth(0);
 
 	ath79_register_wmac(ee, mac);
 }