]> err.no Git - linux-2.6/blobdiff - include/linux/usb.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / include / linux / usb.h
index 2714814ab66cc40a4e326f38a9e6c4b12057cf9e..e34e5e3dce529bff49f09e1565471d7d9c657c85 100644 (file)
@@ -225,7 +225,7 @@ struct usb_interface_cache {
  * Device drivers should not attempt to activate configurations.  The choice
  * of which configuration to install is a policy decision based on such
  * considerations as available power, functionality provided, and the user's
- * desires (expressed through hotplug scripts).  However, drivers can call
+ * desires (expressed through userspace tools).  However, drivers can call
  * usb_reset_configuration() to reinitialize the current configuration and
  * all its interfaces.
  */
@@ -329,8 +329,6 @@ struct usb_device {
        struct usb_tt   *tt;            /* low/full speed dev, highspeed hub */
        int             ttport;         /* device port on that tt hub */
 
-       struct semaphore serialize;
-
        unsigned int toggle[2];         /* one bit for each endpoint
                                         * ([0] = IN, [1] = OUT) */
 
@@ -349,6 +347,9 @@ struct usb_device {
 
        char **rawdescriptors;          /* Raw descriptors for each config */
 
+       unsigned short bus_mA;          /* Current available from the bus */
+       u8 portnum;                     /* Parent port number (origin 1) */
+
        int have_langid;                /* whether string_langid is valid */
        int string_langid;              /* language ID for strings */
 
@@ -377,11 +378,12 @@ struct usb_device {
 extern struct usb_device *usb_get_dev(struct usb_device *dev);
 extern void usb_put_dev(struct usb_device *dev);
 
-extern void usb_lock_device(struct usb_device *udev);
-extern int usb_trylock_device(struct usb_device *udev);
+/* USB device locking */
+#define usb_lock_device(udev)          down(&(udev)->dev.sem)
+#define usb_unlock_device(udev)                up(&(udev)->dev.sem)
+#define usb_trylock_device(udev)       down_trylock(&(udev)->dev.sem)
 extern int usb_lock_device_for_reset(struct usb_device *udev,
                struct usb_interface *iface);
-extern void usb_unlock_device(struct usb_device *udev);
 
 /* USB port reset for device reinitialization */
 extern int usb_reset_device(struct usb_device *dev);
@@ -613,7 +615,7 @@ extern struct bus_type usb_bus_type;
  */
 struct usb_class_driver {
        char *name;
-       struct file_operations *fops;
+       const struct file_operations *fops;
        int minor_base;
 };
 
@@ -1016,8 +1018,6 @@ extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
        unsigned char descindex, void *buf, int size);
 extern int usb_get_status(struct usb_device *dev,
        int type, int target, void *data);
-extern int usb_get_string(struct usb_device *dev,
-       unsigned short langid, unsigned char index, void *buf, int size);
 extern int usb_string(struct usb_device *dev, int index,
        char *buf, size_t size);