X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=include%2Flinux%2Fusb%2Fhcd.h;h=b8aba196f7f12948cbf4d2a587371b081f150d1c;hb=HEAD;hp=75efc45eaa2ff361d4cb92fa4c325eb8d5d50461;hpb=b690e9ca9e315cf2c5f522ba486f52f5d39583c7;p=karo-tx-linux.git diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 75efc45eaa2f..b8aba196f7f1 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -73,6 +73,7 @@ struct giveback_urb_bh { spinlock_t lock; struct list_head head; struct tasklet_struct bh; + struct usb_host_endpoint *completing_ep; }; struct usb_hcd { @@ -140,6 +141,7 @@ struct usb_hcd { unsigned wireless:1; /* Wireless USB HCD */ unsigned authorized_default:1; unsigned has_tt:1; /* Integrated TT in root hub */ + unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ unsigned int irq; /* irq allocated */ void __iomem *regs; /* device memory/io */ @@ -378,6 +380,12 @@ static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) return hcd->driver->flags & HCD_BH; } +static inline bool hcd_periodic_completion_in_progress(struct usb_hcd *hcd, + struct usb_host_endpoint *ep) +{ + return hcd->high_prio_bh.completing_ep == ep; +} + extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, int status); @@ -428,6 +436,8 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev, extern void usb_hcd_pci_remove(struct pci_dev *dev); extern void usb_hcd_pci_shutdown(struct pci_dev *dev); +extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); + #ifdef CONFIG_PM extern const struct dev_pm_ops usb_hcd_pci_pm_ops; #endif @@ -496,6 +506,7 @@ struct usb_tt { struct usb_device *hub; /* upstream highspeed hub */ int multi; /* true means one TT per port */ unsigned think_time; /* think time in ns */ + void *hcpriv; /* HCD private data */ /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ spinlock_t lock; @@ -554,9 +565,8 @@ extern void usb_ep0_reinit(struct usb_device *); * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ /* bytecount = data payload byte count */ -#define NS_TO_US(ns) ((ns + 500L) / 1000L) - /* convert & round nanoseconds to microseconds */ - +#define NS_TO_US(ns) DIV_ROUND_UP(ns, 1000L) + /* convert nanoseconds to microseconds, rounding up */ /* * Full/low speed bandwidth allocation constants/support.