summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/usbinit/usbinit/usb-gether
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/usbinit/usbinit/usb-gether')
-rwxr-xr-xmeta/recipes-bsp/usbinit/usbinit/usb-gether23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/recipes-bsp/usbinit/usbinit/usb-gether b/meta/recipes-bsp/usbinit/usbinit/usb-gether
new file mode 100755
index 0000000000..e80a0bb30e
--- /dev/null
+++ b/meta/recipes-bsp/usbinit/usbinit/usb-gether
@@ -0,0 +1,23 @@
+#! /bin/sh
+#
+# usb-ether Start up the gadget usb ethernet interface.
+#
+
+case "$1" in
+ start|"")
+ test "$VERBOSE" != no && echo "Initializing g_ether gadget..."
+ modprobe g_ether
+ ifup usb0
+ ;;
+ stop)
+ test "$VERBOSE" != no && echo "Disabling g_ether..."
+ ifdown usb0
+ rmmod g_ether
+ ;;
+ *)
+ echo "Usage: usb-ether {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0