aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a34fa89f1474..d7ace1b80f09 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -192,6 +192,7 @@ struct usb_interface {
192 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ 192 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */
193 unsigned needs_binding:1; /* needs delayed unbind/rebind */ 193 unsigned needs_binding:1; /* needs delayed unbind/rebind */
194 unsigned reset_running:1; 194 unsigned reset_running:1;
195 unsigned resetting_device:1; /* true: bandwidth alloc after reset */
195 196
196 struct device dev; /* interface specific device info */ 197 struct device dev; /* interface specific device info */
197 struct device *usb_dev; 198 struct device *usb_dev;
@@ -331,6 +332,7 @@ struct usb_bus {
331 u8 otg_port; /* 0, or number of OTG/HNP port */ 332 u8 otg_port; /* 0, or number of OTG/HNP port */
332 unsigned is_b_host:1; /* true during some HNP roleswitches */ 333 unsigned is_b_host:1; /* true during some HNP roleswitches */
333 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ 334 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
335 unsigned sg_tablesize; /* 0 or largest number of sg list entries */
334 336
335 int devnum_next; /* Next open device number in 337 int devnum_next; /* Next open device number in
336 * round-robin allocation */ 338 * round-robin allocation */
@@ -428,11 +430,9 @@ struct usb_tt;
428 * @last_busy: time of last use 430 * @last_busy: time of last use
429 * @autosuspend_delay: in jiffies 431 * @autosuspend_delay: in jiffies
430 * @connect_time: time device was first connected 432 * @connect_time: time device was first connected
431 * @auto_pm: autosuspend/resume in progress
432 * @do_remote_wakeup: remote wakeup should be enabled 433 * @do_remote_wakeup: remote wakeup should be enabled
433 * @reset_resume: needs reset instead of resume 434 * @reset_resume: needs reset instead of resume
434 * @autosuspend_disabled: autosuspend disabled by the user 435 * @autosuspend_disabled: autosuspend disabled by the user
435 * @autoresume_disabled: autoresume disabled by the user
436 * @skip_sys_resume: skip the next system resume 436 * @skip_sys_resume: skip the next system resume
437 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 437 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
438 * specific data for the device. 438 * specific data for the device.
@@ -513,11 +513,9 @@ struct usb_device {
513 int autosuspend_delay; 513 int autosuspend_delay;
514 unsigned long connect_time; 514 unsigned long connect_time;
515 515
516 unsigned auto_pm:1;
517 unsigned do_remote_wakeup:1; 516 unsigned do_remote_wakeup:1;
518 unsigned reset_resume:1; 517 unsigned reset_resume:1;
519 unsigned autosuspend_disabled:1; 518 unsigned autosuspend_disabled:1;
520 unsigned autoresume_disabled:1;
521 unsigned skip_sys_resume:1; 519 unsigned skip_sys_resume:1;
522#endif 520#endif
523 struct wusb_dev *wusb_dev; 521 struct wusb_dev *wusb_dev;
@@ -543,22 +541,20 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
543 541
544/* USB autosuspend and autoresume */ 542/* USB autosuspend and autoresume */
545#ifdef CONFIG_USB_SUSPEND 543#ifdef CONFIG_USB_SUSPEND
546extern int usb_autopm_set_interface(struct usb_interface *intf);
547extern int usb_autopm_get_interface(struct usb_interface *intf); 544extern int usb_autopm_get_interface(struct usb_interface *intf);
548extern void usb_autopm_put_interface(struct usb_interface *intf); 545extern void usb_autopm_put_interface(struct usb_interface *intf);
549extern int usb_autopm_get_interface_async(struct usb_interface *intf); 546extern int usb_autopm_get_interface_async(struct usb_interface *intf);
550extern void usb_autopm_put_interface_async(struct usb_interface *intf); 547extern void usb_autopm_put_interface_async(struct usb_interface *intf);
551 548
552static inline void usb_autopm_enable(struct usb_interface *intf) 549static inline void usb_autopm_get_interface_no_resume(
550 struct usb_interface *intf)
553{ 551{
554 atomic_set(&intf->pm_usage_cnt, 0); 552 atomic_inc(&intf->pm_usage_cnt);
555 usb_autopm_set_interface(intf);
556} 553}
557 554static inline void usb_autopm_put_interface_no_suspend(
558static inline void usb_autopm_disable(struct usb_interface *intf) 555 struct usb_interface *intf)
559{ 556{
560 atomic_set(&intf->pm_usage_cnt, 1); 557 atomic_dec(&intf->pm_usage_cnt);
561 usb_autopm_set_interface(intf);
562} 558}
563 559
564static inline void usb_mark_last_busy(struct usb_device *udev) 560static inline void usb_mark_last_busy(struct usb_device *udev)
@@ -568,12 +564,8 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
568 564
569#else 565#else
570 566
571static inline int usb_autopm_set_interface(struct usb_interface *intf)
572{ return 0; }
573
574static inline int usb_autopm_get_interface(struct usb_interface *intf) 567static inline int usb_autopm_get_interface(struct usb_interface *intf)
575{ return 0; } 568{ return 0; }
576
577static inline int usb_autopm_get_interface_async(struct usb_interface *intf) 569static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
578{ return 0; } 570{ return 0; }
579 571
@@ -581,9 +573,11 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf)
581{ } 573{ }
582static inline void usb_autopm_put_interface_async(struct usb_interface *intf) 574static inline void usb_autopm_put_interface_async(struct usb_interface *intf)
583{ } 575{ }
584static inline void usb_autopm_enable(struct usb_interface *intf) 576static inline void usb_autopm_get_interface_no_resume(
577 struct usb_interface *intf)
585{ } 578{ }
586static inline void usb_autopm_disable(struct usb_interface *intf) 579static inline void usb_autopm_put_interface_no_suspend(
580 struct usb_interface *intf)
587{ } 581{ }
588static inline void usb_mark_last_busy(struct usb_device *udev) 582static inline void usb_mark_last_busy(struct usb_device *udev)
589{ } 583{ }
@@ -626,6 +620,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
626 unsigned ifnum); 620 unsigned ifnum);
627extern struct usb_host_interface *usb_altnum_to_altsetting( 621extern struct usb_host_interface *usb_altnum_to_altsetting(
628 const struct usb_interface *intf, unsigned int altnum); 622 const struct usb_interface *intf, unsigned int altnum);
623extern struct usb_host_interface *usb_find_alt_setting(
624 struct usb_host_config *config,
625 unsigned int iface_num,
626 unsigned int alt_num);
629 627
630 628
631/** 629/**