Skip to contentSkip to conversation

REV 2 USB virt 2.6 split driver---USB split driver front-end

PATCH New harry 1 participant 1 message Nov 30, 2005

lore
Share & tools
lore

harry

author
#0 lore raw

PATCH 16/17 REV 2 USB virt 2.6 split driver---USB split driver front-end

This patch implements the front end of the USB split driver.

linux-2.6-xen-sparse/arch/xen/Kconfig +24 -0
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/arch/xen/Kconfig
@@ -159,6 +159,30 @@
 	  are unsure; or if you experience network hangs when this option is
 	  enabled; then you must say N here.
 
+config XEN_USBDEV_FRONTEND
+	tristate "USB-device frontend driver"
+	select USB
+	default m
+	help
+	  The USB-device frontend driver allows the kernel to access USB
+	  devices exported by a USB-device backend driver running in another
+	  domain.
+	  This is not required for USB device access in domain 0 or any domain
+	  given exclusive control over a USB host controller device at the PCI
+	  level.
+	  Say Y or M if you want to use a USB-device backend driver to export a
+	  USB device from another domain to the domain which will run this
+	  kernel.
+
+config XEN_USBDEV_FRONTEND_TRACE
+	bool "USB-device frontend driver tracing"
+	depends on XEN_USBDEV_FRONTEND
+	default n
+	help
+	  This option causes the driver to output a continual trace of its
+          activity.
+	  Say N here unless you are trying to debug the driver.
+
 config XEN_BLKDEV_TAP
 	bool "Block device tap driver"
 	default n
linux-2.6-xen-sparse/drivers/xen/Makefile +1 -1
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/drivers/xen/Makefile
@@ -17,4 +17,4 @@
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
 obj-$(CONFIG_XEN_BLKDEV_TAP)    	+= blktap/
 obj-$(CONFIG_XEN_TPMDEV_FRONTEND)	+= tpmfront/
-
+obj-$(CONFIG_XEN_USBDEV_FRONTEND)	+= usbfront/
linux-2.6-xen-sparse/drivers/xen/usbback/usbback_trace.h +1 -1
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/drivers/xen/usbback/usbback_trace.h
@@ -29,7 +29,7 @@
 
 #define trace_info(format, ...) \
 printk(KERN_INFO "usbback %s: " format "\n", __FUNCTION__, ## __VA_ARGS__)
-#define trace() trace_info( "" )
+#define trace() trace_info("")
 
 #else
 
linux-2.6-xen-sparse/drivers/xen/usbfront/Makefile new file +7 -0
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/drivers/xen/usbfront/Makefile
@@ -0,0 +1,7 @@
+obj-$(CONFIG_XEN_USBDEV_FRONTEND) += usbfront.o
+
+usbfront-objs :=  \
+usbfront_hcd_resource.o \
+usbfront_driver.o \
+usbfront_device.o \
+usbfront_module.o
linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_assert.h new file +38 -0
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_assert.h
@@ -0,0 +1,38 @@
+/*****************************************************************************/
+/* An implementation of the ASSERT macro.                                    */
+/*                                                                           */
+/* Copyright (c) 2005 Harry Butterworth IBM Corporation                      */
+/*                                                                           */
+/* This program is free software; you can redistribute it and/or modify it   */
+/* under the terms of the GNU General Public License as published by the     */
+/* Free Software Foundation; either version 2 of the License, or (at your    */
+/* option) any later version.                                                */
+/*                                                                           */
+/* This program is distributed in the hope that it will be useful, but       */
+/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General */
+/* Public License for more details.                                          */
+/*                                                                           */
+/* You should have received a copy of the GNU General Public License along   */
+/* with this program; if not, write to the Free Software Foundation, Inc.,   */
+/* 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                   */
+/*                                                                           */
+/*****************************************************************************/
+
+#ifndef USBFRONT_ASSERT_H
+#define USBFRONT_ASSERT_H
+
+#include <linux/kernel.h>
+
+static inline void
+assert_failed(const char *function, int line, const char *statement)
+{
+	printk(KERN_ERR "usbfront assert failed: %s line %d, statement %s\n",
+	     function, line, statement);
+
+	BUG();
+}
+
+#define ASSERT( S ) ((S)?(void)0:assert_failed(__FUNCTION__, __LINE__, #S))
+
+#endif
linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_device.c new file +969 -0

969 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_device.h new file +92 -0

92 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.c new file +601 -0

601 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.h new file +35 -0
diff -r e95f0d5261d3 -r db396779c07b linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.h
@@ -0,0 +1,35 @@
+/*****************************************************************************/
+/* A device driver for usbfront_device devices.                              */
+/*                                                                           */
+/* Copyright (c) 2005 Harry Butterworth IBM Corporation                      */
+/*                                                                           */
+/* This program is free software; you can redistribute it and/or modify it   */
+/* under the terms of the GNU General Public License as published by the     */
+/* Free Software Foundation; either version 2 of the License, or (at your    */
+/* option) any later version.                                                */
+/*                                                                           */
+/* This program is distributed in the hope that it will be useful, but       */
+/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General */
+/* Public License for more details.                                          */
+/*                                                                           */
+/* You should have received a copy of the GNU General Public License along   */
+/* with this program; if not, write to the Free Software Foundation, Inc.,   */
+/* 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                   */
+/*                                                                           */
+/*****************************************************************************/
+
+#ifndef USBFRONT_DRIVER_H
+#define USBFRONT_DRIVER_H
+
+#include "usbfront_device.h"
+
+int usbfront_driver_class_init(void);
+
+void usbfront_driver_class_exit(void);
+
+int usbfront_driver_probe(struct usbfront_device *device);
+
+void usbfront_driver_remove(struct usbfront_device *device);
+
+#endif
linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_hcd_resource.c new file +728 -0

728 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_hcd_resource.h new file +98 -0

98 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_module.c new file +67 -0

67 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_sll.h new file +106 -0

106 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_trace.h new file +41 -0

41 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel