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 wireless:1; /* Wireless USB HCD */
158 unsigned has_tt:1; /* Integrated TT in root hub */
227 return &hcd->self; in hcd_to_bus()
235 /*-------------------------------------------------------------------------*/
239 const char *description; /* "ehci-hcd" etc */
250 #define HCD_USB11 0x0010 /* USB 1.1 */
251 #define HCD_USB2 0x0020 /* USB 2.0 */
252 #define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/
253 #define HCD_USB3 0x0040 /* USB 3.0 */
254 #define HCD_USB31 0x0050 /* USB 3.1 */
255 #define HCD_USB32 0x0060 /* USB 3.2 */
259 /* called to init HCD and root hub */
264 * a whole, not just the root hub; they're for PCI bus glue.
266 /* called after suspending the hub, before entering D3 etc */
269 /* called after entering D0 (etc), before resuming the hub */
309 /* root hub support */
319 /* force handover of high-speed port to full-speed companion */
374 /* Returns the hardware-chosen device address */
378 /* Notifies the HCD after a hub descriptor is fetched.
389 /* USB 3.0 Link Power Management */
390 /* Returns the USB3 hub-encoded value for the U1/U2 timeout. */
409 return hcd->driver->flags & HCD_BH; in hcd_giveback_urb_in_bh()
415 return hcd->high_prio_bh.completing_ep == ep; in hcd_periodic_completion_in_progress()
420 return IS_ENABLED(CONFIG_HAS_DMA) && (hcd->driver->flags & HCD_DMA); in hcd_uses_dma()
493 /* pci-ish (pdev null is ok) buffer alloc/mapping support */
514 /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
515 #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
516 #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
518 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
521 /* -------------------------------------------------------------------------- */
523 /* Enumeration is only for the hub driver, or HCD virtual root hubs */
532 /*-------------------------------------------------------------------------*/
535 * HCD Root Hub support
538 #include <linux/usb/ch11.h>
541 * As of USB 2.0, full/low speed devices are segregated into trees.
542 * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
546 * TTs should only be known to the hub driver, and high speed bus
554 struct usb_device *hub; /* upstream highspeed hub */ member
576 /* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
590 /* class requests from the USB 2.0 hub spec, table 11-15 */
606 /*-------------------------------------------------------------------------*/
608 /* class requests from USB 3.1 hub spec, table 10-7 */
617 /* Trying not to use worst-case bit-stuffing
629 /* 4 full-speed bit times (est.) */
637 * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed
653 /*-------------------------------------------------------------------------*/
658 /*-------------------------------------------------------------------------*/
686 /*-------------------------------------------------------------------------*/
701 if (bus->monitored) in usbmon_urb_submit()
702 (*mon_ops->urb_submit)(bus, urb); in usbmon_urb_submit()
708 if (bus->monitored) in usbmon_urb_submit_error()
709 (*mon_ops->urb_submit_error)(bus, urb, error); in usbmon_urb_submit_error()
715 if (bus->monitored) in usbmon_urb_complete()
716 (*mon_ops->urb_complete)(bus, urb, status); in usbmon_urb_complete()
732 /*-------------------------------------------------------------------------*/
736 /* This rwsem is for use only by the hub driver and ehci-hcd.