aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath25/base-files/lib/preinit
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-09-06 13:57:27 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-09-06 19:49:05 +0200
commit081e944be6684bf5c4ee7c9fa2683d568d5be288 (patch)
tree9f1942be74e4faef66c1fd8dee9b15dcc2b33d87 /target/linux/ath25/base-files/lib/preinit
parent8938711223842facfd9a2a36ca4c589665c2c0ca (diff)
downloadupstream-081e944be6684bf5c4ee7c9fa2683d568d5be288.tar.gz
upstream-081e944be6684bf5c4ee7c9fa2683d568d5be288.tar.bz2
upstream-081e944be6684bf5c4ee7c9fa2683d568d5be288.zip
ath25: add back target support
Discussion on the mailing list reveals that this target has active users. As we are finally able to upgrade this target to kernel 5.4, add it back to master. This reverts commit 7d29a5571403 ("ath25: drop target") and immediately moves the relevant files to 5.4, without touching the content. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ath25/base-files/lib/preinit')
-rw-r--r--target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros b/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros
new file mode 100644
index 0000000000..235ba4befc
--- /dev/null
+++ b/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros
@@ -0,0 +1,34 @@
+# reset button only supported on ar5315+ at the moment
+preinit_ip() {
+ if [ -z "$pi_ifname" ]; then
+ grep -q 'Atheros AR231[567]' /proc/cpuinfo && {
+ if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
+ -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
+ vconfig set_name_type DEV_PLUS_VID_NO_PAD
+ ip link set eth0 up
+ vconfig add eth0 1
+ ifname=eth0.1
+ else
+ ifname=eth0
+ fi
+ pi_ifname=$ifname
+ }
+ fi
+ [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
+ ip addr add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname
+ ip link set $pi_ifname up
+ }
+}
+
+
+# reset button only supported on ar5315+ at the moment
+
+preinit_ip_deconfig() {
+ if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
+ -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
+ vconfig rem eth0.1 2>/dev/null
+ ip link set $pi_ifname down
+ elif [ -n "$pi_ifname" ]; then
+ ip -4 addr flush dev $pi_ifname
+ fi
+}