Merge tag 'usb-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB/Thunderbolt updates from Greg KH:
 "Here is the large set of USB and Thunderbolt changes for 6.12-rc1.

  Nothing "major" in here, except for a new 9p network gadget that has
  been worked on for a long time (all of the needed acks are here)

  Other than that, it's the usual set of:

   - Thunderbolt / USB4 driver updates and additions for new hardware

   - dwc3 driver updates and new features added

   - xhci driver updates

   - typec driver updates

   - USB gadget updates and api additions to make some gadgets more
     configurable by userspace

   - dwc2 driver updates

   - usb phy driver updates

   - usbip feature additions

   - other minor USB driver updates

  All of these have been in linux-next for a long time with no reported
  issues"

* tag 'usb-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (145 commits)
  sub: cdns3: Use predefined PCI vendor ID constant
  sub: cdns2: Use predefined PCI vendor ID constant
  USB: misc: yurex: fix race between read and write
  USB: misc: cypress_cy7c63: check for short transfer
  USB: appledisplay: close race between probe and completion handler
  USB: class: CDC-ACM: fix race between get_serial and set_serial
  usb: r8a66597-hcd: make read-only const arrays static
  usb: typec: ucsi: Fix busy loop on ASUS VivoBooks
  usb: dwc3: rtk: Clean up error code in __get_dwc3_maximum_speed()
  usb: storage: ene_ub6250: Fix right shift warnings
  usb: roles: Improve the fix for a false positive recursive locking complaint
  locking/mutex: Introduce mutex_init_with_key()
  locking/mutex: Define mutex_init() once
  net/9p/usbg: fix CONFIG_USB_GADGET dependency
  usb: xhci: fix loss of data on Cadence xHC
  usb: xHCI: add XHCI_RESET_ON_RESUME quirk for Phytium xHCI host
  usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep
  usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode
  usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk
  usb: misc: onboard_usb_dev: add Microchip usb5744 SMBus programming support
  ...
This commit is contained in:
Linus Torvalds
2024-09-26 09:45:36 -07:00
189 changed files with 3860 additions and 1248 deletions
+6 -2
View File
@@ -254,6 +254,9 @@ struct usb_ctrlrequest {
#define USB_DT_DEVICE_CAPABILITY 0x10
#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
#define USB_DT_WIRE_ADAPTER 0x21
/* From USB Device Firmware Upgrade Specification, Revision 1.1 */
#define USB_DT_DFU_FUNCTIONAL 0x21
/* these are from the Wireless USB spec */
#define USB_DT_RPIPE 0x22
#define USB_DT_CS_RADIO_CONTROL 0x23
/* From the T10 UAS specification */
@@ -329,9 +332,10 @@ struct usb_device_descriptor {
#define USB_CLASS_USB_TYPE_C_BRIDGE 0x12
#define USB_CLASS_MISC 0xef
#define USB_CLASS_APP_SPEC 0xfe
#define USB_CLASS_VENDOR_SPEC 0xff
#define USB_SUBCLASS_DFU 0x01
#define USB_SUBCLASS_VENDOR_SPEC 0xff
#define USB_CLASS_VENDOR_SPEC 0xff
#define USB_SUBCLASS_VENDOR_SPEC 0xff
/*-------------------------------------------------------------------------*/
+89 -8
View File
@@ -3,6 +3,7 @@
#define _UAPI__LINUX_FUNCTIONFS_H__
#include <linux/const.h>
#include <linux/types.h>
#include <linux/ioctl.h>
@@ -37,6 +38,31 @@ struct usb_endpoint_descriptor_no_audio {
__u8 bInterval;
} __attribute__((packed));
/**
* struct usb_dfu_functional_descriptor - DFU Functional descriptor
* @bLength: Size of the descriptor (bytes)
* @bDescriptorType: USB_DT_DFU_FUNCTIONAL
* @bmAttributes: DFU attributes
* @wDetachTimeOut: Maximum time to wait after DFU_DETACH (ms, le16)
* @wTransferSize: Maximum number of bytes per control-write (le16)
* @bcdDFUVersion: DFU Spec version (BCD, le16)
*/
struct usb_dfu_functional_descriptor {
__u8 bLength;
__u8 bDescriptorType;
__u8 bmAttributes;
__le16 wDetachTimeOut;
__le16 wTransferSize;
__le16 bcdDFUVersion;
} __attribute__ ((packed));
/* from DFU functional descriptor bmAttributes */
#define DFU_FUNC_ATT_CAN_DOWNLOAD _BITUL(0)
#define DFU_FUNC_ATT_CAN_UPLOAD _BITUL(1)
#define DFU_FUNC_ATT_MANIFEST_TOLERANT _BITUL(2)
#define DFU_FUNC_ATT_WILL_DETACH _BITUL(3)
struct usb_functionfs_descs_head_v2 {
__le32 magic;
__le32 length;
@@ -104,23 +130,38 @@ struct usb_ffs_dmabuf_transfer_req {
#ifndef __KERNEL__
/*
/**
* DOC: descriptors
*
* Descriptors format:
*
* +-----+-----------+--------------+--------------------------------------+
* | off | name | type | description |
* |-----+-----------+--------------+--------------------------------------|
* +-----+-----------+--------------+--------------------------------------+
* | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 |
* +-----+-----------+--------------+--------------------------------------+
* | 4 | length | LE32 | length of the whole data chunk |
* +-----+-----------+--------------+--------------------------------------+
* | 8 | flags | LE32 | combination of functionfs_flags |
* +-----+-----------+--------------+--------------------------------------+
* | | eventfd | LE32 | eventfd file descriptor |
* +-----+-----------+--------------+--------------------------------------+
* | | fs_count | LE32 | number of full-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | hs_count | LE32 | number of high-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | ss_count | LE32 | number of super-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | os_count | LE32 | number of MS OS descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | fs_descrs | Descriptor[] | list of full-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | hs_descrs | Descriptor[] | list of high-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | ss_descrs | Descriptor[] | list of super-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | os_descrs | OSDesc[] | list of MS OS descriptors |
* +-----+-----------+--------------+--------------------------------------+
*
* Depending on which flags are set, various fields may be missing in the
* structure. Any flags that are not recognised cause the whole block to be
@@ -128,71 +169,111 @@ struct usb_ffs_dmabuf_transfer_req {
*
* Legacy descriptors format (deprecated as of 3.14):
*
* +-----+-----------+--------------+--------------------------------------+
* | off | name | type | description |
* |-----+-----------+--------------+--------------------------------------|
* +-----+-----------+--------------+--------------------------------------+
* | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC |
* +-----+-----------+--------------+--------------------------------------+
* | 4 | length | LE32 | length of the whole data chunk |
* +-----+-----------+--------------+--------------------------------------+
* | 8 | fs_count | LE32 | number of full-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | 12 | hs_count | LE32 | number of high-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
* | | hs_descrs | Descriptor[] | list of high-speed descriptors |
* +-----+-----------+--------------+--------------------------------------+
*
* All numbers must be in little endian order.
*
* Descriptor[] is an array of valid USB descriptors which have the following
* format:
*
* +-----+-----------------+------+--------------------------+
* | off | name | type | description |
* |-----+-----------------+------+--------------------------|
* +-----+-----------------+------+--------------------------+
* | 0 | bLength | U8 | length of the descriptor |
* +-----+-----------------+------+--------------------------+
* | 1 | bDescriptorType | U8 | descriptor type |
* +-----+-----------------+------+--------------------------+
* | 2 | payload | | descriptor's payload |
* +-----+-----------------+------+--------------------------+
*
* OSDesc[] is an array of valid MS OS Feature Descriptors which have one of
* the following formats:
*
* +-----+-----------------+------+--------------------------+
* | off | name | type | description |
* |-----+-----------------+------+--------------------------|
* +-----+-----------------+------+--------------------------+
* | 0 | inteface | U8 | related interface number |
* +-----+-----------------+------+--------------------------+
* | 1 | dwLength | U32 | length of the descriptor |
* +-----+-----------------+------+--------------------------+
* | 5 | bcdVersion | U16 | currently supported: 1 |
* +-----+-----------------+------+--------------------------+
* | 7 | wIndex | U16 | currently supported: 4 |
* +-----+-----------------+------+--------------------------+
* | 9 | bCount | U8 | number of ext. compat. |
* +-----+-----------------+------+--------------------------+
* | 10 | Reserved | U8 | 0 |
* +-----+-----------------+------+--------------------------+
* | 11 | ExtCompat[] | | list of ext. compat. d. |
* +-----+-----------------+------+--------------------------+
*
* +-----+-----------------+------+--------------------------+
* | off | name | type | description |
* |-----+-----------------+------+--------------------------|
* +-----+-----------------+------+--------------------------+
* | 0 | inteface | U8 | related interface number |
* +-----+-----------------+------+--------------------------+
* | 1 | dwLength | U32 | length of the descriptor |
* +-----+-----------------+------+--------------------------+
* | 5 | bcdVersion | U16 | currently supported: 1 |
* +-----+-----------------+------+--------------------------+
* | 7 | wIndex | U16 | currently supported: 5 |
* +-----+-----------------+------+--------------------------+
* | 9 | wCount | U16 | number of ext. compat. |
* +-----+-----------------+------+--------------------------+
* | 11 | ExtProp[] | | list of ext. prop. d. |
* +-----+-----------------+------+--------------------------+
*
* ExtCompat[] is an array of valid Extended Compatiblity descriptors
* which have the following format:
*
* +-----+-----------------------+------+-------------------------------------+
* | off | name | type | description |
* |-----+-----------------------+------+-------------------------------------|
* +-----+-----------------------+------+-------------------------------------+
* | 0 | bFirstInterfaceNumber | U8 | index of the interface or of the 1st|
* +-----+-----------------------+------+-------------------------------------+
* | | | | interface in an IAD group |
* +-----+-----------------------+------+-------------------------------------+
* | 1 | Reserved | U8 | 1 |
* +-----+-----------------------+------+-------------------------------------+
* | 2 | CompatibleID | U8[8]| compatible ID string |
* +-----+-----------------------+------+-------------------------------------+
* | 10 | SubCompatibleID | U8[8]| subcompatible ID string |
* +-----+-----------------------+------+-------------------------------------+
* | 18 | Reserved | U8[6]| 0 |
* +-----+-----------------------+------+-------------------------------------+
*
* ExtProp[] is an array of valid Extended Properties descriptors
* which have the following format:
*
* +-----+-----------------------+------+-------------------------------------+
* | off | name | type | description |
* |-----+-----------------------+------+-------------------------------------|
* +-----+-----------------------+------+-------------------------------------+
* | 0 | dwSize | U32 | length of the descriptor |
* +-----+-----------------------+------+-------------------------------------+
* | 4 | dwPropertyDataType | U32 | 1..7 |
* +-----+-----------------------+------+-------------------------------------+
* | 8 | wPropertyNameLength | U16 | bPropertyName length (NL) |
* +-----+-----------------------+------+-------------------------------------+
* | 10 | bPropertyName |U8[NL]| name of this property |
* +-----+-----------------------+------+-------------------------------------+
* |10+NL| dwPropertyDataLength | U32 | bPropertyData length (DL) |
* +-----+-----------------------+------+-------------------------------------+
* |14+NL| bProperty |U8[DL]| payload of this property |
* +-----+-----------------------+------+-------------------------------------+
*/
struct usb_functionfs_strings_head {
+40
View File
@@ -0,0 +1,40 @@
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
#ifndef __UAPI_LINUX_USB_G_HID_H
#define __UAPI_LINUX_USB_G_HID_H
#include <linux/types.h>
/* Maximum HID report length for High-Speed USB (i.e. USB 2.0) */
#define MAX_REPORT_LENGTH 64
/**
* struct usb_hidg_report - response to GET_REPORT
* @report_id: report ID that this is a response for
* @userspace_req:
* !0 this report is used for any pending GET_REPORT request
* but wait on userspace to issue a new report on future requests
* 0 this report is to be used for any future GET_REPORT requests
* @length: length of the report response
* @data: report response
* @padding: padding for 32/64 bit compatibility
*
* Structure used by GADGET_HID_WRITE_GET_REPORT ioctl on /dev/hidg*.
*/
struct usb_hidg_report {
__u8 report_id;
__u8 userspace_req;
__u16 length;
__u8 data[MAX_REPORT_LENGTH];
__u8 padding[4];
};
/* The 'g' code is used by gadgetfs and hid gadget ioctl requests.
* Don't add any colliding codes to either driver, and keep
* them in unique ranges.
*/
#define GADGET_HID_READ_GET_REPORT_ID _IOR('g', 0x41, __u8)
#define GADGET_HID_WRITE_GET_REPORT _IOW('g', 0x42, struct usb_hidg_report)
#endif /* __UAPI_LINUX_USB_G_HID_H */
+1 -1
View File
@@ -62,7 +62,7 @@ struct usb_gadgetfs_event {
};
/* The 'g' code is also used by printer gadget ioctl requests.
/* The 'g' code is also used by printer and hid gadget ioctl requests.
* Don't add any colliding codes to either driver, and keep
* them in unique ranges (size 0x20 for now).
*/