aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-10-22 19:04:27 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-11-06 13:17:25 +0100
commitd2b9333ea90ed89069879b4a676211c72c859f9b (patch)
treeef6468a3d5684c4e6656b0357ec170fee0550325 /target/linux/ramips/mt7621/base-files/etc/board.d/02_network
parentf4026ad24d0374bdb8704e8b6ec38e9fd85f5e0e (diff)
downloadupstream-d2b9333ea90ed89069879b4a676211c72c859f9b.tar.gz
upstream-d2b9333ea90ed89069879b4a676211c72c859f9b.tar.bz2
upstream-d2b9333ea90ed89069879b4a676211c72c859f9b.zip
ramips: remove default case for MAC address assignment
So far, MAC address assignment in ramips has contained a default case, which defined wan_mac = eth0 + 1 for _every_ device not having an explicit case there. This is not desirable, as many device supporters will just not care or know about this definition, so another MAC address will be introduced by accident. In some cases the wan_mac is assigned although it is not needed, in other cases even addresses not dedicated to the device will be used (e.g. wan_mac actually is eth0 - 1, but during support nobody cared, so eth0 + 1 is used now, which might actually belong to another device ...). Thus, in this PR the former default case is converted to an explicit case. This one comprises all devices not being accounted for by other cases, reduced by those not having wan at all. The big number of entries for this node might be another indication that many of them wouldn't actually be there if there hadn't been default wan_mac setup. In exchange, the current "do nothing" case can be removed, as it will be the new default case. The devices being put in the newly created explicit case were determined as follows: 1. Create a list of all devices based on the DTS files. 2. Remove all devices already having an explicit entry setting their address. 3. Remove all devices that only have lan set up in the first part of 02_network: mt7620: - alfa-network,tube-e4g - asus,rp-n53 - buffalo,wmr-300 - comfast,cf-wr800n - edimax,ew-7476rpc - edimax,ew-7478ac - elecom,wrh-300cr - hnet,c108 - kimax,u25awf-h1 - kimax,u35wf - kingston,mlw221 - kingston,mlwg2 - microduino,microwrt - netgear,ex2700 - netgear,ex3700 - netgear,wn3000rp-v3 - planex,cs-qr10 - planex,mzk-ex300np - planex,mzk-ex750np - ravpower,wd03 - sercomm,na930 - yukai,bocco - zbtlink,zbt-cpe102 - zte,q7 mt7621: - gnubee,gb-pc1 - gnubee,gb-pc2 - linksys,re6500 - mikrotik,rbm11g - netgear,ex6150 - thunder,timecloud - tplink,re350-v1 - tplink,re650-v1 mt76x8: - alfa-network,awusfree1 - d-team,pbr-d1 - glinet,vixmini - vocore,vocore2-lite - tama,w06 - tplink,tl-mr3020-v3 - tplink,tl-wa801nd-v5 - tplink,tl-wr802n-v4 - tplink,tl-wr902ac-v3 - vocore,vocore2 - widora,neo-16m - widora,neo-32m rt288x: - buffalo,wli-tx4-ag300n - dlink,dap-1522-a1 rt305x: - allnet,all0256n-4m - allnet,all0256n-8m - allnet,all5002 - allnet,all5003 - alphanetworks,asl26555-16m - alphanetworks,asl26555-8m - asus,wl-330n - aximcom,mr-102n - dlink,dcs-930 - easyacc,wizard-8800 - hame,mpr-a2 - hootoo,ht-tm02 - huawei,d105 - intenso,memory2move - planex,mzk-dp150n - rt305x dlink,dcs-930l-b1 - sparklan,wcr-150gn - tenda,3g150b - tenda,3g300m - tenda,w150m - trendnet,tew-638apb-v2 - unbranded,a5-v11 - vocore,vocore-16m - vocore,vocore-8m - wansview,ncs601w - zorlik,zl5900v2 rt3883: - loewe,wmdr-143n - omnima,hpm 4. Put the remaining devices in the new case. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/mt7621/base-files/etc/board.d/02_network')
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/etc/board.d/02_network34
1 files changed, 28 insertions, 6 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 6a0d06577b..f415cd29b8 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -143,6 +143,34 @@ ramips_setup_macs()
local label_mac=""
case $board in
+ adslr,g7|\
+ afoundry,ew1200|\
+ asiarf,ap7621-001|\
+ asiarf,ap7621-nv1|\
+ firefly,firewrt|\
+ gehua,ghl-r-001|\
+ mediatek,ap-mt7621a-v60|\
+ mediatek,mt7621-eval-board|\
+ mikrotik,rb750gr3|\
+ mikrotik,rbm33g|\
+ mqmaker,witi|\
+ mtc,wr1201|\
+ netgear,r6220|\
+ netgear,wndr3700-v5|\
+ storylink,sap-g3200u3|\
+ telco-electronics,x1|\
+ totolink,a7000r|\
+ ubiquiti,edgerouterx|\
+ ubiquiti,edgerouterx-sfp|\
+ unielec,u7621-06-16m|\
+ unielec,u7621-06-64m|\
+ wevo,11acnas|\
+ wevo,w2914ns-v2|\
+ xiaoyu,xy-c5|\
+ xzwifi,creativebox-v1|\
+ zbtlink,zbt-wg2626)
+ wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
+ ;;
asus,rt-ac57u|\
d-team,newifi-d2|\
d-team,pbr-m1|\
@@ -169,9 +197,6 @@ ramips_setup_macs()
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
lan_mac=$wan_mac
;;
- buffalo,wsr-600dhp)
- # This empty case has to be kept for devices without any MAC address adjustments
- ;;
dlink,dir-860l-b1)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
wan_mac=$(mtd_get_mac_ascii factory wanmac)
@@ -220,9 +245,6 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
;;
- *)
- wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
- ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac