diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 73c7df489607..d3d0c1374334 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -292,6 +292,16 @@ struct usb_host_config { | |||
292 | int extralen; | 292 | int extralen; |
293 | }; | 293 | }; |
294 | 294 | ||
295 | /* USB2.0 and USB3.0 device BOS descriptor set */ | ||
296 | struct usb_host_bos { | ||
297 | struct usb_bos_descriptor *desc; | ||
298 | |||
299 | /* wireless cap descriptor is handled by wusb */ | ||
300 | struct usb_ext_cap_descriptor *ext_cap; | ||
301 | struct usb_ss_cap_descriptor *ss_cap; | ||
302 | struct usb_ss_container_id_descriptor *ss_id; | ||
303 | }; | ||
304 | |||
295 | int __usb_get_extra_descriptor(char *buffer, unsigned size, | 305 | int __usb_get_extra_descriptor(char *buffer, unsigned size, |
296 | unsigned char type, void **ptr); | 306 | unsigned char type, void **ptr); |
297 | #define usb_get_extra_descriptor(ifpoint, type, ptr) \ | 307 | #define usb_get_extra_descriptor(ifpoint, type, ptr) \ |
@@ -381,6 +391,7 @@ struct usb_tt; | |||
381 | * @ep0: endpoint 0 data (default control pipe) | 391 | * @ep0: endpoint 0 data (default control pipe) |
382 | * @dev: generic device interface | 392 | * @dev: generic device interface |
383 | * @descriptor: USB device descriptor | 393 | * @descriptor: USB device descriptor |
394 | * @bos: USB device BOS descriptor set | ||
384 | * @config: all of the device's configs | 395 | * @config: all of the device's configs |
385 | * @actconfig: the active configuration | 396 | * @actconfig: the active configuration |
386 | * @ep_in: array of IN endpoints | 397 | * @ep_in: array of IN endpoints |
@@ -399,6 +410,9 @@ struct usb_tt; | |||
399 | * FIXME -- complete doc | 410 | * FIXME -- complete doc |
400 | * @authenticated: Crypto authentication passed | 411 | * @authenticated: Crypto authentication passed |
401 | * @wusb: device is Wireless USB | 412 | * @wusb: device is Wireless USB |
413 | * @lpm_capable: device supports LPM | ||
414 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM | ||
415 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled | ||
402 | * @string_langid: language ID for strings | 416 | * @string_langid: language ID for strings |
403 | * @product: iProduct string, if present (static) | 417 | * @product: iProduct string, if present (static) |
404 | * @manufacturer: iManufacturer string, if present (static) | 418 | * @manufacturer: iManufacturer string, if present (static) |
@@ -442,6 +456,7 @@ struct usb_device { | |||
442 | struct device dev; | 456 | struct device dev; |
443 | 457 | ||
444 | struct usb_device_descriptor descriptor; | 458 | struct usb_device_descriptor descriptor; |
459 | struct usb_host_bos *bos; | ||
445 | struct usb_host_config *config; | 460 | struct usb_host_config *config; |
446 | 461 | ||
447 | struct usb_host_config *actconfig; | 462 | struct usb_host_config *actconfig; |
@@ -460,6 +475,9 @@ struct usb_device { | |||
460 | unsigned authorized:1; | 475 | unsigned authorized:1; |
461 | unsigned authenticated:1; | 476 | unsigned authenticated:1; |
462 | unsigned wusb:1; | 477 | unsigned wusb:1; |
478 | unsigned lpm_capable:1; | ||
479 | unsigned usb2_hw_lpm_capable:1; | ||
480 | unsigned usb2_hw_lpm_enabled:1; | ||
463 | int string_langid; | 481 | int string_langid; |
464 | 482 | ||
465 | /* static strings from the device */ | 483 | /* static strings from the device */ |
@@ -928,10 +946,11 @@ struct usb_class_driver { | |||
928 | */ | 946 | */ |
929 | extern int usb_register_driver(struct usb_driver *, struct module *, | 947 | extern int usb_register_driver(struct usb_driver *, struct module *, |
930 | const char *); | 948 | const char *); |
931 | static inline int usb_register(struct usb_driver *driver) | 949 | |
932 | { | 950 | /* use a define to avoid include chaining to get THIS_MODULE & friends */ |
933 | return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); | 951 | #define usb_register(driver) \ |
934 | } | 952 | usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) |
953 | |||
935 | extern void usb_deregister(struct usb_driver *); | 954 | extern void usb_deregister(struct usb_driver *); |
936 | 955 | ||
937 | extern int usb_register_device_driver(struct usb_device_driver *, | 956 | extern int usb_register_device_driver(struct usb_device_driver *, |
@@ -1574,7 +1593,7 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out) | |||
1574 | return 0; | 1593 | return 0; |
1575 | 1594 | ||
1576 | /* NOTE: only 0x07ff bits are for packet size... */ | 1595 | /* NOTE: only 0x07ff bits are for packet size... */ |
1577 | return le16_to_cpu(ep->desc.wMaxPacketSize); | 1596 | return usb_endpoint_maxp(&ep->desc); |
1578 | } | 1597 | } |
1579 | 1598 | ||
1580 | /* ----------------------------------------------------------------------- */ | 1599 | /* ----------------------------------------------------------------------- */ |