summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2013-07-22 13:39:33 +0000
committerhselasky <hselasky@FreeBSD.org>2013-07-22 13:39:33 +0000
commita29cd39047c52b419d03fcc2f4892bc26b717c38 (patch)
treed1f969f10c69eacc26b5a8cc257249ff4ee67f9e /sys/modules
parent964b11bddf28952ff0ae79c433da9ccf1005dbea (diff)
downloadFreeBSD-src-a29cd39047c52b419d03fcc2f4892bc26b717c38.zip
FreeBSD-src-a29cd39047c52b419d03fcc2f4892bc26b717c38.tar.gz
Add some USB gadget example drivers for USB audio, USB keyboard,
USB mouse and USB modem classes. Hopefully someone will find these examples useful when implementing USB device side drivers using the FreeBSD USB stack.
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/usb/Makefile8
-rw-r--r--sys/modules/usb/g_audio/Makefile35
-rw-r--r--sys/modules/usb/g_keyboard/Makefile35
-rw-r--r--sys/modules/usb/g_modem/Makefile35
-rw-r--r--sys/modules/usb/g_mouse/Makefile35
5 files changed, 148 insertions, 0 deletions
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
index 6f2626fe..aef9acd 100644
--- a/sys/modules/usb/Makefile
+++ b/sys/modules/usb/Makefile
@@ -39,6 +39,14 @@ SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
SUBDIR += uether aue axe cdce cue ${_kue} mos rue smsc udav uhso ipheth
SUBDIR += usfs umass urio
SUBDIR += quirk template
+SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse}
+
+.if ${MK_USB_GADGET_EXAMPLES} == "yes"
+_g_audio= g_audio
+_g_keyboard= g_keyboard
+_g_modem= g_modem
+_g_mouse= g_mouse
+.endif
.if ${MK_SOURCELESS_UCODE} != "no"
_rum= rum
diff --git a/sys/modules/usb/g_audio/Makefile b/sys/modules/usb/g_audio/Makefile
new file mode 100644
index 0000000..7425ade
--- /dev/null
+++ b/sys/modules/usb/g_audio/Makefile
@@ -0,0 +1,35 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${.CURDIR}/../../../dev/usb/gadget
+
+KMOD= g_audio
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ card_if.h opt_usb.h pci_if.h g_audio.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_keyboard/Makefile b/sys/modules/usb/g_keyboard/Makefile
new file mode 100644
index 0000000..302a242
--- /dev/null
+++ b/sys/modules/usb/g_keyboard/Makefile
@@ -0,0 +1,35 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${.CURDIR}/../../../dev/usb/gadget
+
+KMOD= g_keyboard
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ opt_usb.h g_keyboard.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_modem/Makefile b/sys/modules/usb/g_modem/Makefile
new file mode 100644
index 0000000..980849e
--- /dev/null
+++ b/sys/modules/usb/g_modem/Makefile
@@ -0,0 +1,35 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${.CURDIR}/../../../dev/usb/gadget
+
+KMOD= g_modem
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ card_if.h opt_usb.h pci_if.h g_modem.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_mouse/Makefile b/sys/modules/usb/g_mouse/Makefile
new file mode 100644
index 0000000..b6d30de
--- /dev/null
+++ b/sys/modules/usb/g_mouse/Makefile
@@ -0,0 +1,35 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${.CURDIR}/../../../dev/usb/gadget
+
+KMOD= g_mouse
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ opt_usb.h g_mouse.c
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud