1*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/INTERFACE/authorized 2*4882a593SmuzhiyunDate: August 2015 3*4882a593SmuzhiyunDescription: 4*4882a593Smuzhiyun This allows to authorize (1) or deauthorize (0) 5*4882a593Smuzhiyun individual interfaces instead a whole device 6*4882a593Smuzhiyun in contrast to the device authorization. 7*4882a593Smuzhiyun If a deauthorized interface will be authorized 8*4882a593Smuzhiyun so the driver probing must be triggered manually 9*4882a593Smuzhiyun by writing INTERFACE to /sys/bus/usb/drivers_probe 10*4882a593Smuzhiyun This allows to avoid side-effects with drivers 11*4882a593Smuzhiyun that need multiple interfaces. 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun A deauthorized interface cannot be probed or claimed. 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/usbX/interface_authorized_default 16*4882a593SmuzhiyunDate: August 2015 17*4882a593SmuzhiyunDescription: 18*4882a593Smuzhiyun This is used as value that determines if interfaces 19*4882a593Smuzhiyun would be authorized by default. 20*4882a593Smuzhiyun The value can be 1 or 0. It's by default 1. 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunWhat: /sys/bus/usb/device/.../authorized 23*4882a593SmuzhiyunDate: July 2008 24*4882a593SmuzhiyunKernelVersion: 2.6.26 25*4882a593SmuzhiyunContact: David Vrabel <david.vrabel@csr.com> 26*4882a593SmuzhiyunDescription: 27*4882a593Smuzhiyun Authorized devices are available for use by device 28*4882a593Smuzhiyun drivers, non-authorized one are not. By default, wired 29*4882a593Smuzhiyun USB devices are authorized. 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun Certified Wireless USB devices are not authorized 32*4882a593Smuzhiyun initially and should be (by writing 1) after the 33*4882a593Smuzhiyun device has been authenticated. 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunWhat: /sys/bus/usb/device/.../wusb_cdid 36*4882a593SmuzhiyunDate: July 2008 37*4882a593SmuzhiyunKernelVersion: 2.6.27 38*4882a593SmuzhiyunContact: David Vrabel <david.vrabel@csr.com> 39*4882a593SmuzhiyunDescription: 40*4882a593Smuzhiyun For Certified Wireless USB devices only. 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun A devices's CDID, as 16 space-separated hex octets. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunWhat: /sys/bus/usb/device/.../wusb_ck 45*4882a593SmuzhiyunDate: July 2008 46*4882a593SmuzhiyunKernelVersion: 2.6.27 47*4882a593SmuzhiyunContact: David Vrabel <david.vrabel@csr.com> 48*4882a593SmuzhiyunDescription: 49*4882a593Smuzhiyun For Certified Wireless USB devices only. 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun Write the device's connection key (CK) to start the 52*4882a593Smuzhiyun authentication of the device. The CK is 16 53*4882a593Smuzhiyun space-separated hex octets. 54*4882a593Smuzhiyun 55*4882a593SmuzhiyunWhat: /sys/bus/usb/device/.../wusb_disconnect 56*4882a593SmuzhiyunDate: July 2008 57*4882a593SmuzhiyunKernelVersion: 2.6.27 58*4882a593SmuzhiyunContact: David Vrabel <david.vrabel@csr.com> 59*4882a593SmuzhiyunDescription: 60*4882a593Smuzhiyun For Certified Wireless USB devices only. 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun Write a 1 to force the device to disconnect 63*4882a593Smuzhiyun (equivalent to unplugging a wired USB device). 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunWhat: /sys/bus/usb/drivers/.../new_id 66*4882a593SmuzhiyunDate: October 2011 67*4882a593SmuzhiyunContact: linux-usb@vger.kernel.org 68*4882a593SmuzhiyunDescription: 69*4882a593Smuzhiyun Writing a device ID to this file will attempt to 70*4882a593Smuzhiyun dynamically add a new device ID to a USB device driver. 71*4882a593Smuzhiyun This may allow the driver to support more hardware than 72*4882a593Smuzhiyun was included in the driver's static device ID support 73*4882a593Smuzhiyun table at compile time. The format for the device ID is: 74*4882a593Smuzhiyun idVendor idProduct bInterfaceClass RefIdVendor RefIdProduct 75*4882a593Smuzhiyun The vendor ID and device ID fields are required, the 76*4882a593Smuzhiyun rest is optional. The `Ref*` tuple can be used to tell the 77*4882a593Smuzhiyun driver to use the same driver_data for the new device as 78*4882a593Smuzhiyun it is used for the reference device. 79*4882a593Smuzhiyun Upon successfully adding an ID, the driver will probe 80*4882a593Smuzhiyun for the device and attempt to bind to it. For example:: 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun # echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun Here add a new device (0458:7045) using driver_data from 85*4882a593Smuzhiyun an already supported device (0458:704c):: 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun # echo "0458 7045 0 0458 704c" > /sys/bus/usb/drivers/foo/new_id 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun Reading from this file will list all dynamically added 90*4882a593Smuzhiyun device IDs in the same format, with one entry per 91*4882a593Smuzhiyun line. For example:: 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun # cat /sys/bus/usb/drivers/foo/new_id 94*4882a593Smuzhiyun 8086 10f5 95*4882a593Smuzhiyun dead beef 06 96*4882a593Smuzhiyun f00d cafe 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun The list will be truncated at PAGE_SIZE bytes due to 99*4882a593Smuzhiyun sysfs restrictions. 100*4882a593Smuzhiyun 101*4882a593SmuzhiyunWhat: /sys/bus/usb-serial/drivers/.../new_id 102*4882a593SmuzhiyunDate: October 2011 103*4882a593SmuzhiyunContact: linux-usb@vger.kernel.org 104*4882a593SmuzhiyunDescription: 105*4882a593Smuzhiyun For serial USB drivers, this attribute appears under the 106*4882a593Smuzhiyun extra bus folder "usb-serial" in sysfs; apart from that 107*4882a593Smuzhiyun difference, all descriptions from the entry 108*4882a593Smuzhiyun "/sys/bus/usb/drivers/.../new_id" apply. 109*4882a593Smuzhiyun 110*4882a593SmuzhiyunWhat: /sys/bus/usb/drivers/.../remove_id 111*4882a593SmuzhiyunDate: November 2009 112*4882a593SmuzhiyunContact: CHENG Renquan <rqcheng@smu.edu.sg> 113*4882a593SmuzhiyunDescription: 114*4882a593Smuzhiyun Writing a device ID to this file will remove an ID 115*4882a593Smuzhiyun that was dynamically added via the new_id sysfs entry. 116*4882a593Smuzhiyun The format for the device ID is: 117*4882a593Smuzhiyun idVendor idProduct. After successfully 118*4882a593Smuzhiyun removing an ID, the driver will no longer support the 119*4882a593Smuzhiyun device. This is useful to ensure auto probing won't 120*4882a593Smuzhiyun match the driver to the device. For example: 121*4882a593Smuzhiyun # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun Reading from this file will list the dynamically added 124*4882a593Smuzhiyun device IDs, exactly like reading from the entry 125*4882a593Smuzhiyun "/sys/bus/usb/drivers/.../new_id" 126*4882a593Smuzhiyun 127*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../power/usb2_hardware_lpm 128*4882a593SmuzhiyunDate: September 2011 129*4882a593SmuzhiyunContact: Andiry Xu <andiry.xu@amd.com> 130*4882a593SmuzhiyunDescription: 131*4882a593Smuzhiyun If CONFIG_PM is set and a USB 2.0 lpm-capable device is plugged 132*4882a593Smuzhiyun in to a xHCI host which support link PM, it will perform a LPM 133*4882a593Smuzhiyun test; if the test is passed and host supports USB2 hardware LPM 134*4882a593Smuzhiyun (xHCI 1.0 feature), USB2 hardware LPM will be enabled for the 135*4882a593Smuzhiyun device and the USB device directory will contain a file named 136*4882a593Smuzhiyun power/usb2_hardware_lpm. The file holds a string value (enable 137*4882a593Smuzhiyun or disable) indicating whether or not USB2 hardware LPM is 138*4882a593Smuzhiyun enabled for the device. Developer can write y/Y/1 or n/N/0 to 139*4882a593Smuzhiyun the file to enable/disable the feature. 140*4882a593Smuzhiyun 141*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../power/usb3_hardware_lpm_u1 142*4882a593Smuzhiyun /sys/bus/usb/devices/.../power/usb3_hardware_lpm_u2 143*4882a593SmuzhiyunDate: November 2015 144*4882a593SmuzhiyunContact: Kevin Strasser <kevin.strasser@linux.intel.com> 145*4882a593Smuzhiyun Lu Baolu <baolu.lu@linux.intel.com> 146*4882a593SmuzhiyunDescription: 147*4882a593Smuzhiyun If CONFIG_PM is set and a USB 3.0 lpm-capable device is plugged 148*4882a593Smuzhiyun in to a xHCI host which supports link PM, it will check if U1 149*4882a593Smuzhiyun and U2 exit latencies have been set in the BOS descriptor; if 150*4882a593Smuzhiyun the check is passed and the host supports USB3 hardware LPM, 151*4882a593Smuzhiyun USB3 hardware LPM will be enabled for the device and the USB 152*4882a593Smuzhiyun device directory will contain two files named 153*4882a593Smuzhiyun power/usb3_hardware_lpm_u1 and power/usb3_hardware_lpm_u2. These 154*4882a593Smuzhiyun files hold a string value (enable or disable) indicating whether 155*4882a593Smuzhiyun or not USB3 hardware LPM U1 or U2 is enabled for the device. 156*4882a593Smuzhiyun 157*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../removable 158*4882a593SmuzhiyunDate: February 2012 159*4882a593SmuzhiyunContact: Matthew Garrett <mjg@redhat.com> 160*4882a593SmuzhiyunDescription: 161*4882a593Smuzhiyun Some information about whether a given USB device is 162*4882a593Smuzhiyun physically fixed to the platform can be inferred from a 163*4882a593Smuzhiyun combination of hub descriptor bits and platform-specific data 164*4882a593Smuzhiyun such as ACPI. This file will read either "removable" or 165*4882a593Smuzhiyun "fixed" if the information is available, and "unknown" 166*4882a593Smuzhiyun otherwise. 167*4882a593Smuzhiyun 168*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../ltm_capable 169*4882a593SmuzhiyunDate: July 2012 170*4882a593SmuzhiyunContact: Sarah Sharp <sarah.a.sharp@linux.intel.com> 171*4882a593SmuzhiyunDescription: 172*4882a593Smuzhiyun USB 3.0 devices may optionally support Latency Tolerance 173*4882a593Smuzhiyun Messaging (LTM). They indicate their support by setting a bit 174*4882a593Smuzhiyun in the bmAttributes field of their SuperSpeed BOS descriptors. 175*4882a593Smuzhiyun If that bit is set for the device, ltm_capable will read "yes". 176*4882a593Smuzhiyun If the device doesn't support LTM, the file will read "no". 177*4882a593Smuzhiyun The file will be present for all speeds of USB devices, and will 178*4882a593Smuzhiyun always read "no" for USB 1.1 and USB 2.0 devices. 179*4882a593Smuzhiyun 180*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX 181*4882a593SmuzhiyunDate: August 2012 182*4882a593SmuzhiyunContact: Lan Tianyu <tianyu.lan@intel.com> 183*4882a593SmuzhiyunDescription: 184*4882a593Smuzhiyun The /sys/bus/usb/devices/.../(hub interface)/portX 185*4882a593Smuzhiyun is usb port device's sysfs directory. 186*4882a593Smuzhiyun 187*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX/connect_type 188*4882a593SmuzhiyunDate: January 2013 189*4882a593SmuzhiyunContact: Lan Tianyu <tianyu.lan@intel.com> 190*4882a593SmuzhiyunDescription: 191*4882a593Smuzhiyun Some platforms provide usb port connect types through ACPI. 192*4882a593Smuzhiyun This attribute is to expose these information to user space. 193*4882a593Smuzhiyun The file will read "hotplug", "hardwired" and "not used" if the 194*4882a593Smuzhiyun information is available, and "unknown" otherwise. 195*4882a593Smuzhiyun 196*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX/location 197*4882a593SmuzhiyunDate: October 2018 198*4882a593SmuzhiyunContact: Bjørn Mork <bjorn@mork.no> 199*4882a593SmuzhiyunDescription: 200*4882a593Smuzhiyun Some platforms provide usb port physical location through 201*4882a593Smuzhiyun firmware. This is used by the kernel to pair up logical ports 202*4882a593Smuzhiyun mapping to the same physical connector. The attribute exposes the 203*4882a593Smuzhiyun raw location value as a hex integer. 204*4882a593Smuzhiyun 205*4882a593Smuzhiyun 206*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX/quirks 207*4882a593SmuzhiyunDate: May 2018 208*4882a593SmuzhiyunContact: Nicolas Boichat <drinkcat@chromium.org> 209*4882a593SmuzhiyunDescription: 210*4882a593Smuzhiyun In some cases, we care about time-to-active for devices 211*4882a593Smuzhiyun connected on a specific port (e.g. non-standard USB port like 212*4882a593Smuzhiyun pogo pins), where the device to be connected is known in 213*4882a593Smuzhiyun advance, and behaves well according to the specification. 214*4882a593Smuzhiyun This attribute is a bit-field that controls the behavior of 215*4882a593Smuzhiyun a specific port: 216*4882a593Smuzhiyun 217*4882a593Smuzhiyun - Bit 0 of this field selects the "old" enumeration scheme, 218*4882a593Smuzhiyun as it is considerably faster (it only causes one USB reset 219*4882a593Smuzhiyun instead of 2). 220*4882a593Smuzhiyun 221*4882a593Smuzhiyun The old enumeration scheme can also be selected globally 222*4882a593Smuzhiyun using /sys/module/usbcore/parameters/old_scheme_first, but 223*4882a593Smuzhiyun it is often not desirable as the new scheme was introduced to 224*4882a593Smuzhiyun increase compatibility with more devices. 225*4882a593Smuzhiyun - Bit 1 reduces TRSTRCY to the 10 ms that are required by the 226*4882a593Smuzhiyun USB 2.0 specification, instead of the 50 ms that are normally 227*4882a593Smuzhiyun used to help make enumeration work better on some high speed 228*4882a593Smuzhiyun devices. 229*4882a593Smuzhiyun 230*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX/over_current_count 231*4882a593SmuzhiyunDate: February 2018 232*4882a593SmuzhiyunContact: Richard Leitner <richard.leitner@skidata.com> 233*4882a593SmuzhiyunDescription: 234*4882a593Smuzhiyun Most hubs are able to detect over-current situations on their 235*4882a593Smuzhiyun ports and report them to the kernel. This attribute is to expose 236*4882a593Smuzhiyun the number of over-current situation occurred on a specific port 237*4882a593Smuzhiyun to user space. This file will contain an unsigned 32 bit value 238*4882a593Smuzhiyun which wraps to 0 after its maximum is reached. This file supports 239*4882a593Smuzhiyun poll() for monitoring changes to this value in user space. 240*4882a593Smuzhiyun 241*4882a593Smuzhiyun Any time this value changes the corresponding hub device will send a 242*4882a593Smuzhiyun udev event with the following attributes:: 243*4882a593Smuzhiyun 244*4882a593Smuzhiyun OVER_CURRENT_PORT=/sys/bus/usb/devices/.../(hub interface)/portX 245*4882a593Smuzhiyun OVER_CURRENT_COUNT=[current value of this sysfs attribute] 246*4882a593Smuzhiyun 247*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../(hub interface)/portX/usb3_lpm_permit 248*4882a593SmuzhiyunDate: November 2015 249*4882a593SmuzhiyunContact: Lu Baolu <baolu.lu@linux.intel.com> 250*4882a593SmuzhiyunDescription: 251*4882a593Smuzhiyun Some USB3.0 devices are not friendly to USB3 LPM. usb3_lpm_permit 252*4882a593Smuzhiyun attribute allows enabling/disabling usb3 lpm of a port. It takes 253*4882a593Smuzhiyun effect both before and after a usb device is enumerated. Supported 254*4882a593Smuzhiyun values are "0" if both u1 and u2 are NOT permitted, "u1" if only u1 255*4882a593Smuzhiyun is permitted, "u2" if only u2 is permitted, "u1_u2" if both u1 and 256*4882a593Smuzhiyun u2 are permitted. 257*4882a593Smuzhiyun 258*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../power/usb2_lpm_l1_timeout 259*4882a593SmuzhiyunDate: May 2013 260*4882a593SmuzhiyunContact: Mathias Nyman <mathias.nyman@linux.intel.com> 261*4882a593SmuzhiyunDescription: 262*4882a593Smuzhiyun USB 2.0 devices may support hardware link power management (LPM) 263*4882a593Smuzhiyun L1 sleep state. The usb2_lpm_l1_timeout attribute allows 264*4882a593Smuzhiyun tuning the timeout for L1 inactivity timer (LPM timer), e.g. 265*4882a593Smuzhiyun needed inactivity time before host requests the device to go to L1 sleep. 266*4882a593Smuzhiyun Useful for power management tuning. 267*4882a593Smuzhiyun Supported values are 0 - 65535 microseconds. 268*4882a593Smuzhiyun 269*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../power/usb2_lpm_besl 270*4882a593SmuzhiyunDate: May 2013 271*4882a593SmuzhiyunContact: Mathias Nyman <mathias.nyman@linux.intel.com> 272*4882a593SmuzhiyunDescription: 273*4882a593Smuzhiyun USB 2.0 devices that support hardware link power management (LPM) 274*4882a593Smuzhiyun L1 sleep state now use a best effort service latency value (BESL) to 275*4882a593Smuzhiyun indicate the best effort to resumption of service to the device after the 276*4882a593Smuzhiyun initiation of the resume event. 277*4882a593Smuzhiyun If the device does not have a preferred besl value then the host can select 278*4882a593Smuzhiyun one instead. This usb2_lpm_besl attribute allows to tune the host selected besl 279*4882a593Smuzhiyun value in order to tune power saving and service latency. 280*4882a593Smuzhiyun 281*4882a593Smuzhiyun Supported values are 0 - 15. 282*4882a593Smuzhiyun More information on how besl values map to microseconds can be found in 283*4882a593Smuzhiyun USB 2.0 ECN Errata for Link Power Management, section 4.10) 284*4882a593Smuzhiyun 285*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../rx_lanes 286*4882a593SmuzhiyunDate: March 2018 287*4882a593SmuzhiyunContact: Mathias Nyman <mathias.nyman@linux.intel.com> 288*4882a593SmuzhiyunDescription: 289*4882a593Smuzhiyun Number of rx lanes the device is using. 290*4882a593Smuzhiyun USB 3.2 adds Dual-lane support, 2 rx and 2 tx lanes over Type-C. 291*4882a593Smuzhiyun Inter-Chip SSIC devices support asymmetric lanes up to 4 lanes per 292*4882a593Smuzhiyun direction. Devices before USB 3.2 are single lane (rx_lanes = 1) 293*4882a593Smuzhiyun 294*4882a593SmuzhiyunWhat: /sys/bus/usb/devices/.../tx_lanes 295*4882a593SmuzhiyunDate: March 2018 296*4882a593SmuzhiyunContact: Mathias Nyman <mathias.nyman@linux.intel.com> 297*4882a593SmuzhiyunDescription: 298*4882a593Smuzhiyun Number of tx lanes the device is using. 299*4882a593Smuzhiyun USB 3.2 adds Dual-lane support, 2 rx and 2 tx -lanes over Type-C. 300*4882a593Smuzhiyun Inter-Chip SSIC devices support asymmetric lanes up to 4 lanes per 301*4882a593Smuzhiyun direction. Devices before USB 3.2 are single lane (tx_lanes = 1) 302