📄 c-hoststack.html
字号:
<dd><p class="table"><table border="0" cellpadding="2" cellspacing="0"><tr valign="top"><td colspan=1 rowspan=1></td><td><hr></td></tr><tr valign="top"><td><img border="0" alt="*" src="icons/note.gif"> </td><td colspan=1 rowspan=1><div class="CalloutCell"><a name="85448"></a><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b>The <b class="library">usbTool</b> utility resides in <b class="file">target/config/comps/src</b> and is called <b class="file">usrUsbTool.c</b>.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1></td><td colspan=1 rowspan=1><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p><dl class="margin"><dd><div class="Item"><a name="85454"></a><b class="library">cmdParser</b></div><dl class="margin"><dd><div class="Follow"><a name="85455"></a>This module provides generalized command-line parsing functions used by <b class="library">usbTool</b>. The <b class="library">cmdParser</b> module needs to be present only when <b class="library">usbTool</b> is being used.</div><br></dl><dd><div class="Item"><a name="85456"></a><b class="library">usbKeyboardLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85457"></a>This module is the USB class driver for USB keyboard devices; for more information, see <a href="c-hostStack.html#85966"><i class="title">1.5 Keyboard Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85461"></a><b class="library">usbMouseLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85462"></a>This module is the USB class driver for USB mouse devices; for more information, see <a href="c-hostStack.html#86013"><i class="title">1.6 Mouse Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85466"></a><b class="library">usbPrinterLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85467"></a>This module is the USB class driver for USB printer devices; for more information, see <a href="c-hostStack.html#86051"><i class="title">1.7 Printer Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85471"></a><b class="library">usbSpeakerLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85472"></a>This module is the USB class driver for USB speaker devices; for more information, see <a href="c-hostStack.html#86083"><i class="title">1.8 Speaker Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85476"></a><b class="library">usbBulkDevLib <br></b>and <b class="library">usbCbiUfiDevLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85477"></a>These modules are the USB class drivers for USB Mass Storage Class devices; for more information, see <a href="c-hostStack.html#86136"><i class="title">1.9 Mass Storage Class Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85481"></a><b class="library">usbPegasusEndLib</b>, <br><b class="library">usbKlsiEndLib</b>, <br>and <b class="library">usbNC1080EndLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85482"></a>These modules are the USB class drivers for USB Ethernet Networking Control Model Communication Class devices; for more information, see <a href="c-hostStack.html#86300"><i class="title">1.10.1 Ethernet Networking Control Model Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85486"></a><b class="library">usbAcmLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85487"></a>This module is the USB class driver for USB Abstract Control Model Communication Class devices; for more information, see <a href="c-hostStack.html#86379"><i class="title">1.10.2 Abstract Control Model Driver</i></a>.</div><br></dl><dd><div class="Item"><a name="85491"></a><b class="library">usbdLib <br></b>and <b class="library">usbdCoreLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85492"></a>These modules contain the functionality of the Wind River USBD. The <b class="library">usbdLib</b> module contains the USBD functions available to USB client modules; and <b class="library">usbdCoreLib</b> exports a single entry point, <b class="routine">usbdCoreEntry( )</b>, which is used internally by <b class="library">usbdLib</b> and is never called directly by other modules.</div><br></dl><dd><div class="Item"><a name="85493"></a><b class="library">usbHcdLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85494"></a>This module provides routines to invoke each of the services provided by a USB HCD. It is used by <b class="library">usbdCoreLib</b> to communicate with underlying HCDs. The routines in <b class="library">usbHcdLib</b> are not called directly by modules other than <b class="library">usbdCoreLib</b>.</div><br></dl><dd><div class="Item"><a name="85495"></a><b class="library">usbHcdUhciLib <br></b>and <b class="library">usbHcdOhciLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85496"></a>The <b class="library">usbHcdUhciLib</b> and <b class="library">usbHcdOhciLib</b> modules are the HCDs for UHCI and OHCI host controllers, respectively. All hardware-dependent code for a host controller is contained in the HCD. Each HCD exports a single entry point, generally with a name of the form <b class="routine">usbHcd</b><i class="textVariable">Xxxx</i><b class="routine">Exec( )</b>, and all communication with the HCD is performed through this routine. There is no direct link between the USBD and any underlying HCDs; that is, the USBD has no prior knowledge of which HCDs will be loaded in a given system. Each HCD's entry point is exposed to the USBD during a process called <i class="term">HCD attachment</i>; for more information, see <a href="c-hostStack.html#85523"><i class="title">Attaching and Detaching HCDs</i></a>.</div><br></dl><dd><div class="Item"><a name="85500"></a><b class="library">usbPciLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85501"></a>The module <b class="library">usbPciLib</b> exists conceptually; however, it is available in the form of BSP-dependent files of the format <b class="file">target/config/</b><i class="textVariable">BSP</i><b class="file">/usbPciStub.c</b>. This module provides HCDs with an abstracted view of the underlying PCI hardware and software in a system (both UHCI and OHCI host controllers are implemented with PCI interfaces). So, while different Wind River BSPs use the standard Wind River PCI libraries in different ways, the <b class="library">usbPciLib</b> stub files shield the HCDs from variations among BSPs. This allows HCDs to be written independent of the underlying BSP and promotes portability of HCDs across BSP platforms.</div><br></dl><dd><div class="Item"><a name="85502"></a><b class="library">ossLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85503"></a>This module provides an abstracted and simplified view of VxWorks operating system services to the USB driver stack. It includes routines that manage tasks, mutexes, semaphores, memory allocation, and system time.</div><br></dl><dd><div class="Item"><a name="85504"></a><b class="library">usbLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85505"></a>This module provides a mixed collection of USB utility functions shared by various modules. The USBD, HCDs, and certain USB class drivers make use of one or more functions in this module. For example:</div><br></dl><dl class="margin"><dd><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="85506"></a>The <b class="library">usbLib</b> module contains routines that the USBD and HCD use to determine the amount of bandwidth a specified pipe requires.</li></ul></p><dd><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="85507"></a>Other <b class="library">usbLib</b> routines provide the functionality that allows class drivers to issue commands to devices using the device's control pipe. </li></ul></p></dl><dd><div class="Item"><a name="85508"></a><b class="library">usbQueueLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85509"></a>This module provides an abstracted queue model used by several of the modules in the USB driver stack, principally <b class="library">usbdCoreLib</b>. The <b class="library">usbdCoreLib</b> module uses these queuing services to pass messages among internal <b class="library">usbdCoreLib</b> tasks.</div><br></dl><dd><div class="Item"><a name="85510"></a><b class="library">usbHandleLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85511"></a>This module provides an abstracted handle allocation and validation library used by several of the modules in the USB driver stack. The USB driver stack uses handles to prevent callers from passing invalid device and pipe references to the stack. The USB stack also uses the handle mechanism internally to prevent background <b class="library">usbdCoreLib</b> tasks from performing operations on stale data structures. The handle validation mechanisms are optimized and introduce negligible overhead.</div><br></dl><dd><div class="Item"><a name="85512"></a><b class="library">usbListLib</b></div><dl class="margin"><dd><div class="Follow"><a name="85513"></a>This module provides a generalized set of functions to operate on doubly-linked lists. These functions are used by most of the modules in the USB driver stack, and most data structures in the USB driver stack belong to one or more lists at any given time.</div><br></dl></dl></dl><br class="H2"><a name="85515"></a><br class="H2navbar"><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i>1.3 The USB Host Driver (USBD)</i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85516"></a>This section describes typical use of the USBD: activities such as initialization, client registration, dynamic attachment registration, device configuration, and data transfers. It also discusses key features of the USBD's internal design.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85517"></a>1.3.1 Initializing the USBD</i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85518"></a>Initializing the USBD is a two-step process. First, the USBD's entry point, <b class="routine">usbdInitialize( )</b>, must be called at least once. The <b class="routine">usbdInitialize( )</b> routine initializes internal USBD data structures and, in turn, calls the initialization entry points of other modules in the USB driver stack. In a given system, it is acceptable to call <b class="routine">usbdInitialize( )</b> once (perhaps during the boot sequence) or to call it many times (as during the initialization of each USBD client). The USBD maintains a usage count that is incremented for each successful call to <b class="routine">usbdInitialize( )</b> and decremented for each corresponding call to <b class="routine">usbdShutdown( )</b>. The USBD only truly initializes itself when the usage count goes from zero to one, and it only truly "shuts down" when the usage count returns to zero.</p><dd><p class="Body"><a name="85519"></a>The following code fragment illustrates the proper initialization and shutdown of the USBD:</p></dl><dl class="margin"><dd><font color="0000a0"><pre class="Code"><a name="85520"></a> ... /* Initialize the USBD. */ if (usbdInitialize () != OK) return ERROR; ... ... /* application code. */ ... ... /* Shut down the USBD. Note: we only execute this code if the return * code from usbdInitialize() was OK. Note also that there's really no * reason to check the result of usbdShutdown(). */ usbdShutdown ();</pre></font></dl><dl class="margin"><dd><p class="Body"><a name="85521"></a>The second step of USBD initialization is to attach at least one HCD to the USBD, using the USBD's <b class="routine">usbdHcdAttach( )</b> routine. Normally, the attachment of HCDs to the USBD happens during the VxWorks boot sequence. However, the USBD is designed to allow HCDs to be attached (and detached) at run-time. This flexibility allows the USBD to support systems in which USB host controllers can be "hotswapped" without restarting the system.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85523"></a>Attaching and Detaching HCDs</i></h4></font><dl class="margin">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -