Lines Matching +full:usb +full:- +full:hub

1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2001-2002 by David Brownell
22 * USB Packet IDs (PIDs)
24 #define USB_PID_EXT 0xf0 /* USB 2.0 LPM ECN */
28 #define USB_PID_PING 0xb4 /* USB 2.0 */
30 #define USB_PID_NYET 0x96 /* USB 2.0 */
31 #define USB_PID_DATA2 0x87 /* USB 2.0 */
32 #define USB_PID_SPLIT 0x78 /* USB 2.0 */
37 #define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */
40 #define USB_PID_MDATA 0x0f /* USB 2.0 */
42 /*-------------------------------------------------------------------------*/
45 * USB Host Controller Driver (usb_hcd) framework
51 /*-------------------------------------------------------------------------*/
73 struct usb_bus self; /* hcd is-a bus */
79 * hcd->driver->flags & HCD_MASK
83 struct timer_list rh_timer; /* drives root-hub polling */
93 const struct hc_driver *driver; /* hw-specific hooks */
97 * other external phys should be software-transparent
110 #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
111 #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
119 #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
120 #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
121 #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
122 #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
123 #define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
124 #define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
125 #define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER))
133 ((hcd)->flags & (1U << HCD_FLAG_INTF_AUTHORIZED))
143 unsigned rh_registered:1;/* is root hub registered? */
144 unsigned rh_pollable:1; /* may we poll the root hub? */
145 unsigned msix_enabled:1; /* driver has MSI-X enabled? */
155 * support the new root-hub polling mechanism. */
157 unsigned has_tt:1; /* Integrated TT in root hub */
226 return &hcd->self; in hcd_to_bus()
234 /*-------------------------------------------------------------------------*/
238 const char *description; /* "ehci-hcd" etc */
249 #define HCD_USB11 0x0010 /* USB 1.1 */
250 #define HCD_USB2 0x0020 /* USB 2.0 */
251 #define HCD_USB3 0x0040 /* USB 3.0 */
252 #define HCD_USB31 0x0050 /* USB 3.1 */
253 #define HCD_USB32 0x0060 /* USB 3.2 */
257 /* called to init HCD and root hub */
262 * a whole, not just the root hub; they're for PCI bus glue.
264 /* called after suspending the hub, before entering D3 etc */
267 /* called after entering D0 (etc), before resuming the hub */
310 /* root hub support */
320 /* force handover of high-speed port to full-speed companion */
375 /* Set the hardware-chosen device address */
380 /* Notifies the HCD after a hub descriptor is fetched.
391 /* USB 3.0 Link Power Management */
392 /* Returns the USB3 hub-encoded value for the U1/U2 timeout. */
411 return hcd->driver->flags & HCD_BH; in hcd_giveback_urb_in_bh()
417 return hcd->high_prio_bh.completing_ep == ep; in hcd_periodic_completion_in_progress()
422 return IS_ENABLED(CONFIG_HAS_DMA) && (hcd->driver->flags & HCD_DMA); in hcd_uses_dma()
496 if (driver->flags & (HCD_USB11 | HCD_USB3)) in usb_hcd_amd_resume_bug()
510 /* pci-ish (pdev null is ok) buffer alloc/mapping support */
536 /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
537 #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
538 #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
540 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
543 /* -------------------------------------------------------------------------- */
545 /* Enumeration is only for the hub driver, or HCD virtual root hubs */
554 /*-------------------------------------------------------------------------*/
557 * HCD Root Hub support
560 #include <linux/usb/ch11.h>
563 * As of USB 2.0, full/low speed devices are segregated into trees.
564 * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
568 * TTs should only be known to the hub driver, and high speed bus
576 struct usb_device *hub; /* upstream highspeed hub */ member
598 /* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
612 /* class requests from the USB 2.0 hub spec, table 11-15 */
628 /*-------------------------------------------------------------------------*/
630 /* class requests from USB 3.1 hub spec, table 10-7 */
639 /* Trying not to use worst-case bit-stuffing
651 /* 4 full-speed bit times (est.) */
659 * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed
675 /*-------------------------------------------------------------------------*/
680 /*-------------------------------------------------------------------------*/
708 /*-------------------------------------------------------------------------*/
723 if (bus->monitored) in usbmon_urb_submit()
724 (*mon_ops->urb_submit)(bus, urb); in usbmon_urb_submit()
730 if (bus->monitored) in usbmon_urb_submit_error()
731 (*mon_ops->urb_submit_error)(bus, urb, error); in usbmon_urb_submit_error()
737 if (bus->monitored) in usbmon_urb_complete()
738 (*mon_ops->urb_complete)(bus, urb, status); in usbmon_urb_complete()
754 /*-------------------------------------------------------------------------*/
758 /* This rwsem is for use only by the hub driver and ehci-hcd.