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

Next file: linux/drivers/usb/usb_scsi.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.40/linux/drivers/usb/usb.h linux/drivers/usb/usb.h
@@ -4,6 +4,9 @@
 #include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/version.h>
+#include <linux/sched.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>	/* for in_interrupt() */
 
 /* USB constants */
 
@@ -116,7 +119,6 @@
 
 #include <linux/config.h>
 #include <linux/list.h>
-#include <linux/sched.h>
 
 #define USB_MAJOR 180
 
@@ -159,8 +161,12 @@
 
 static __inline__ void wait_ms(unsigned int ms)
 {
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(1 + ms * HZ / 1000);
+	if(!in_interrupt()) {
+		current->state = TASK_UNINTERRUPTIBLE;
+		schedule_timeout(1 + ms * HZ / 1000);
+	}
+	else
+		mdelay(ms);
 }
 
 typedef struct {
@@ -428,7 +434,7 @@
 int usb_submit_urb(purb_t purb);
 int usb_unlink_urb(purb_t purb);
 int usb_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe, devrequest *cmd,  void *data, int len, int timeout);
-int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, void *data, int len, unsigned long *rval, int timeout);
+int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, void *data, int len, int *actual_length, int timeout);
 
 /*-------------------------------------------------------------------*
  *                         COMPATIBILITY STUFF                       *
@@ -661,22 +667,22 @@
 int usb_set_address(struct usb_device *dev);
 int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
 	unsigned char descindex, void *buf, int size);
-int usb_get_class_descriptor(struct usb_device *dev, unsigned char desctype,
-	unsigned char descindex, unsigned char ifnum, void *buf, int size);
+int usb_get_class_descriptor(struct usb_device *dev, int ifnum, unsigned char desctype,
+	unsigned char descindex, void *buf, int size);
 int usb_get_device_descriptor(struct usb_device *dev);
 int __usb_get_extra_descriptor(char *buffer, unsigned size, unsigned char type, void **ptr);
-int usb_get_status (struct usb_device *dev, int type, int target, void *data);
-int usb_get_protocol(struct usb_device *dev);
-int usb_set_protocol(struct usb_device *dev, int protocol);
-int usb_set_interface(struct usb_device *dev, int interface, int alternate);
-int usb_set_idle(struct usb_device *dev, int duration, int report_id);
+int usb_get_status(struct usb_device *dev, int type, int target, void *data);
+int usb_get_protocol(struct usb_device *dev, int ifnum);
+int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol);
+int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
+int usb_set_idle(struct usb_device *dev, int ifnum, int duration, int report_id);
 int usb_set_configuration(struct usb_device *dev, int configuration);
-int usb_get_report(struct usb_device *dev, unsigned char type,
-	unsigned char id, unsigned char index, void *buf, int size);
-int usb_set_report(struct usb_device *dev, unsigned char type,
-	unsigned char id, unsigned char index, void *buf, int size);
+int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type,
+	unsigned char id, void *buf, int size);
+int usb_set_report(struct usb_device *dev, int ifnum, unsigned char type,
+	unsigned char id, void *buf, int size);
 int usb_string(struct usb_device *dev, int index, char *buf, size_t size);
-int usb_clear_halt(struct usb_device *dev, int endp);
+int usb_clear_halt(struct usb_device *dev, int pipe);
 
 #define usb_get_extra_descriptor(ifpoint,type,ptr)\
 	__usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,type,(void**)ptr)

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