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

Next file: linux/drivers/video/vgacon.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.10/linux/drivers/usb/usb.h linux/drivers/usb/usb.h
@@ -149,6 +149,7 @@
 #define USB_ST_REMOVED		0x100
 #define USB_ST_TIMEOUT		0x110
 #define USB_ST_INTERNALERROR	-1
+#define USB_ST_NOTSUPPORTED	-2
 
 /*
  * USB device number allocation bitmap. There's one bitmap
@@ -169,7 +170,7 @@
 #define USB_MAXALTSETTING       5
 #define USB_MAXINTERFACES	32
 #define USB_MAXENDPOINTS	32
-#define USB_MAXSTRINGS		16
+#define USB_MAXSTRINGS		32
 
 struct usb_device_descriptor {
 	__u8  bLength;
@@ -276,6 +277,9 @@
  *         of the buffer by this transfer.  (-1 = unknown/unsupported)
  *     void *dev_id - This is a user defined pointer set when the IRQ
  *         is requested that is passed back.
+ *
+ *   Special Cases:
+ *     if (status == USB_ST_REMOVED), don't trust buffer or len.
  */
 typedef int (*usb_device_irq)(int, void *, int, void *);
 
@@ -284,8 +288,13 @@
 	int (*deallocate)(struct usb_device *);
 	int (*control_msg)(struct usb_device *, unsigned int, devrequest *, void *, int);
 	int (*bulk_msg)(struct usb_device *, unsigned int, void *, int,unsigned long *);
-	int (*request_irq)(struct usb_device *, unsigned int, usb_device_irq, int, void *);
-	int (*remove_irq)(struct usb_device *, unsigned int, usb_device_irq, int, void *);
+	void* (*request_irq)(struct usb_device *, unsigned int, usb_device_irq, int, void *);
+	int (*release_irq)(void* handle);
+	void *(*alloc_isoc)(struct usb_device *usb_dev, unsigned int pipe, void *data, int len, int maxsze, usb_device_irq completed, void *dev_id);
+	void (*delete_isoc)(struct usb_device *dev, void *_isodesc);
+	int (*sched_isoc)(struct usb_device *usb_dev, void *_isodesc, void *_pisodesc);
+	int (*unsched_isoc)(struct usb_device *usb_dev, void *_isodesc);
+	int (*compress_isoc)(struct usb_device *usb_dev, void *_isodesc);
 };
 
 /*
@@ -306,8 +315,8 @@
 	int devnum;			/* Device number on USB bus */
 	int slow;			/* Slow device? */
 	int maxpacketsize;		/* Maximum packet size; encoded as 0,1,2,3 = 8,16,32,64 */
-	int toggle[2];			/* one bit for each endpoint ([0] = IN, [1] = OUT) */
-	int halted;			/* endpoint halts */
+	unsigned int toggle[2];		/* one bit for each endpoint ([0] = IN, [1] = OUT) */
+	unsigned int halted;		/* endpoint halts */
 	struct usb_config_descriptor *actconfig;/* the active configuration */
 	int epmaxpacket[16];		/* endpoint specific maximums */
 	int ifnum;			/* active interface number */
@@ -316,10 +325,9 @@
 	struct usb_device_descriptor descriptor;/* Descriptor */
 	struct usb_config_descriptor *config;	/* All of the configs */
 	struct usb_device *parent;
