diff options
Diffstat (limited to 'include/linux/usb/hcd.h')
-rw-r--r-- | include/linux/usb/hcd.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 2e3a4ea1a3da..3b571f1ffbb3 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -89,18 +89,33 @@ struct usb_hcd { | |||
89 | */ | 89 | */ |
90 | const struct hc_driver *driver; /* hw-specific hooks */ | 90 | const struct hc_driver *driver; /* hw-specific hooks */ |
91 | 91 | ||
92 | /* Flags that need to be manipulated atomically */ | 92 | /* Flags that need to be manipulated atomically because they can |
93 | * change while the host controller is running. Always use | ||
94 | * set_bit() or clear_bit() to change their values. | ||
95 | */ | ||
93 | unsigned long flags; | 96 | unsigned long flags; |
94 | #define HCD_FLAG_HW_ACCESSIBLE 0x00000001 | 97 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ |
95 | #define HCD_FLAG_SAW_IRQ 0x00000002 | 98 | #define HCD_FLAG_SAW_IRQ 1 |
99 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ | ||
100 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ | ||
101 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ | ||
102 | |||
103 | /* The flags can be tested using these macros; they are likely to | ||
104 | * be slightly faster than test_bit(). | ||
105 | */ | ||
106 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) | ||
107 | #define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ)) | ||
108 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) | ||
109 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) | ||
110 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) | ||
96 | 111 | ||
112 | /* Flags that get set only during HCD registration or removal. */ | ||
97 | unsigned rh_registered:1;/* is root hub registered? */ | 113 | unsigned rh_registered:1;/* is root hub registered? */ |
114 | unsigned rh_pollable:1; /* may we poll the root hub? */ | ||
98 | 115 | ||
99 | /* The next flag is a stopgap, to be removed when all the HCDs | 116 | /* The next flag is a stopgap, to be removed when all the HCDs |
100 | * support the new root-hub polling mechanism. */ | 117 | * support the new root-hub polling mechanism. */ |
101 | unsigned uses_new_polling:1; | 118 | unsigned uses_new_polling:1; |
102 | unsigned poll_rh:1; /* poll for rh status? */ | ||
103 | unsigned poll_pending:1; /* status has changed? */ | ||
104 | unsigned wireless:1; /* Wireless USB HCD */ | 119 | unsigned wireless:1; /* Wireless USB HCD */ |
105 | unsigned authorized_default:1; | 120 | unsigned authorized_default:1; |
106 | unsigned has_tt:1; /* Integrated TT in root hub */ | 121 | unsigned has_tt:1; /* Integrated TT in root hub */ |
@@ -198,7 +213,7 @@ struct hc_driver { | |||
198 | * a whole, not just the root hub; they're for PCI bus glue. | 213 | * a whole, not just the root hub; they're for PCI bus glue. |
199 | */ | 214 | */ |
200 | /* called after suspending the hub, before entering D3 etc */ | 215 | /* called after suspending the hub, before entering D3 etc */ |
201 | int (*pci_suspend)(struct usb_hcd *hcd); | 216 | int (*pci_suspend)(struct usb_hcd *hcd, bool do_wakeup); |
202 | 217 | ||
203 | /* called after entering D0 (etc), before resuming the hub */ | 218 | /* called after entering D0 (etc), before resuming the hub */ |
204 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); | 219 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); |
@@ -299,6 +314,10 @@ struct hc_driver { | |||
299 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, | 314 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, |
300 | struct usb_tt *tt, gfp_t mem_flags); | 315 | struct usb_tt *tt, gfp_t mem_flags); |
301 | int (*reset_device)(struct usb_hcd *, struct usb_device *); | 316 | int (*reset_device)(struct usb_hcd *, struct usb_device *); |
317 | /* Notifies the HCD after a device is connected and its | ||
318 | * address is set | ||
319 | */ | ||
320 | int (*update_device)(struct usb_hcd *, struct usb_device *); | ||
302 | }; | 321 | }; |
303 | 322 | ||
304 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 323 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |