patch-2.3.16 linux/drivers/usb/usb.h

Next file: linux/drivers/video/acornfb.c
Previous file: linux/drivers/usb/usb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/drivers/usb/usb.h linux/drivers/usb/usb.h
@@ -1,33 +1,10 @@
 #ifndef __LINUX_USB_H
 #define __LINUX_USB_H
 
-#include <linux/config.h>
 #include <linux/types.h>
-#include <linux/list.h>
-#include <linux/sched.h>
+#include <linux/ioctl.h>
 
-extern int usb_hub_init(void);
-extern int usb_kbd_init(void);
-extern int usb_cpia_init(void);
-extern int usb_mouse_init(void);
-extern int usb_printer_init(void);
-
-extern void usb_hub_cleanup(void);
-extern void usb_mouse_cleanup(void);
-
-static __inline__ void wait_ms(unsigned int ms)
-{
-        current->state = TASK_UNINTERRUPTIBLE;
-        schedule_timeout(1 + ms * HZ / 1000);
-}
-
-typedef struct {
-	__u8 requesttype;
-	__u8 request;
-	__u16 value;
-	__u16 index;
-	__u16 length;
-} devrequest __attribute__ ((packed));
+/* USB constants */
 
 /*
  * Device and/or Interface Class codes
@@ -132,6 +109,69 @@
 
 #define USB_RT_HIDD			(USB_TYPE_CLASS | USB_RECIP_INTERFACE)
 
+/* /proc/bus/usb/xxx/yyy ioctl codes */
+
+struct usb_proc_ctrltransfer {
+	__u8 requesttype;
+	__u8 request;
+	__u16 value;
+	__u16 index;
+	__u16 length;
+        /* pointer to data */
+        void *data;
+};
+
+#define USB_PROC_CONTROL        _IOWR('U', 0, struct usb_proc_ctrltransfer)
+
+struct usb_proc_bulktransfer {
+        unsigned int ep;
+        unsigned int len;
+        void *data;
+};
+
+#define USB_PROC_BULK           _IOWR('U', 2, struct usb_proc_bulktransfer)
+
+#define USB_PROC_RESETEP        _IOR('U', 3, unsigned int)
+
+struct usb_proc_setinterface {
+        unsigned int interface;
+        unsigned int altsetting;
+};
+
+#define USB_PROC_SETINTERFACE   _IOR('U', 4, struct usb_proc_setinterface)
+
+
+
+
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <linux/list.h>
+#include <linux/sched.h>
+
+extern int usb_hub_init(void);
+extern int usb_kbd_init(void);
+extern int usb_cpia_init(void);
+extern int usb_mouse_init(void);
+extern int usb_printer_init(void);
+
+extern void usb_hub_cleanup(void);
+extern void usb_mouse_cleanup(void);
+
+static __inline__ void wait_ms(unsigned int ms)
+{
+        current->state = TASK_UNINTERRUPTIBLE;
+        schedule_timeout(1 + ms * HZ / 1000);
+}
+
+typedef struct {
+	__u8 requesttype;
+	__u8 request;
+	__u16 value;
+	__u16 index;
+	__u16 length;
+} devrequest __attribute__ ((packed));
+
 /* 
  * Status codes (these follow OHCI controllers condition codes)
  */
@@ -639,6 +679,8 @@
 extern inline void proc_usb_add_device(struct usb_device *dev) {}
 extern inline void proc_usb_remove_device(struct usb_device *dev) {}
 #endif
+
+#endif  /* __KERNEL */
 
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)