-	char *stringtable;		/* Strings (multiple, null term) */
-	char **stringindex;		/* pointers to strings */
-	int maxstring;			/* max valid index */
-
+	char *stringindex[USB_MAXSTRINGS];	/* pointers to strings */
+	int string_langid;		/* language ID for strings */
+  
 	/*
 	 * Child devices - these can be either new devices
 	 * (if this is a hub device), or different instances
@@ -341,7 +349,8 @@
 extern void usb_register_bus(struct usb_bus *);
 extern void usb_deregister_bus(struct usb_bus *);
 
-extern int usb_request_irq(struct usb_device *, unsigned int, usb_device_irq, int, void *);
+extern void* usb_request_irq(struct usb_device *, unsigned int, usb_device_irq, int, void *);
+extern int usb_release_irq(struct usb_device *dev, void *handle);
 
 extern void usb_init_root_hub(struct usb_device *dev);
 extern void usb_connect(struct usb_device *dev);
@@ -353,6 +362,13 @@
 extern int  usb_parse_configuration(struct usb_device *dev, void *buf, int len);
 extern void usb_destroy_configuration(struct usb_device *dev);
 
+extern void *usb_allocate_isochronous (struct usb_device *usb_dev, unsigned int pipe, void *data, int len,
+					int maxsze, usb_device_irq completed, void *dev_id);
+extern void usb_delete_isochronous (struct usb_device *dev, void *_isodesc);
+extern int usb_schedule_isochronous (struct usb_device *usb_dev, void *_isodesc, void *_pisodesc);
+extern int usb_unschedule_isochronous (struct usb_device *usb_dev, void *_isodesc);
+extern int usb_compress_isochronous (struct usb_device *usb_dev, void *_isodesc);
+
 /*
  * Calling this entity a "pipe" is glorifying it. A USB pipe
  * is something embarrassingly simple: it basically consists
@@ -377,7 +393,7 @@
  *  - device:		bits 8-14
  *  - endpoint:		bits 15-18
  *  - Data0/1:		bit 19
- *  - speed:		bit 26		(00 = Full, 01 = Low Speed)
+ *  - speed:		bit 26		(0 = Full, 1 = Low Speed)
  *  - pipe type:	bits 30-31	(00 = isochronous, 01 = interrupt, 10 = control, 11 = bulk)
  *
  * Why? Because it's arbitrary, and whatever encoding we select is really
@@ -389,19 +405,18 @@
 #define usb_maxpacket(dev,pipe)	((dev)->epmaxpacket[usb_pipeendpoint(pipe)])
 #define usb_packetid(pipe)	(((pipe) & 0x80) ? 0x69 : 0xE1)
 
+#define usb_pipeout(pipe)	((((pipe) >> 7) & 1) ^ 1)
 #define usb_pipedevice(pipe)	(((pipe) >> 8) & 0x7f)
+#define usb_pipe_endpdev(pipe)	(((pipe) >> 8) & 0x7ff)
 #define usb_pipeendpoint(pipe)	(((pipe) >> 15) & 0xf)
 #define usb_pipedata(pipe)	(((pipe) >> 19) & 1)
-#define usb_pipeout(pipe)	((((pipe) >> 7) & 1) ^ 1)
 #define usb_pipeslow(pipe)	(((pipe) >> 26) & 1)
-
 #define usb_pipetype(pipe)	(((pipe) >> 30) & 3)
 #define usb_pipeisoc(pipe)	(usb_pipetype((pipe)) == 0)
 #define usb_pipeint(pipe)	(usb_pipetype((pipe)) == 1)
 #define usb_pipecontrol(pipe)	(usb_pipetype((pipe)) == 2)
 #define usb_pipebulk(pipe)	(usb_pipetype((pipe)) == 3)
 
-#define usb_pipe_endpdev(pipe)	(((pipe) >> 8) & 0x7ff)
 #define PIPE_DEVEP_MASK		0x0007ff00
 
 /* The D0/D1 toggle bits */
@@ -445,21 +460,18 @@
 int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size);
 int usb_clear_port_feature(struct usb_device *dev, int port, int feature);
 int usb_set_port_feature(struct usb_device *dev, int port, int feature);
+int usb_get_status (struct usb_device *dev, int type, int target, void *data);
 int usb_get_hub_status(struct usb_device *dev, void *data);
 int usb_get_port_status(struct usb_device *dev, int port, 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_set_interface(struct usb_device *dev, int interface, int alternate);
 int usb_set_configuration(struct usb_device *dev, int configuration);
 int usb_get_report(struct usb_device *dev);
+char *usb_string(struct usb_device *dev, int index);
 int usb_clear_halt(struct usb_device *dev, int endp);
-static inline char * usb_string(struct usb_device* dev, int index)
-{
-	if (index <= dev->maxstring && dev->stringindex && dev->stringindex[index])
-		return dev->stringindex[index];
-	else
-		return NULL;
-}
 
 /*
  * Debugging helpers..

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