up to 5000. The default value is 64 ms.
This polling interval is used while DbC is enabled but has no
active data transfers.
+
+What: /sys/bus/pci/drivers/xhci_hcd/.../dbc_serial
+Date: January 2026
+Contact: Łukasz Bartosik <ukaszb@chromium.org>
+Description:
+ The dbc_serial attribute allows to change the serial number
+ string descriptor presented by the debug device when a host
+ requests a string descriptor with iSerialNumber index.
+ Index is found in the iSerialNumber field in the device
+ descriptor.
+ Value can only be changed while debug capability (DbC) is in
+ disabled state to prevent USB device descriptor change while
+ connected to a USB host.
+ The default value is "0001".
+ The field length can be from 1 to 126 characters.
return size;
}
+static ssize_t dbc_serial_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct xhci_hcd *xhci = hcd_to_xhci(dev_get_drvdata(dev));
+ struct xhci_dbc *dbc = xhci->dbc;
+
+ return sysfs_emit(buf, "%s\n", dbc->str.serial);
+}
+
+static ssize_t dbc_serial_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ struct xhci_hcd *xhci = hcd_to_xhci(dev_get_drvdata(dev));
+ struct xhci_dbc *dbc = xhci->dbc;
+ size_t len;
+
+ if (dbc->state != DS_DISABLED)
+ return -EBUSY;
+
+ len = strcspn(buf, "\n");
+ if (!len)
+ return -EINVAL;
+
+ if (len > USB_MAX_STRING_LEN)
+ return -E2BIG;
+
+ memcpy(dbc->str.serial, buf, len);
+ dbc->str.serial[len] = '\0';
+
+ return size;
+}
+
static ssize_t dbc_bInterfaceProtocol_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static DEVICE_ATTR_RW(dbc_idVendor);
static DEVICE_ATTR_RW(dbc_idProduct);
static DEVICE_ATTR_RW(dbc_bcdDevice);
+static DEVICE_ATTR_RW(dbc_serial);
static DEVICE_ATTR_RW(dbc_bInterfaceProtocol);
static DEVICE_ATTR_RW(dbc_poll_interval_ms);
&dev_attr_dbc_idVendor.attr,
&dev_attr_dbc_idProduct.attr,
&dev_attr_dbc_bcdDevice.attr,
+ &dev_attr_dbc_serial.attr,
&dev_attr_dbc_bInterfaceProtocol.attr,
&dev_attr_dbc_poll_interval_ms.attr,
NULL