📄 x75.html
字号:
<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN"><HTML><HEAD><TITLE>Enumeration and Device Descriptors</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet"><LINKREL="HOME"TITLE="The Linux USB sub-system"HREF="book1.html"><LINKREL="UP"TITLE="USB Introduction"HREF="c15.html"><LINKREL="PREVIOUS"TITLE="USB Devices and Transfer Characteristics"HREF="x33.html"><LINKREL="NEXT"TITLE="USB Device Drivers"HREF="x119.html"></HEAD><BODY><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The Linux USB sub-system</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="x33.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 1. USB Introduction</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x119.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN75">Enumeration and Device Descriptors</A></H1><P>Whenever a USB device is attached to the bus it will be enumerated by the USBsubsystem - i.e an unique device number (1-127) is assigned and then thedevice descriptor is read. The desciptor is a data structure whichcontains information about the device and its properties. The USB standarddefines a hierarchy of descriptors (see <AHREF="x75.html#FIGDESCRIPTOR">Figure 1-2</A>).</P><DIVCLASS="FIGURE"><P><B><ANAME="FIGDESCRIPTOR">Figure 1-2. USB Descriptor</A></B></P><P><IMGSRC="descr.gif"></P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN82">Standard Descriptors</A></H2><P> <P></P><UL><LI><P>A <ICLASS="EMPHASIS">Device Descriptor</I> describes generalinformation about a USB device. It includes information that applies globally tothe device and all of the device s configurations. A USB device has only onedevice descriptor.</P></LI><LI><P>The <ICLASS="EMPHASIS">Configuration Descriptor</I> givesinformation about a specific device configuration. A USB device has one or moreconfiguration descriptors. Each configuration has one or more interfaces andeach interface has zero or more endpoints. An endpoint is not shared amongdifferent interfaces within a single configuration, although a singleinterface can have several <ICLASS="EMPHASIS">alternate settings</I>which may use the same endpoint. Endpoints may be shared amonginterfaces that are part of different configurations without this restriction.Configurations can only be activated by the standard control transfer<SPANCLASS="SYSTEMITEM">set_configuration</SPAN>.Different configurations can be used to change global device settings, such aspower consumption.</P></LI><LI><P>An <ICLASS="EMPHASIS">Interface Descriptor</I> describes aspecific interface within a configuration. A configuration provides one or moreinterfaces, each with zero or more endpoint descriptors describing a unique setof endpoints within the configuration. An interface may include alternatesettings that allow the endpoints and/or their characteristics to be variedafter the device has been configured. The default setting for an interface isalways alternate setting zero. Alternate settings can be selected exclusively bythe standard control transfer <SPANCLASS="SYSTEMITEM">set_interface</SPAN>. For example amultifunctional device like a video camera with internal microphone could havethree alternate settings to change the bandwidth allocation on the bus.<P></P><TABLEBORDER="0"><TR><TD>Camera activated</TD></TR><TR><TD>Microphone activated</TD></TR><TR><TD>Camera and microphone activated</TD></TR></TABLE><P></P> </P></LI><LI><P>An <ICLASS="EMPHASIS">Endpoint Descriptor</I> containsinformation required by the host to determine the bandwidth requirements of eachendpoint. An endpoint represents a logical data source or sink of a USB device.The endpoint zero is used for all control transfers and there is never adescriptor for this endpoint. The USB specification uses theterms pipe and endpoint interchangably.</P></LI><LI><P><ICLASS="EMPHASIS">String Descriptors</I> are optional andprovide additional information in human readable unicode format. They can beused for vendor and device names or serial numbers.</P></LI></UL></P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN108">Device Classes</A></H2><P>The standard device and interface descriptors contain fields that are relatedto classification: class, sub-class and protocol. These fields may be used bya host system to associate a device or interface to a driver, depending on howthey are specified by the class specification. Valid valuesfor the class fields of the device and interface descriptors are defined bythe USB Device Working Group.</P><P>Grouping devices or interfaces together in classes and thenspecifying the characteristics in a Class Specification allows the developmentof host software which can manage multiple implementations based on thatclass. Such host software adapts its operation to a specific device orinterface using descriptive information presented by the device. A classspecification serves as a framework defining the minimum operation of alldevices or interfaces which identify themselves as members of the class.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN112">Human Interface Devices (HID)</A></H2><P>The HID class consists primarily of devices that are used by humans tocontrol the operation of computer systems. Typical examples of HID class devicesinclude:<P></P><TABLEBORDER="0"><TR><TD>Keyboards and pointing devices for example, standard mouse devices,trackballs, and joysticks.</TD></TR><TR><TD>Front-panel controls for example: knobs, switches, buttons, and sliders.</TD></TR><TR><TD>Controls that might be found on devices such as telephones, VCR remotecontrols, games or simulation devices for example: data gloves, throttles,steering wheels, and rudder pedals.</TD></TR></TABLE><P></P></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="x33.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="book1.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="x119.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">USB Devices and Transfer Characteristics</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="c15.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">USB Device Drivers</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -