diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-14 01:12:43 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-14 01:12:43 -0700 |
| commit | 340de76c4bed374f0913872b188fa519ac3b756b (patch) | |
| tree | c52d4f1a9cc6998834178dcbd85c6050ad78fd3b /include/linux | |
| parent | 491a0f428301ebf9d63f955695e31014d13d54b9 (diff) | |
| parent | e19cd00eadbce30d9908a2c1296bec3e44cec056 (diff) | |
Merge bk://linuxusb.bkbits.net/usb-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pci_ids.h | 3 | ||||
| -rw-r--r-- | include/linux/usb.h | 25 | ||||
| -rw-r--r-- | include/linux/usb_ch9.h | 14 | ||||
| -rw-r--r-- | include/linux/usb_gadget.h | 9 |
4 files changed, 45 insertions, 6 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d2a38233a6c7..973a9cb787f3 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1880,6 +1880,9 @@ #define PCI_DEVICE_ID_S2IO_WIN 0x5731 #define PCI_DEVICE_ID_S2IO_UNI 0x5831 +#define PCI_VENDOR_ID_ARC 0x192E +#define PCI_DEVICE_ID_ARC_EHCI 0x0101 + #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 diff --git a/include/linux/usb.h b/include/linux/usb.h index e4b60511fc46..608e3a297340 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -31,6 +31,7 @@ static __inline__ void wait_ms(unsigned int ms) } struct usb_device; +struct usb_driver; /*-------------------------------------------------------------------------*/ @@ -86,8 +87,6 @@ struct usb_host_interface { * number from the USB core by calling usb_register_dev(). * @dev: driver model's view of this device * @class_dev: driver model's class view of this device. - * @released: wait for the interface to be released when changing - * configurations. * * USB device drivers attach to interfaces on a physical device. Each * interface encapsulates a single high level function, such as feeding @@ -123,11 +122,9 @@ struct usb_interface { * active alternate setting */ unsigned num_altsetting; /* number of alternate settings */ - struct usb_driver *driver; /* driver */ int minor; /* minor number this interface is bound to */ struct device dev; /* interface specific device info */ struct class_device *class_dev; - struct completion *released; /* wait for release */ }; #define to_usb_interface(d) container_of(d, struct usb_interface, dev) #define interface_to_usbdev(intf) \ @@ -143,6 +140,9 @@ static inline void usb_set_intfdata (struct usb_interface *intf, void *data) dev_set_drvdata(&intf->dev, data); } +struct usb_interface *usb_get_intf(struct usb_interface *intf); +void usb_put_intf(struct usb_interface *intf); + /* this maximum is arbitrary */ #define USB_MAXINTERFACES 32 @@ -318,7 +318,21 @@ extern int usb_get_current_frame_number (struct usb_device *usb_dev); /* used these for multi-interface device registration */ extern int usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface *iface, void* priv); -extern int usb_interface_claimed(struct usb_interface *iface); + +/** + * usb_interface_claimed - returns true iff an interface is claimed + * @iface: the interface being checked + * + * Returns true (nonzero) iff the interface is claimed, else false (zero). + * Callers must own the driver model's usb bus readlock. So driver + * probe() entries don't need extra locking, but other call contexts + * may need to explicitly claim that lock. + * + */ +static int inline usb_interface_claimed(struct usb_interface *iface) { + return (iface->dev.driver != NULL); +} + extern void usb_driver_release_interface(struct usb_driver *driver, struct usb_interface *iface); const struct usb_device_id *usb_match_id(struct usb_interface *interface, @@ -904,7 +918,6 @@ extern int usb_string(struct usb_device *dev, int index, /* wrappers that also update important state inside usbcore */ extern int usb_clear_halt(struct usb_device *dev, int pipe); extern int usb_reset_configuration(struct usb_device *dev); -extern int usb_set_configuration(struct usb_device *dev, int configuration); extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); /* diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index 682e95114870..2a9e19b10c64 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -68,6 +68,20 @@ #define USB_REQ_SET_INTERFACE 0x0B #define USB_REQ_SYNCH_FRAME 0x0C +/* + * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and + * are read as a bit array returned by USB_REQ_GET_STATUS. (So there + * are at most sixteen features of each type.) + */ +#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ +#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ +#define USB_DEVICE_TEST_MODE 2 /* (high speed only) */ +#define USB_DEVICE_B_HNP_ENABLE 3 /* dev may initiate HNP */ +#define USB_DEVICE_A_HNP_SUPPORT 4 /* RH port supports HNP */ +#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* other RH port does */ + +#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ + /** * struct usb_ctrlrequest - SETUP data for a USB device control request diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 503abfe9a9aa..3ba4e10d0372 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h @@ -731,6 +731,15 @@ int usb_descriptor_fillbuf(void *, unsigned, int usb_gadget_config_buf(const struct usb_config_descriptor *config, void *buf, unsigned buflen, const struct usb_descriptor_header **desc); +/*-------------------------------------------------------------------------*/ + +/* utility wrapping a simple endpoint selection policy */ + +extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, + struct usb_endpoint_descriptor *) __init; + +extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; + #endif /* __KERNEL__ */ #endif /* __LINUX_USB_GADGET_H */ |
