xhci: dbc: Provide sysfs option to configure dbc descriptors
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 17 Mar 2023 15:47:09 +0000 (17:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Mar 2023 16:25:22 +0000 (17:25 +0100)
commitedf1664f3249a091a2b91182fc087b3253b0b4c2
tree918498c17a1bc58093dac442d4429dc04ee3b802
parent4feb07d0ada339f7edc0dc3b24581f201848a65b
xhci: dbc: Provide sysfs option to configure dbc descriptors

When DbC is enabled the first port on the xHC host acts as a usb device.
xHC provides the descriptors automatically when the DbC device is
enumerated. Most of the values are hardcoded, but some fields such as
idProduct, idVendor, bcdDevice and bInterfaceProtocol can be modified.

Add sysfs entries that allow userspace to change these.
User can only change them before dbc is enabled, i.e. before writing
"enable" to dbc sysfs file as we don't want these values to change while
device is connected, or during  enumeration.

Add documentation for these entries in
Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230317154715.535523-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-bus-pci-drivers-xhci_hcd
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-dbgcap.h