diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index b5c226a87ed8..cfbd2bb8fa2c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -299,8 +299,9 @@ struct usb_bus { | |||
299 | int bandwidth_int_reqs; /* number of Interrupt requests */ | 299 | int bandwidth_int_reqs; /* number of Interrupt requests */ |
300 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ | 300 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ |
301 | 301 | ||
302 | #ifdef CONFIG_USB_DEVICEFS | ||
302 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 303 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
303 | 304 | #endif | |
304 | struct class_device *class_dev; /* class device for this bus */ | 305 | struct class_device *class_dev; /* class device for this bus */ |
305 | 306 | ||
306 | #if defined(CONFIG_USB_MON) | 307 | #if defined(CONFIG_USB_MON) |
@@ -373,9 +374,12 @@ struct usb_device { | |||
373 | char *serial; /* iSerialNumber string, if present */ | 374 | char *serial; /* iSerialNumber string, if present */ |
374 | 375 | ||
375 | struct list_head filelist; | 376 | struct list_head filelist; |
376 | struct device *usbfs_dev; | 377 | #ifdef CONFIG_USB_DEVICE_CLASS |
378 | struct device *usb_classdev; | ||
379 | #endif | ||
380 | #ifdef CONFIG_USB_DEVICEFS | ||
377 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 381 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
378 | 382 | #endif | |
379 | /* | 383 | /* |
380 | * Child devices - these can be either new devices | 384 | * Child devices - these can be either new devices |
381 | * (if this is a hub device), or different instances | 385 | * (if this is a hub device), or different instances |
@@ -388,12 +392,19 @@ struct usb_device { | |||
388 | struct usb_device *children[USB_MAXCHILDREN]; | 392 | struct usb_device *children[USB_MAXCHILDREN]; |
389 | 393 | ||
390 | int pm_usage_cnt; /* usage counter for autosuspend */ | 394 | int pm_usage_cnt; /* usage counter for autosuspend */ |
395 | u32 quirks; /* quirks of the whole device */ | ||
396 | |||
391 | #ifdef CONFIG_PM | 397 | #ifdef CONFIG_PM |
392 | struct delayed_work autosuspend; /* for delayed autosuspends */ | 398 | struct delayed_work autosuspend; /* for delayed autosuspends */ |
393 | struct mutex pm_mutex; /* protects PM operations */ | 399 | struct mutex pm_mutex; /* protects PM operations */ |
394 | 400 | ||
401 | unsigned long last_busy; /* time of last use */ | ||
402 | int autosuspend_delay; /* in jiffies */ | ||
403 | |||
395 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 404 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
396 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 405 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |
406 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ | ||
407 | unsigned autoresume_disabled:1; /* disabled by the user */ | ||
397 | #endif | 408 | #endif |
398 | }; | 409 | }; |
399 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 410 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
@@ -433,6 +444,11 @@ static inline void usb_autopm_disable(struct usb_interface *intf) | |||
433 | usb_autopm_set_interface(intf); | 444 | usb_autopm_set_interface(intf); |
434 | } | 445 | } |
435 | 446 | ||
447 | static inline void usb_mark_last_busy(struct usb_device *udev) | ||
448 | { | ||
449 | udev->last_busy = jiffies; | ||
450 | } | ||
451 | |||
436 | #else | 452 | #else |
437 | 453 | ||
438 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | 454 | static inline int usb_autopm_set_interface(struct usb_interface *intf) |
@@ -447,6 +463,8 @@ static inline void usb_autopm_enable(struct usb_interface *intf) | |||
447 | { } | 463 | { } |
448 | static inline void usb_autopm_disable(struct usb_interface *intf) | 464 | static inline void usb_autopm_disable(struct usb_interface *intf) |
449 | { } | 465 | { } |
466 | static inline void usb_mark_last_busy(struct usb_device *udev) | ||
467 | { } | ||
450 | #endif | 468 | #endif |
451 | 469 | ||
452 | /*-------------------------------------------------------------------------*/ | 470 | /*-------------------------------------------------------------------------*/ |
@@ -935,7 +953,7 @@ struct usb_iso_packet_descriptor { | |||
935 | unsigned int offset; | 953 | unsigned int offset; |
936 | unsigned int length; /* expected length */ | 954 | unsigned int length; /* expected length */ |
937 | unsigned int actual_length; | 955 | unsigned int actual_length; |
938 | unsigned int status; | 956 | int status; |
939 | }; | 957 | }; |
940 | 958 | ||
941 | struct urb; | 959 | struct urb; |