USB FAQ: Introductory Level

Updated: August 25, 2008

This paper presents frequently asked questions from developers who are new to developing USB devices and drivers that work with Windows operating systems. Unless otherwise specified, the answers to these questions are targeted at Windows 2000 and later operating systems.

See also:USB FAQ - Intermediate

On This Page

   Introduction Introduction
Windows Support and USB Windows Support and USB
USB Class Drivers USB Class Drivers
   Power Management and USB Power Management and USB


Introduction

Windows operating systems include native support for devices and systems that comply with the Universal Serial Bus (USB) specification. This article provides answers to frequently asked questions from driver developers about the USB stack and features that are supported in USB.

This FAQ is for developers who are new to developing USB devices and drivers for Windows. An intermediate FAQ is available at http://msdn.microsoft.com/en-us/windows/hardware/gg487321.aspx.

Additional documentation for USB device and driver support is available in the current version of the Windows Driver Kit (WDK), through the MSDN developer program library, and on the Windows USB Web site at http://msdn.microsoft.com/en-us/windows/hardware/gg463155.aspx.

Windows Support and USB

Does my PC have USB 2.0 ports?

Most desktop and portable computers that were sold after 2002 are USB 2.0 enabled. USB 2.0 enabled means that the computer has one or more USB enhanced host controllers. To determine whether your computer has a USB enhanced host controller, follow these steps:

  1. Start Device Manager.
    In Windows Vista or Windows Server 2008, click Start and, under All Programs in the Start Search text box, type:
    devmgmt.msc
    When the User Account Control dialog box appears, click Continue to open Device Manager.
    -or-
    In earlier versions of Windows, click Start, click Run, and in the Run dialog box, type:
    devmgmt.msc

  2. In the Device Manager window, expand the Universal Serial Bus controllers node. Look for a host controller with the word "Enhanced" in the title. If you find one, the system has USB 2.0 capable ports and has the necessary host controller drivers.

    Figure 2

    Figure 1: Enhanced host controller with drivers loaded

  3. If you do not find an enhanced host controller in step 2, expand the Other Devices node and look for Universal Serial Bus (USB) Controller. If you find this item, the system has USB 2.0 capable ports, but you must install drivers for this host controller. If you do not find this item, the system has no USB 2.0 ports.

    Figure 3

    Figure 2: Enhanced host controller without drivers loaded

Do I need to install drivers for my enhanced (USB 2.0) host controller?

The following versions of Windows support the USB 2.0 enhanced host controller:

  • Windows Server 2008

  • Windows Vista

  • Windows Server 2003

  • Windows XP Service Pack 1

  • Windows 2000 Service Pack 4

Note: Because Windows 2000 and Windows XP were released before USB 2.0 hardware was available, the drivers were released for those operating systems in the service packs.

To install drivers:

  1. Follow the procedure that was described in the answer to the first question to verify that your computer has USB 2.0 ports and that you need to install a driver for the enhanced host controller.

  2. In the Device Manager window, expand the Other Devices section as explained in the first question, and then double-click Universal Serial Bus (USB) Controller.

  3. On the General tab of the Properties dialog box, click Reinstall Driver.

    Figure 3

    Figure 3. Properties window for EHCI with no drivers

  4. In the Add New Hardware Wizard, select Install the software automatically (Recommended), and then click Next. Continue with the wizard, accepting all default options, until you reach the last page of the wizard, and then click Finish. You might be required to restart your computer to finish the installation.

For additional information about the availability of USB 2.0 in Windows XP Service Pack 1, see Microsoft Knowledge Base article 329632, "How to obtain and to install USB 2.0 drivers in Windows XP Service Pack 1" at http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q329632&.

Note
To ensure that you have the latest updates installed on your machine, visit Windows Update regularly.

Is there a difference between a "Hi-Speed USB 2.0 device" and a "USB 2.0 device"?

Yes. The USB 2.0 specification covers three speed modes:

  • Low speed, up to 1.5 Mbps.

  • Full speed, up to 12 Mbps.

  • Hi-Speed, up to 480 Mbps.

The USB 2.0 specification added Hi-Speed support while maintaining support for low speed and full speed.

Why do I see several host controllers on my system?

Most host controllers on computers that are running Windows are compliant with one of the three USB host controller specifications. However, each specification supports only a subset of USB 2.0 device speeds, as summarized in Table 1.

 Table 1: Host Controllers and Device Speeds Supported

Type of host controller USB device speeds supported
USB Enhanced Host Controller (EHCI)Hi-Speed
USB Universal Host Controller (UHCI)Full speed and low speed
USB Open Host Controller (OHCI)Full speed and low speed



Type of host controllerUSB device speeds supportedUSB Enhanced Host Controller (EHCI)Hi-Speed USB Universal Host Controller (UHCI)Full speed and low speedUSB Open Host Controller (OHCI)Full speed and low speed

