How can I check whether USB3.0 UASP (USB Attached SCSI Protocol) mode is enabled in Linux?

If you know the name of your device, find the USB Bus and Device numbers:

$ lsusb
...
Bus 002 Device 005: ID xxxx:yyyy MyDeviceManufacturer
...

Then look at the USB tree and find your device (mine was Bus 2, Dev 5):

$ lsusb -t
...
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 2: Dev 5, If 0, Class=Mass Storage, Driver=uas, 5000M
    |__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
...

You can see in my case the uas driver.

If UAS is not in use you would see usb-storage (like Dev 3 in my case).


In addition to the answer austinmarton gave, you can run

lsusb -v -d VPID | grep -i interface

where VPID is the vendor/product ID reported in lsusb. For example:

$ lsusb -v -d 1234:5678 | grep -i interface
Couldn't open device, some information will be missing
  bDeviceClass            0 (Defined at Interface level)
    bNumInterfaces          1
    Interface Descriptor:
      bInterfaceNumber        0
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              6 

Notice that the only bInterfaceProtocol value listed is 80 Bulk-Only. This device would not be a UASP-configured device. However, if you see an additional bInterfaceProtocol 98, this would be a UASP-configured device.

These values are given in decimal, but the spec refers to them by their hex values...

50h (80d): USB Mass Storage Class Bulk-Only (BBB) Transport
62h (98d): Allocated by USB-IF for UAS. 

This information can be found in the Mass Storage Specification on usb.org, section 3 Protocol Codes, Table 2 — Mass Storage Transport Protocol.

I'm not sure if this answers your first or second questions, though, since it's unclear if this value would be reported on both machines/devices that do support UASP and those that do not.


To complete the answer:

If your controller does not support UAS, the linux kernel is kind enough to tell you so:

$ dmesg | grep "UAS"
[58669.959610] usb 4-2: USB controller 0000:03:00.0 does not support streams, which are required by the UAS driver.
[58669.959613] usb 4-2: Please try an other USB controller if you wish to use UAS.

Also, lsusb shows a line for bInterfaceProtocol 98, but it is empty:

$ lsusb -v -d 0080:a001 | grep -i interface
bDeviceClass            0 (Defined at Interface level)
  bNumInterfaces          1
  Interface Descriptor:
    bInterfaceNumber        0
    bInterfaceClass         8 Mass Storage
    bInterfaceSubClass      6 SCSI
    bInterfaceProtocol     80 Bulk-Only
    iInterface              0 
  Interface Descriptor:
    bInterfaceNumber        0
    bInterfaceClass         8 Mass Storage
    bInterfaceSubClass      6 SCSI
    bInterfaceProtocol     98 
    iInterface              0

HTH,

R. Daneel olivaw,
The Human Robot Inside.