summaryrefslogtreecommitdiff
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-12-29 13:51:34 -0600
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-12-29 13:51:34 -0600
commitf5a46614de328e867f778e4dffa71b48eb29340f (patch)
treee20250a27ae5dbeb927a7d085cd7dc162aa829e5 /include/linux/usb.h
parent8f99d72cc9359b80ef6c50a00ad098c78ac035ed (diff)
parentbec7aa00ffe5b1270837b965fdfe80be3e8e6e2e (diff)
Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 88557d5957a7..bcbfa72423c3 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -28,14 +28,6 @@ static __inline__ void wait_ms(unsigned int ms)
mdelay(ms);
}
-/*
- * USB device number allocation bitmap. There's one bitmap
- * per USB tree.
- */
-struct usb_devmap {
- unsigned long devicemap[128 / (8*sizeof(unsigned long))];
-};
-
struct usb_device;
/*-------------------------------------------------------------------------*/
@@ -119,12 +111,21 @@ struct usb_interface {
struct usb_driver *driver; /* driver */
kdev_t kdev; /* node this interface is bound to */
struct device dev; /* interface specific device info */
- void *private_data;
};
#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
#define interface_to_usbdev(intf) \
container_of(intf->dev.parent, struct usb_device, dev)
+static inline void *usb_get_intfdata (struct usb_interface *intf)
+{
+ return dev_get_drvdata (&intf->dev);
+}
+
+static inline void usb_set_intfdata (struct usb_interface *intf, void *data)
+{
+ return dev_set_drvdata (&intf->dev, data);
+}
+
/* USB_DT_CONFIG: Configuration descriptor information.
*
* USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
@@ -159,10 +160,16 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
struct usb_operations;
+/* USB device number allocation bitmap */
+struct usb_devmap {
+ unsigned long devicemap[128 / (8*sizeof(unsigned long))];
+};
+
/*
- * Allocated per bus we have
+ * Allocated per bus (tree of devices) we have:
*/
struct usb_bus {
+ struct device *controller; /* host/master side hardware */
int busnum; /* Bus number (in order of reg) */
char *bus_name; /* stable id (PCI slot_name etc) */
@@ -210,7 +217,6 @@ struct usb_device {
struct usb_tt *tt; /* low/full speed dev, highspeed hub */
int ttport; /* device port on that tt hub */
- atomic_t refcnt; /* Reference count */
struct semaphore serialize;
unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */
@@ -254,8 +260,7 @@ struct usb_device {
extern struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_bus *);
extern struct usb_device *usb_get_dev(struct usb_device *dev);
-extern void usb_free_dev(struct usb_device *);
-#define usb_put_dev usb_free_dev
+extern void usb_put_dev(struct usb_device *dev);
/* mostly for devices emulating SCSI over USB */
extern int usb_reset_device(struct usb_device *dev);