summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2016-05-09 13:55:24 +0530
committerJohn Stultz <john.stultz@linaro.org>2016-05-10 11:27:41 -0700
commit3549c34a7144e82f4dac5d186e5f911a55f40a7f (patch)
tree957913b36fc2bfe1a00f33b52173e16b317d9f44
parent5e924d3657b394ecaebd37e2df86b475b88801e8 (diff)
downloadflo-3549c34a7144e82f4dac5d186e5f911a55f40a7f.tar.gz
flo: Enable USB tethering (rndis) support
Enable USB tethering on Flo with WiFi (wlan0) interface. Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--init.flo.rc10
-rw-r--r--init.flo.usb.rc8
-rw-r--r--overlay/frameworks/base/core/res/res/values/config.xml23
3 files changed, 41 insertions, 0 deletions
diff --git a/init.flo.rc b/init.flo.rc
index 9b839e1..757c900 100644
--- a/init.flo.rc
+++ b/init.flo.rc
@@ -356,6 +356,11 @@ service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
disabled
oneshot
+service dhcpcd_usb0 /system/bin/dhcpcd -dABKL
+ group dhcp
+ disabled
+ oneshot
+
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
@@ -366,6 +371,11 @@ service iprenew_bt-pan /system/bin/dhcpcd -n
disabled
oneshot
+service iprenew_usb0 /system/bin/dhcpcd -n
+ class main
+ disabled
+ oneshot
+
on property:ro.data.large_tcp_window_size=true
# Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
write /proc/sys/net/ipv4/tcp_adv_win_scale 1
diff --git a/init.flo.usb.rc b/init.flo.usb.rc
index 9213d84..184ee5e 100644
--- a/init.flo.usb.rc
+++ b/init.flo.usb.rc
@@ -13,6 +13,8 @@ on boot
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
+ mkdir /config/usb_gadget/g1/functions/rndis.gs4
+ write /config/usb_gadget/g1/functions/rndis.gs4/wceis 1
mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
@@ -40,6 +42,12 @@ on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/idProduct 0x4EE2
+on property:sys.usb.config=rndis && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idProduct 0x4EE3
+
+on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idProduct 0x4EE4
+
on property:sys.usb.config=ptp && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/ptp.gs1/os_desc/interface.MTP/compatible_id "PTP"
write /config/usb_gadget/g1/os_desc/use 1
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 776fffe..0c812c2 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -229,4 +229,27 @@
The default is false. -->
<bool name="config_lidControlsSleep">true</bool>
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
+ Wifi interfaces. If the device doesn't want to support tethering over Wifi this
+ should be empty. An example would be "softap.*" -->
+ <string-array translatable="false" name="config_tether_wifi_regexs">
+ <item>"wlan0"</item>
+ <item>"softap.*"</item>
+ </string-array>
+
+ <!-- List of regexpressions describing the interface (if any) that represent tetherable
+ USB interfaces. If the device doesn't want to support tethering over USB this should
+ be empty. An example would be "usb.*" -->
+ <string-array translatable="false" name="config_tether_usb_regexs">
+ <item>"usb\\d"</item>
+ <item>"rndis\\d"</item>
+ </string-array>
+
+ <!-- Array of allowable ConnectivityManager network types for tethering -->
+ <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
+ [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
+ <integer-array translatable="false" name="config_tether_upstream_types">
+ <item>1</item>
+ </integer-array>
+
</resources>