Hi, I’m Ram Valliyappan and I am a Program Manager on the Windows team responsible for USB mass storage drivers. We often get asked the following questions:
· What is USB-IF compliance for USB mass storage devices?
· What is SCSI compliance for USB mass storage devices?
· Why is compliance for USB mass storage devices important?
I will answer these questions in this post.
It is very important for USB devices to be compliant with the USB specification. This allows the device to interoperate on a Windows platform and deliver the best user experience.
The USB-IF compliance is certification program that is defined by the USB standards body. This program verifies that a device complies with the interfaces that are defined by the USB specification. If a USB device passes the compliance tests, the device is added to the Integrators List that is published by the USB standards body. Also, the independent hardware vendor (IHV) can license the USB-IF Logo for devices that are compliant with the USB-IF compliance program.
For more information, please refer to the USB-IF Compliance program.
SCSI compliance is verified through a set of Windows Logo Kit (WLK) tests. These tests verify that a block storage device is compliant with SCSI standards and specifications, such as the SCSI Primary Commands (SPC) and SCSI Block Commands (SBC). For more information about the SCI compliance tests, please refer to the MSDN documentation on SCSI Compliance.
The Windows storage driver stack is developed by using industry standards and expects device to be compliant to same standards. With each new Windows release, the driver stack has expanded its dependency on SCSI commands. Because of this, it is extremely important that the storage device provides the SCSI functionality that the driver stack requires. As a result, the WLK SCSI compliance tests are revised with each new Windows release to verify this requirement with storage devices.
To guarantee that USB devices can interoperate with the Windows storage driver stack and deliver the best user experience, we introduced the SCSI compliance tests for USB in the WLK 1.6. For more information about these tests, please refer to the MSDN documentation on the USB 2.0 and 3.0 SCSI Compliance test. For more information about the WLK and how to download WLK 1.6, please refer to the Windows Logo Kit.
The following provides an overview of the SCSI commands that are verified through the Windows SCSI compliance WLK tests:
Industry specification requirement
Logo test policy (USB Disks)
Logo test policy (USB Card Readers)
Required by industry standards
Mode Select 6
Mode Select 10
Mode Sense 6
Mode Sense 10
Receive Diagnostic Results - ENCSERV = 1
Receive Diagnostic Results - ENCSERV = 0
Report LUNS - UAS
Report LUNS - BOT
Security Protocol IN
Security Protocol OUT
Test Unit Ready
Prevent Allow Medium Removal
Read Capacity 10
Read Capacity 16
Start Stop Unit
If you are qualifying a USB Card Reader device, then please read the following to make sure you support the commands as required for Windows:
Basic verification test
Expect GOOD status and data of size smaller than or equal to 255 bytes
Extended verification test
When allocation length is set to more than 255 bytes, device must not return CHECK condition
PC=non-zero; EVPD=0; expect CHECK CONDITION
Checking if we can retrieve standard inquiry data
Standard INQUIRY data shall contain at least 36 bytes
Expect direct access device
Peripheral qualifier field == 0.
USB3: SPC4; USB2: Don’t care
RESPONSE DATA FORMAT == 2
Additional Length field == Total Data size - 5
VENDOR IDENTIFICATION field contains valid ASCII
PRODUCT IDENTIFICATION field contains valid ASCII
PRODUCT REVISION LEVEL field contains valid ASCII
USB2BOT: no version desc
USB2UAS: UAS version desc
USB3BOT: SPC, SBC version desc
USB3UAS: SPC, SBC, UAS version desc
UAS: CMDQUE=1, BOT: CMDQUE=0
Security protocol IN/OUT
Security Protocol Out Basic Test
Security Protocol IN Basic Test
Report supported OP codes
Basic Verification Test
The device must return GOOD (0x0) SCSI status and 8 bytes of parameter data describing the capacity and medium format of the block device to the data-in buffer.
Expect GOOD status.
Response code test
Expect valid response code
Sense data length test
Additional Sense Length <= Sense data size - 8
Expect GOOD status
Spin down IMMED=0 test
Spin down drive
Spin up IMMED=0 test
Spin up drive
Spin down IMMED=1 (optional)
Spin up IMMED=1 (optional)
Unload test (optional)
The device must read 1000 sequential blocks of data correctly
The device must read 1000 random blocks of data correctly
Disk cached cleared test
Read 12 MB data, read 12 MB random data and read 12 MB initial data again
Read sequential test
Read random test
The command writes 1000 sequential blocks of data correctly
The command writes 1000 random blocks of data correctly
Expect CHECK CONDITION
Check size test
Data Transfer Length >= 4 bytes
Check mode parameter header test
ModeDataLength = Data Transfer Length - 1
Testing to make sure that, when DBD bit is set, no block descriptors are returned
Check data length test
Testing that new data length should equal old data length minus block descriptor length
Compare data test
Testing that page data is the same before and after DBD bit is set
(MANDATORY for UAS, IF-IMPLEMENTED for BOT)
Expect GOOD Status
LUNO test (only UAS)
The device must return GOOD (0x0) SCSI status and data of size smaller than or equal to 255 bytes
Data valid test (only UAS)
Each reported LUN uses single level numbers restricted to <= 255
(Required for USB3)
Invalid service action test
Send RC16 with Invalid SA, get CHECK_CONDITION
Send RC16 and get GOOD Status
Send a READ CAPACITY command to check the reported block address. If the block address is greater than the READ CAPACITY 10 limit, ensure READ CAPACITY 10 block address is set to 0xFFFF_FFFF.
Lowest Aligned LBA test
Verify if the lowest aligned LBA is not greater than number of logical blocks per physical block
With millions of USB mass storage devices in the market, it is extremely important that these devices comply with a common set of standards. Compliant USB mass storage devices deliver the best user experience when they are connected across different Windows platforms.
To verify compliance, we require USB mass storage devices to pass the USB-IF compliance and WLK programs. This guarantees that Windows users get the maximum value out with their USB mass storage devices.
Thanks for reading! In our next blog, we will talk about common device failures, how to avoid them and make device interoperate with Windows well.
Ram Valliyappan (USB Mass Storage)