summaryrefslogtreecommitdiff
path: root/package/ramips/drivers/mt7615e/files/mt7615e.inc
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-09-16 19:55:45 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-09-16 19:55:45 +0200
commitc0ce88c586a467665b35d93c2f6962cac8e8dc27 (patch)
treedf24b1ae76338fa83f45c14f8518720f0266705d /package/ramips/drivers/mt7615e/files/mt7615e.inc
parentffb3f790a5075e5c294420e8348dfe6c429ac921 (diff)
downloadmtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.zip
mtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.tar.gz
mtk-20170518-c0ce88c586a467665b35d93c2f6962cac8e8dc27.tar.bz2
mt7xxx proprietary Wifi drivers integration + mac80211 weird changes
Diffstat (limited to 'package/ramips/drivers/mt7615e/files/mt7615e.inc')
-rwxr-xr-xpackage/ramips/drivers/mt7615e/files/mt7615e.inc45
1 files changed, 45 insertions, 0 deletions
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.inc b/package/ramips/drivers/mt7615e/files/mt7615e.inc
new file mode 100755
index 0000000..783191d
--- /dev/null
+++ b/package/ramips/drivers/mt7615e/files/mt7615e.inc
@@ -0,0 +1,45 @@
+#!/bin/sh
+# this file will be included into mt7615e2.sh and mt7615e5.sh
+
+disable_mt7615e() {
+ cd /sys/class/net/
+
+ # disable apcli interfaces
+ for vif in apcli*; do
+ ifconfig $vif down;
+ done
+ # disable ap interfaces
+ for vif in ra*; do
+ ifconfig $vif down;
+ ubus call network.interface.lan remove_device "{\"name\":\"$vif\"}"
+ done
+
+ cd -
+}
+
+
+enable_mt7615e() {
+ cd /sys/class/net/
+ uci2dat -d mt7615e2 -f /etc/wireless/mt7615e/mt7615e.1.2G.dat > /tmp/uci2dat.log
+ uci2dat -d mt7615e5 -f /etc/wireless/mt7615e/mt7615e.1.5G.dat >> /tmp/uci2dat.log
+
+ ifconfig ra0 up # ra0 is the root vif
+
+ # enable ap interfaces
+ for vif in ra*; do
+ ifconfig $vif up;
+ ubus call network.interface.lan add_device "{\"name\":\"$vif\"}"
+ local tmp=$(brctl show | grep $vif)
+ if [ x"$tmp" == x"" ]
+ then
+ echo "add $vif to br-lan" >> /tmp/wifi.log
+ brctl addif br-lan $vif
+ fi
+ done
+
+ # enable apcli interfaces
+ for vif in apcli*; do
+ ifconfig $vif up;
+ done
+ cd -
+} \ No newline at end of file