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

I have a laptop running Ubuntu 15.04 (3.19.0-21-generic) and an external USB3.0 2.5" SATA HDD enclosure which claims that it supports UASP mode (the S2510BPU33 model by StarTech). I have no problems mounting the drive or reading/writing to it.

I'd like to be able to confirm the following:

  1. That the device itself actually supports UASP
  2. Whether my chipset also supports UASP
  3. Whether the device is using UASP when I mount it

Whereabouts can I find this information?


Solution 1:

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).

Solution 2:

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.

Solution 3:

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.