Motherboards that support USB 2.0 must have at least one USB enhanced host controller. They also usually have one or more UHCI or OHCI controllers to support full-speed and low-speed devices.

To ensure compatibility, independent hardware vendors must test their devices on all host controller standards and hubs.

Can I disable the "HI-SPEED USB Device plugged into non-HI-SPEED port" notice?

Windows XP and later versions of Windows create a pop-up notice when a Hi-Speed USB 2.0 device is plugged into a USB port that does not support Hi-Speed. To obtain the fastest performance from the device, users must click the notice and follow the instructions on the screen.

The best way to prevent this notice from appearing is to install a USB 2.0 hub that is Hi-Speed certified or purchase a USB 2.0 EHCI Peripheral Component Interconnect (PCI) add-in card. You can then attach a Hi-Speed USB 2.0 device to these Hi-Speed enabled ports. Most systems sold since 2003 already have USB 2.0 Hi-Speed enabled ports.

To disable the notice, follow these steps:

  1. Start Device Manager, as described in the first question in this FAQ.

  2. In the Device Manager window, expand the Universal Serial Bus controllers node. Look for a host controller with the word "Universal" or "Open" in the title. If you find one, double-click it.

  3. On the Advanced tab of the Properties dialog box, select Don't tell me about USB errors.

Note
Following this procedure disables all USB notices, not just "HI-SPEED USB Device plugged into non-HI-SPEED port".

For additional information about USB 2.0 support in Windows XP Service Pack 1, see Microsoft Knowledge Base article 329632, "How to obtain and to install USB 2.0 drivers in Windows XP Service Pack 1, at http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q329632.

What are acceptable values for the bcdUSB field?

The bcdUSB field in the standard device descriptor must accurately report the USB specification release number with which the device and its descriptors are compliant with.

Windows operating systems accept the following values in this field:

  • 0x0110 (USB 1.1)

  • 0x0200 (USB 2.0)

Note
All USB hubs must be compliant with USB 1.1 or later. They should not report 0x0100 in the bcdUSB field.

Failure to correctly report these values can cause a device to fail Windows logo testing. For details on these tests, see http://msdn.microsoft.com/en-us/windows/hardware/gg463010.aspx.

Is it possible to have a composite and a compound device in one piece of hardware?

Yes. The Microsoft Natural Keyboard Pro, which has a three-port, bus-powered hub, is an example of a compound multifunction USB device that has a composite device attached to port 1. Two additional ports are exposed to the end user.

The device that is attached to port 1 is a low-speed composite device. The device has two interfaces, both of which comply with the USB standard device class definition for human interface devices (HID). The composite device provides two HID interfaces instead of multiplexing all collections over a single HID interface by using top-level collections. This design was chosen for compatibility with older BIOSs.

Why are some of my USB devices reinstalled when they are moved to a new port?

In Windows 2000 and later operating systems, a new physical device object (PDO) is created when a USB device is moved from one port to another. A new PDO is not created if the hardware reports a unique USB serial number.

To reuse the same PDO and to ensure that the device experience is unchanged whether the device is reinserted into the same port or a new port, hardware vendors must store a serial number on their device. According to Windows Logo Program requirements, the serial number must be unique for all devices that share the same device installation identifier.

Is there a list of design recommendations for Hi-Speed product packaging?

The USB-IF has worked with Microsoft and other USB-IF member companies to develop a list of recommendations for independent hardware vendors to include on their packaging. More information is available on the USB Web site at http://www.usb.org/developers/packaging/ This link leaves the Microsoft.com site.

How do I identify the driver versions of USB core stack?

To identify the date and version number of driver (.sys) files on your system, follow these steps:

  1. Start My Computer, and then go to the %windir%\system32\drivers folder.

  2. Right-click the USB driver file that you want to know about, and then click Properties.

  3. The version number of the file is shown on the Version tab.

The following is a list of core USB drivers on Windows XP:

  • Usbport.sys

  • Usbhub.sys

  • Usbehci.sys

  • Usbuhci.sys

  • Ushohci.sys

  • Usbccgp.sys

For additional information on each driver, see the WDK.

Where can I find additional FAQs on USB?

See the USB-IF FAQ page at http://www.usb.org/developers/usbfaq/ This link leaves the Microsoft.com site.

USB Class Drivers

Which USB DWG Classes does Microsoft support?

Windows supports several USB classes that the USB Device Working Group (DWG) has defined. For the current list of USB class specifications and class codes, visit the USB DWG Web site at http://www.usb.org/developers/devclass_docs This link leaves the Microsoft.com site.

Table 2 highlights the USB DWG classes that are supported in Windows and also identifies the versions of Windows that support each class.

Table 2: USB DWG Class Support in Windows

Class Specification bDeviceClass Code Driver Name Windows Support
Bluetooth class0xE0Bthusb.sysWindows Vista
Windows XP
Chip/smart card interface devices (CCID)0x0BUsbccid.sysWindows Server 2008
Windows Vista
Windows Server 2003*
Windows XP*
Windows 2000*
Hub class0x09Usbhub.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Human interface device (HID)0x03Hidusb.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Mass storage class (MSC)0x08Usbstor.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Printing class0x07Usbprint.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Scanning/imaging (PTP)0x06WpdUsb.sys



Usbscan.sys
Windows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Media Transfer (MTP)0x06WpdUsb.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
USB Audio class0x01Usbaudio.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Modem class (CDC)0x02Usbser.sysWindows Server 2008
Windows Vista
Windows Server 2003
Windows XP
Windows 2000
Video class (UVC)0x0EUsbvideo.sysWindows Vista
Windows XP*


*Special instructions are necessary to load this driver because this driver might have been released later than the operating system.

Windows class drivers might not support all of the features that are described in a DWG class specification. For additional details on implemented features within a class specification, see the WDK.

What device setup class should I use for a custom USB device?

Microsoft provides system-defined setup classes for most device types. System-defined setup class GUIDs are defined in Devguid.h. For additional information, see the WDK. If you are developing a device type for which Microsoft has not provided an existing class GUID, you can define a new device setup class.

For a list of Windows class GUIDs, see "System-Supplied Device Setup Classes" in the WDK at http://msdn.microsoft.com/en-us/library/ff553419.aspx.

Important: The USB team requires independent hardware vendors to use the setup class that is associated with the type of USB device, not with the bus type. The setup class "USB" (ClassGuid = {36fc9e60-c465-11cf-8056-444553540000}) is reserved only for USB host controllers and USB hubs, and must not be used for other device categories. Using this setup class incorrectly may cause the device driver to fail Windows logo testing.

Power Management and USB

Why won't my CPU enter C3 when I attach some USB devices?

When a USB device is connected, the USB host controller polls the frame scheduler, which is a direct memory access (DMA) bus master operation. "Break events" such as bus master traffic, interrupts, or several other system activities move a CPU out of C3 because, by definition, the CPU's cache cannot be snooped while it is in C3.

There are two ways to work around this issue:

  • Hardware removal.
    Sometimes the hardware can be electronically disconnected from the Universal Serial Bus. For example, when storage media is removed from the USB reader, the USB reader can emulate an electronic disconnect and reconnect when the media is reinserted. In this case, the C3 transitions can occur because no USB devices are on the host controller.

  • Selective Suspend.
    The only alternative available in Windows XP and later operating systems is to support USB Selective Suspend. This feature lets a driver suspend a USB device that it controls when the device becomes idle, even though the system itself remains in a fully operational power state (S0).
    Selective Suspend is especially powerful if all USB function drivers support it. If even one driver does not support it, the CPU cannot enter C3.
    For additional information on Selective Suspend, see the WDK.

Which USB class drivers support Selective Suspend?

The following is a list of USB class drivers in Windows XP and later operating systems that support Selective Suspend:

  • Usbhub.sys
    This driver can selectively suspend a root or external hub when no devices are attached to it or when all devices that are attached to that hub can be selectively suspended.

  • Hidusb.sys
    This driver can selectively suspend an HID device. It is your responsibility to trigger remote wake signaling on all device state changes. To enable Selective Suspend in the HID stack, the SelectiveSuspendEnabled registry value must be enabled for the specific VID+PID of the device. For examples, see Input.inf.

  • Bthusb.sys
    This driver can selectively suspend devices on computers that are running Windows XP Service Pack 2 and later versions of Windows. The driver requires the Bluetooth radio to set the self-powered and remote wake bits in the configuration descriptor. The driver selectively suspends the Bluetooth radio when no active Bluetooth connections exist.

  • Usbser.sys
    This driver can selectively suspend when no active modem connections exist.

If enough original equipment manufacturers ask for it, Microsoft might consider supporting Selective Suspend for additional class drivers. Work is also being investigated on future hardware architectures (CPUs, chipsets, and the operating system) to mitigate the problems.

Why can't a USB device awaken Windows from S3?

A USB device cannot awaken Windows from S3 for several reasons, including the following:

  • Incorrect BIOS.
    Verify that the latest BIOS is installed on the computer. To obtain the latest BIOS revision for the computer, visit the Web site of the OEM or ODM.

  • BIOS that is not enabled to wake.
    Some BIOSs make it possible to disable wake from S3 and S4. Verify that the BIOS is enabled to wake from S3.

  • USBBIOSx registry key not being set.
    A clean installation of Windows XP does not have the USBBIOSx registry key. If the OEM or ODM validates that the BIOS can wake from S3, you must set this registry key to 0x00 and restart the computer

    .

For additional information, see the USB troubleshooter in the Help and Support Center in Windows XP and later versions of Windows.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值