USB Storage - FAQ for Driver and Hardware DevelopersUpdated: October 28, 2010 This paper is for developers who are new to developing USB Mass Storage Class devices that work with the Windows family of operating systems. On This Page
IntroductionStarting with Microsoft Windows 2000, Windows operating systems contain native support for devices that are compliant with the Universal Serial Bus (USB) Mass Storage Class Specification. If the USB bus driver enumerates a mass-storage-class-compliant device on a computer running Windows, it automatically loads the USB storage port driver (Usbstor.sys) for that device. This article provides answers to frequently asked questions from driver developers about Usbstor.sys. Additional documentation for Usbstor.sys and driver support for USB mass storage devices is available in the current version of the Windows Driver Kit (WDK), available through the MSDN Library and from the WDK website at http://msdn.microsoft.com/en-us/windows/hardware/gg454508.aspx. Windows Support and Usbstor.sys
Q. What versions of the Windows operating system support USB storage using Usbstor.sys as the storage port driver?
USB mass storage class devices are supported by Usbstor.sys, which is loaded using Plug and Play (PnP) hardware identifier (HWID) or compatible identifier matching in Usbstor.inf.
Q. Can a USB storage device be the primary (and only) means of storage?
For more information and to review the latest WinHEC presentations for ideas see http://msdn.microsoft.com/en-us/windows/hardware/gg463520.
Q. Can a host simultaneously have multiple, individual USB storage devices on a system?
Q. Can a USB Mass Storage Interface have multiple alternative interfaces?
Q. Can a device have multiple logical units per target device?
Refer to the KB articles Q324953 and Q316857 to find the Quick Fix Engineering (QFE) support for multiple logical units on Windows 2000. This QFE is also available in Windows 2000 Service Pack 3 (SP3). For more information about how multiple logical unit USB storage devices appear to the operating system, see the WDK.
Q. What problems and updates are known to affect storage solutions on earlier versions of the Windows operating system?
A QFE is available to fix this issue in Windows 2000. Refer to KB article Q283787, titled “Multifunction USB Device Cannot Transfer 4 KB or Larger Files” for further information. This QFE is also available in Windows 2000 Service Pack 3 (SP3). Contact your Microsoft Technical Account Manager (TAM) for additional information.
Q. Do customers need a new USB storage driver now that USB 2.0 is available?
Q. Does Usbstor.sys need to be modified to support disks over 137 GB in size?
USB-ATA bridge chip vendors are working on new devices that support the 48-bit ATA LBA mode, but they will not be in production until later in 2002. When these devices are available, the storage limit on a single device should be 2048 GB.
Q. Can Usbstor.sys fail a query remove?
Q. Can a vendor use SCSI pass through to talk to a USB storage device and send it vendor-specific commands?
Usbstor.sys and Device Class Support
Q. Which device classes does Usbstor.sys understand?
bInterfaceSubClass == 06h - Or - bInterfaceSubClass != 06h The value bInterfaceSubClass == 06h means that: Command descriptor blocks (CDBs) should not be padded to 12 bytes. Mode Sense / Mode Select commands should not be translated from 1AH / 15h to 5AH / 55h. Subclass 0x06 should generally be used for flash memory devices. The value bInterfaceSubClass != 06h means that: CDBs should be padded to 12 bytes. Mode Sense / Mode Select commands should be translated from 1AH / 15h to 5AH / 55h. Q. Should IHVs use Bulk-Only or CBI for new USB storage devices?
Q. I am developing a new USB storage device but I want to load my OWN transport driver and NOT use Usbstor.sys. What should I do? To load a vendor-specific driver and NOT use Usbstor.sys, do the following:
Q. Does Windows currently support USB storage devices that use RBC protocol (that is, USB Storage Specification SubClass 0x01)? In addition, Usbstor.inf does not have a compatible ID match for a USB RBC class device. Consequently, your USB storage device will not load Usbstor.sys when you plug it in to a new Windows XP system. You will need to provide your own INF and drivers to support this device. We do not recommend the use of RBC class devices for current Windows operating systems. Q. What must I do to trigger AutoRun on my USB storage device? The removable media device setting is a flag contained within the SCSI Inquiry Data response to the SCSI Inquiry command. Bit 7 of byte 1 (indexed from 0) is the Removable Media Bit (RMB). An RMB set to zero indicates that the device is not a removable media device. An RMB of one indicates that the device is a removable media device. Drivers obtain this information by using the StorageDeviceProperty request. For more information about the SCSI Inquiry command, see http://www.t10.org For more information about StorageDeviceProperty, see the STORAGE_DEVICE_DESCRIPTOR storage structure in the WDK documentation at http://msdn.microsoft.com/en-gb/library/ff566971(VS.85).aspx. For more information on Autorun.inf files see "Creating an AutoRun-Enabled Application" at http://msdn2.microsoft.com/en-us/library/aa969330.aspx. Q. Can Windows show a special icon for a drive in My Computer? For complete details, see “Personalized Icons for Devices on Windows XP” at http://msdn.microsoft.com/en-us/windows/hardware/gg463124. Usbstor.sys and Windows Logo RequirementsQ. Must a USB storage device contain a unique serial number? A unique serial number on a USB device maintains the same device node (devnode) as a user moves the device from USB port to port. This unique devnode ensures that properties (icons, policies, driver letters, and so on) associated with the device are not reset when the device is moved to a new port or when a second device with the same VID/PID/REV is added to the system. IHVs must ensure that a device’s serial number is unique in order for that device to comply with Windows operating systems. A Windows Logo Program requirement states that, if your device includes a serial number, the serial number must be unique for each instance of your device. For more information about the Windows Logo Kit (WLK) test for USB serial numbers, see ”USB Serial Number” on MSDN. Q. Where can I get a list of requirements for Windows operating systems and storage devices? Refer to the WDK documentation for additional details and requirements for USB storage devices in order to be compatible with Usbstor.sys. Usbstor.sys and Power ManagementQ. I want to embed a storage device inside a laptop, but still want to conserve power. What should I consider in this design? The Selective Suspend feature allows drivers to idle the host controller, any empty USB hubs including the Root Hub, and the full range of USB devices supported by the operating system. Windows XP does NOT natively support Selective Suspend in Usbstor.sys. Alternatively, if you design your storage solution as a compound device and place the bridge chip behind a USB hub, you can then emulate device removal upon media removal. Windows XP, Windows Vista, and Windows 7 interpret the emulation to understand that the storage device has been removed from the USB hub. An empty hub will then be selectively suspended by the USB stack. For your implementation of this solution to work properly, the compound device’s hub must not be more than one hub away from the root hub. Although this solution might reduce power consumption, it will also make the USB storage device disappear from Device Manager and My Computer. Q. Should my USB device set the remote wake bit on the USB storage device’s configuration descriptor? Q. Did the removal policies for USB storage devices change after Microsoft Windows 2000? To mitigate the likelihood of data loss in surprise removal scenarios, Windows XP refined the caching policy for removable storage. Windows XP refined the caching policy for removable storage. Starting with Windows XP, for consumer-oriented removable storage (USB, Flash, Zip, and so on), write caching is disabled by default. Disabling write caching means that, instead of saving up changes for a file on a removable storage device and then doing a bulk write, Windows XP writes changes to the file as the changes are made. This keeps data on removable storage devices more current, mitigating the likelihood of data loss. However, disabling write caching also has a performance impact. To view removable properties associated with a USB storage device, open Device Manager, select the storage device’s properties, and see the Policies tab. Call to Action and ResourcesCall to Action:
Resources: Microsoft Hardware and Driver Developer Information Windows Driver Kit (WDK) Windows Logo Program USB Serial Number |
|

