ramips: consolidate MAC address cases in 02_network

This just merges some duplicate definitions and consolidates lines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com> [merge duplicated
cases for phicomm k2p]
This commit is contained in:
Adrian Schmutzler 2019-07-11 23:01:05 +02:00 committed by Chuanhong Guo
parent f14a5c3f2f
commit ee5fce887a

View File

@ -518,18 +518,17 @@ ramips_setup_macs()
nexaira,bc2|\ nexaira,bc2|\
petatel,psr-680w|\ petatel,psr-680w|\
skyline,sl-r7205) skyline,sl-r7205)
lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(macaddr_add "$lan_mac" 1) wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
asus,rt-ac57u|\ asus,rt-ac57u|\
phicomm,k2p|\
planex,vr500) planex,vr500)
lan_mac=$(mtd_get_mac_binary factory 57344) lan_mac=$(mtd_get_mac_binary factory 57344)
wan_mac=$(mtd_get_mac_binary factory 57350) wan_mac=$(mtd_get_mac_binary factory 57350)
;; ;;
asus,rt-n56u) asus,rt-n56u)
lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(mtd_get_mac_binary factory 32772) wan_mac=$(mtd_get_mac_binary factory 32772)
;; ;;
belkin,f9k1109v1) belkin,f9k1109v1)
@ -617,13 +616,14 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1) wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
;; ;;
lenovo,newifi-d1) lenovo,newifi-d1)
lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
lan_mac=$(macaddr_add "$lan_mac" 2)
;; ;;
linksys,e1700) linksys,e1700)
wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
;; ;;
mediatek,linkit-smart-7688) mediatek,linkit-smart-7688|\
onion,omega2|\
onion,omega2p)
wan_mac=$(mtd_get_mac_binary factory 4) wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46) lan_mac=$(mtd_get_mac_binary factory 46)
;; ;;
@ -638,35 +638,26 @@ ramips_setup_macs()
lan_mac=$(macaddr_add "$wan_mac" 1) lan_mac=$(macaddr_add "$wan_mac" 1)
;; ;;
ohyeah,oy-0001|\ ohyeah,oy-0001|\
phicomm,k2g) phicomm,k2g|\
skylab,skw92a)
lan_mac=$(mtd_get_mac_binary factory 40) lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46) wan_mac=$(mtd_get_mac_binary factory 46)
;; ;;
onion,omega2|\
onion,omega2p)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46)
;;
phicomm,k2p)
lan_mac=$(mtd_get_mac_binary factory 0xe000)
wan_mac=$(mtd_get_mac_binary factory 0xe006)
;;
poray,m3|\ poray,m3|\
poray,m4-4m|\ poray,m4-4m|\
poray,m4-8m|\ poray,m4-8m|\
poray,x5|\ poray,x5|\
poray,x8) poray,x8)
lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" -2)
lan_mac=$(macaddr_add "$lan_mac" -2)
;; ;;
sitecom,wlr-6000) sitecom,wlr-6000)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
;; ;;
skylab,skw92a) sparklan,wcr-150gn|\
lan_mac=$(mtd_get_mac_binary factory 40) zyxel,keenetic-omni|\
wan_mac=$(mtd_get_mac_binary factory 46) zyxel,keenetic-omni-ii|\
;; zyxel,keenetic-start|\
sparklan,wcr-150gn) zyxel,keenetic-viva)
wan_mac=$(mtd_get_mac_binary factory 40) wan_mac=$(mtd_get_mac_binary factory 40)
;; ;;
tenda,w306r-v2) tenda,w306r-v2)
@ -691,14 +682,6 @@ ramips_setup_macs()
wan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$wan_mac") lan_mac=$(macaddr_setbit_la "$wan_mac")
;; ;;
zyxel,keenetic-omni|\
zyxel,keenetic-omni-ii|\
zyxel,keenetic-viva)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
zyxel,keenetic-start)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
*) *)
lan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1) wan_mac=$(macaddr_add "$lan_mac" 1)