• Home
  • Raw
  • Download

Lines Matching +full:usb3 +full:- +full:lpm +full:- +full:capable

1 /* SPDX-License-Identifier: GPL-2.0 */
14 #include <linux/errno.h> /* for -ENODEV */
30 /*-------------------------------------------------------------------------*/
33 * Host-side wrappers for standard USB descriptors ... these are parsed
37 * - devices have one (usually) or more configs;
38 * - configs have one (often) or more interfaces;
39 * - interfaces have one (usually) or more settings;
40 * - each interface setting has zero or (usually) more endpoints.
41 * - a SuperSpeed endpoint has a companion descriptor
45 * Devices may also have class-specific or vendor-specific descriptors.
51 * struct usb_host_endpoint - host-side endpoint descriptor and queue
62 * @streams: number of USB-3 streams allocated on the endpoint
81 /* host-side wrapper for one interface setting's parsed descriptors */
174 * struct usb_interface - what usb device drivers talk to
190 * @ep_devs_created: endpoint child pseudo-devices exist
192 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
194 * @needs_altsetting0: flag set when a set-interface request for altsetting 0
196 * @needs_binding: flag set when the driver should be re-probed or unbound
223 * All standards-conformant USB devices that use isochronous endpoints
224 * will use them in non-default settings.
265 return dev_get_drvdata(&intf->dev); in usb_get_intfdata()
270 dev_set_drvdata(&intf->dev, data); in usb_set_intfdata()
314 * struct usb_interface_cache - long-term representation of a device interface
317 * @altsetting: variable-length array of interface structures, one for
325 * providing support for the /sys/kernel/debug/usb/devices pseudo-file.
331 /* variable-length array of alternate settings for this interface,
341 * struct usb_host_config - representation of a device's configuration
360 * for example, a dual-speed device would have separate configurations for
361 * full-speed and high-speed operation. The number of configurations
367 * are supposed to be numbered from 0 to desc.bNumInterfaces-1, but a lot
400 /* USB2.0 and USB3.0 device BOS descriptor set */
415 __usb_get_extra_descriptor((ifpoint)->extra, \
416 (ifpoint)->extralen, \
419 /* ----------------------------------------------------------------------- */
440 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
450 * round-robin allocation */
467 unsigned resuming_ports; /* bit array: resuming root-hub ports */
470 struct mon_bus *mon_bus; /* non-null when associated */
471 int monitored; /* non-zero when monitored */
477 /* ----------------------------------------------------------------------- */
499 * USB 2.0 Link Power Management (LPM) parameters.
507 /* Timeout value in microseconds for the L1 inactivity (LPM) timer.
508 * When the timer counts to zero, the parent hub will initiate a LPM
515 * USB 3.0 Link Power Management (LPM) parameters.
517 * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit.
518 * MEL is the USB 3.0 Link PM latency for host-initiated LPM exit.
530 * Maximum exit latency for a device-initiated LPM transition to bring
540 * receive the data packet. Basically, SEL should be the worse-case
548 * will initiate an LPM transition to either U1 or U2.
554 * struct usb_device - kernel's representation of a USB device
560 * @rx_lanes: number of rx lanes in use, USB 3.2 adds dual-lane support
561 * @tx_lanes: number of tx lanes in use, USB 3.2 adds dual-lane support
589 * FIXME -- complete doc
592 * @lpm_capable: device supports LPM
593 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
594 * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM
595 * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled
596 * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled
597 * @usb3_lpm_u1_enabled: USB3 hardware U1 LPM enabled
598 * @usb3_lpm_u2_enabled: USB3 hardware U2 LPM enabled
616 * @l1_params: best effor service latency for USB2 L1 LPM state, and L1 timeout.
617 * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout.
618 * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout.
624 * parent->hub_delay + wHubDelay + tTPTransmissionDelay (40ns)
629 * Usbcore drivers should not set usbdev->state directly. Instead use
719 return to_usb_device(intf->dev.parent); in interface_to_usbdev()
728 * usb_hub_for_each_child - iterate over all child devices on the hub
735 port1 <= hdev->maxchild; \
740 #define usb_lock_device(udev) device_lock(&(udev)->dev)
741 #define usb_unlock_device(udev) device_unlock(&(udev)->dev)
742 #define usb_lock_device_interruptible(udev) device_lock_interruptible(&(udev)->dev)
743 #define usb_trylock_device(udev) device_trylock(&(udev)->dev)
781 pm_runtime_mark_last_busy(&udev->dev); in usb_mark_last_busy()
821 if (udev->speed < USB_SPEED_SUPER || !udev->bos || !udev->bos->ss_cap) in usb_device_supports_ltm()
823 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT; in usb_device_supports_ltm()
828 return udev && udev->bus && udev->bus->no_sg_constraint; in usb_device_no_sg_constraint()
832 /*-------------------------------------------------------------------------*/
847 /* used these for multi-interface device registration */
852 * usb_interface_claimed - returns true iff an interface is claimed
866 return (iface->dev.driver != NULL); in usb_interface_claimed()
895 * usb_make_path - returns stable device path in the usb tree
906 * reconfigured, by re-cabling a tree of USB devices or by moving USB host
909 * neither does rebooting or re-enumerating. These are more useful identifiers
922 actual = snprintf(buf, size, "usb-%s-%s", dev->bus->bus_name, in usb_make_path()
923 dev->devpath); in usb_make_path()
924 return (actual >= (int)size) ? -1 : actual; in usb_make_path()
927 /*-------------------------------------------------------------------------*/
945 * USB_DEVICE - macro used to describe a specific usb device
957 * USB_DEVICE_VER - describe a specific usb device with a version range
974 * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class
990 * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol
1006 * USB_DEVICE_INTERFACE_NUMBER - describe a usb device with a specific interface number
1022 * USB_DEVICE_INFO - macro used to describe a class of usb devices
1037 * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces
1052 * USB_DEVICE_AND_INTERFACE_INFO - describe a specific usb device with a class of usb interfaces
1063 * vendor specific bDeviceClass values, but standards-compliant interfaces.
1075 * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
1085 * vendor specific bDeviceClass values, but standards-compliant interfaces.
1095 /* ----------------------------------------------------------------------- */
1116 * struct usbdrv_wrap - wrapper for driver-model structure
1117 * @driver: The driver-model core driver structure.
1118 * @for_devices: Non-zero for device drivers, 0 for interface drivers.
1126 * struct usb_driver - identifies USB interface driver to usbcore
1131 * usb_set_intfdata() to associate driver-specific data with the
1134 * return -ENODEV, if genuine IO errors occurred, an appropriate
1147 * Instead, let the resume or reset-resume routine recover from
1165 * @drvwrap: Driver-model core structure wrapper.
1174 * occurs. Device-initiated USB 3.0 link PM will still be allowed.
1222 * struct usb_device_driver - identifies USB device driver to usbcore
1228 * to associate driver-specific data with the device. If unwilling
1237 * @drvwrap: Driver-model core structure wrapper.
1270 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
1302 * module_usb_driver() - Helper macro for registering a USB driver
1324 /* ----------------------------------------------------------------------- */
1331 * urb->transfer_flags:
1336 #define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired
1338 #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
1340 #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
1349 #define URB_DMA_MAP_SINGLE 0x00010000 /* Non-scatter-gather mapping */
1350 #define URB_DMA_MAP_PAGE 0x00020000 /* HCD-unsupported S-G */
1351 #define URB_DMA_MAP_SG 0x00040000 /* HCD-supported S-G */
1352 #define URB_MAP_LOCAL 0x00080000 /* HCD-local-memory mapping */
1354 #define URB_SETUP_MAP_LOCAL 0x00200000 /* HCD-local setup packet */
1355 #define URB_DMA_SG_COMBINED 0x00400000 /* S-G entries were combined */
1378 INIT_LIST_HEAD(&anchor->urb_list); in init_usb_anchor()
1379 init_waitqueue_head(&anchor->wait); in init_usb_anchor()
1380 spin_lock_init(&anchor->lock); in init_usb_anchor()
1386 * struct urb - USB Request Block
1403 * @status: This is read in non-iso completion functions to get the
1406 * each frame is in the fields of the iso_frame-desc.
1431 * @actual_length: This is read in non-iso completion functions, and
1450 * request-specific driver context.
1476 * the device driver is DMA-aware. For example, a device driver might
1487 * capable, assign NULL to it, so that usbmon knows not to use the value.
1531 * transfer was scheduled. Ranges for frame counter values are HC-specific
1549 * unlinked URBs, and status for all non-ISO transfers. It should not
1555 * When the completion callback is invoked for non-isochronous URBs, the
1585 int status; /* (return) non-ISO status */
1607 /* ----------------------------------------------------------------------- */
1610 * usb_fill_control_urb - initializes a control urb
1632 urb->dev = dev; in usb_fill_control_urb()
1633 urb->pipe = pipe; in usb_fill_control_urb()
1634 urb->setup_packet = setup_packet; in usb_fill_control_urb()
1635 urb->transfer_buffer = transfer_buffer; in usb_fill_control_urb()
1636 urb->transfer_buffer_length = buffer_length; in usb_fill_control_urb()
1637 urb->complete = complete_fn; in usb_fill_control_urb()
1638 urb->context = context; in usb_fill_control_urb()
1642 * usb_fill_bulk_urb - macro to help initialize a bulk urb
1662 urb->dev = dev; in usb_fill_bulk_urb()
1663 urb->pipe = pipe; in usb_fill_bulk_urb()
1664 urb->transfer_buffer = transfer_buffer; in usb_fill_bulk_urb()
1665 urb->transfer_buffer_length = buffer_length; in usb_fill_bulk_urb()
1666 urb->complete = complete_fn; in usb_fill_bulk_urb()
1667 urb->context = context; in usb_fill_bulk_urb()
1671 * usb_fill_int_urb - macro to help initialize a interrupt urb
1704 urb->dev = dev; in usb_fill_int_urb()
1705 urb->pipe = pipe; in usb_fill_int_urb()
1706 urb->transfer_buffer = transfer_buffer; in usb_fill_int_urb()
1707 urb->transfer_buffer_length = buffer_length; in usb_fill_int_urb()
1708 urb->complete = complete_fn; in usb_fill_int_urb()
1709 urb->context = context; in usb_fill_int_urb()
1711 if (dev->speed == USB_SPEED_HIGH || dev->speed >= USB_SPEED_SUPER) { in usb_fill_int_urb()
1715 urb->interval = 1 << (interval - 1); in usb_fill_int_urb()
1717 urb->interval = interval; in usb_fill_int_urb()
1720 urb->start_frame = -1; in usb_fill_int_urb()
1751 * usb_urb_dir_in - check if an URB describes an IN transfer
1754 * Return: 1 if @urb describes an IN transfer (device-to-host),
1759 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN; in usb_urb_dir_in()
1763 * usb_urb_dir_out - check if an URB describes an OUT transfer
1766 * Return: 1 if @urb describes an OUT transfer (host-to-device),
1771 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; in usb_urb_dir_out()
1798 /*-------------------------------------------------------------------*
1800 *-------------------------------------------------------------------*/
1865 * struct usb_sg_request - support for scatter/gather I/O
1914 /* ----------------------------------------------------------------------- */
1922 * - direction: bit 7 (0 = Host-to-Device [Out],
1923 * 1 = Device-to-Host [In] ...
1925 * - device address: bits 8-14 ... bit positions known to uhci-hcd
1926 * - endpoint: bits 15-18 ... bit positions known to uhci-hcd
1927 * - pipe type: bits 30-31 (00 = isochronous, 01 = interrupt,
1955 return (dev->devnum << 8) | (endpoint << 15); in __create_pipe()
1980 eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out; in usb_pipe_endpoint()
1984 /*-------------------------------------------------------------------------*/
1994 ep = udev->ep_out[epnum]; in usb_maxpacket()
1997 ep = udev->ep_in[epnum]; in usb_maxpacket()
2003 return usb_endpoint_maxp(&ep->desc); in usb_maxpacket()
2006 /* ----------------------------------------------------------------------- */
2013 case -ENOMEM: in usb_translate_errors()
2014 case -ENODEV: in usb_translate_errors()
2015 case -EOPNOTSUPP: in usb_translate_errors()
2018 return -EIO; in usb_translate_errors()