⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isousb.htm

📁 usb主机驱动 同步端点 用于 语音视频
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">

<TITLE>ISOUSB</TITLE>
</HEAD>
<BODY>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff" leftmargin="8">

<FONT FACE="Verdana"><H2><A NAME="MYSAMPLE"></H2>
<H2>ISOUSB</H2>

<span style="color:#FF0000">[This is preliminary documentation and subject to change.]</span> 

<H3>SUMMARY</H3></FONT><FONT FACE="Verdana" SIZE=2><P>


<FONT size=2>
<P>This  document and the associated sample source code describe how to handle the
transfer of isochronous data to and from a USB peripheral using the USB Driver
Interface (USBDI). </P>
<P>In addition to handling isochronous data transfers, the sample source code
demonstrates the correct way to handle Plug and Play and power management I/O Request
 Packets (IRPs), which are the basic I/O Manager structures used to communicate with
  the minidriver. See the Microsoft Windows&nbsp;NT&nbsp;5.0 DDK for background information
  on the IRPs discussed in this sample. Also see the BulkUsb sample code and documentation
  for an example of a similar USB minidriver designed around Bulk mode IO. This sample is
  closely related to the BulkUsb sample , and was in fact
  developed and tested on the same hardware. For this reason, to avoid repetition, where functionality
  of the IsoUsb sample is the same as in the BulkUsb sample, the reader will be referred to the
  BulkUsb documentation. In particular, the two samples have virtually identical Power management
  and Plug and Play logic. The logic for  symbolic linkage with the Operating System, and
  CreateFile/ReadFile/WriteFile/CloseHandle-based IO is also virtually identical in the two samples.
  </P>
</FONT><B><I><FONT FACE="Arial" SIZE=4><P>What is the USB Driver Interface?</P>
</B></I></FONT><FONT size=2><P>USBDI is part of the WDM layered architecture for the
 Windows&nbsp;98 and Windows&nbsp;NT&nbsp;5.0 operating systems and is the interface
 offered to kernel-mode minidrivers by the operating system USB driver stack. A portion
 of the WDM layered architecture, with the USB driver interface highlighted, is shown
 in Figure 1.</P>
</FONT><B><I><FONT FACE="Arial" size=2><P>Figure 1. USB Driver Interface and the USB
Driver Stack</P>
</B></I></FONT><FONT size=2><P><IMG SRC="IsoUsb.gif" ></P>
</FONT><FONT SIZE=2><P>The following modules are shown in Figure 1:</P>

<UL>
</FONT><FONT size=2><LI>Hidclass.sys is the Human Interface Device (HID) class driver
that sends and receives HID reports to and from its minidrivers.</LI>
<LI>Hidusb.sys is the HID device driver that sends and receives HID reports over the
 USB bus.</LI>
<LI>IsoUsb.sys is the sample minidriver. </LI>
<LI>Usbd.sys is the USB class driver.</LI>
<LI>Uhcd.sys and Openhci.sys are USB host controller drivers (Openhci.sys for the
 Open Host Controller Interface or UHCD.SYS for the Universal Host Controller Driver).</LI>
<LI>PCI Enumerator takes care of loading the USB stack driver components when a USB
bus is detected on a platform and always loads at least the other core components.</LI></UL>

</FONT><FONT size=2><P ALIGN="RIGHT"></P>
</FONT><FONT SIZE=2><P>A USB minidriver communicates with the USB stack through an
IRP interface. There are two basic methods and both are used by IsoUsb.sys:</P>

<UL>
</FONT><FONT size=2><LI>The USB minidriver device driver passes USB request block
 (URB) structures to the next-lower driver as a parameter in an IRP with MajorFunction
  set to IRP_MJ_INTERNAL_DEVICE_CONTROL and the next IRP stack
  location Parameters.DeviceIoControl.IoControlCode field set to
   IOCTL_INTERNAL_USB_SUBMIT_URB. </LI>
<LI>The USB minidriver device driver passes an IRP with MajorFunction set to
 IRP_MJ_INTERNAL_DEVICE_CONTROL and the next IRP stack location
 Parameters.DeviceIoControl.IoControlCode field set to one of the IOCTL_INTERNAL_USB_ other
  function codes.</LI></UL>

</FONT><FONT size=2><P ALIGN="RIGHT">&nbsp;</P>
</FONT><B><I><FONT FACE="Arial" SIZE=4><P>What is Isochronous Data Transfer?</P>
</B></I></FONT><FONT size=2><P>The USB standard defines four data transfer types: control,
 isochronous, interrupt, and bulk. All USB peripherals must support the control transfer
 type for configuration, command, and status information. Each of the remaining three data
 transfer types targets a particular category of USB peripheral. Bulk data transfers 
  are generated or consumed in relatively large and bursty quantities .
 Interrupt data transfers are for data such as characters or coordinates with human perceptible
 echo or feedback response characteristics.
 Isochronous or streaming real-time data transfers occupy a prenegotiated amount of USB bandwidth
  with a   prenegotiated delivery latency. The isochronous transfer type
  targets USB devices such as video cameras or USB speakers that move large
  amounts of time-stamped data to or from the PC over USB.</P>
<P>The USB device used for this sample is a generic Intel i82930 USB evaluation board
programmed with a simple loopback test using a 64-KB circular buffer. None of the code
in the IsoUsb sample is specific to this particular controller chip, except for some
checked-build-only debug dumps indicating manufacturer-specific information from the
USB_DEVICE_DESCRIPTOR obtained from the USB stack through USBDI at StartDevice() time.
The URBs used to communicate with the USB stack use abstracted chip-independent device
characteristics as defined in the URB request types and structures in Usbdi.h.</P>
</FONT><B><I><FONT FACE="Arial" SIZE=4><P>What Does the IsoUsb sample Do?</P>
</B></I></FONT><FONT size=2><P>This sample consists of two parts: a USB minidriver (IsoUsb.sys)
 and a console application (RwIso.exe). They are described individually in this section.
 It is intended that driver writers apply the methods illustrated in this sample to their
  own devices. The sample code is heavily commented to improve its usefulness.</P>
<B><P>IsoUsb.sys USB Minidriver</P>
</B><P>IsoUsb.sys is a USB Isochronous I/O sample minidriver that transfers isochronous data
 packets to and from an Intel i82930 USB peripheral microcontroller over USB. This
  minidriver also performs the power management and Plug and Play tasks that are required
  of any WDM USB minidriver. The particular device test board we used is part of the Intel
   USB developer抯 kit. Information on obtaining the kit is available from Intel抯 developer
    web site at http://developer.intel.com. </P>
<P>The individual source code files that make up the IsoUsb minidriver sample
and their functions are the following:</P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=7 WIDTH=599>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IsoUsb.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains DriverEntry and code that builds the dispatch
table to functions that handle the IRPs and AddDevice request. URBs are
 sent to the USB driver stack from routines in IsoUsb.c.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IsoPwr.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains code to handle power management IRPs.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IsoPnp.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains code to handle Plug and Play IRPs.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IoctlIso.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains code to handle miscellaneous IRPs.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>OcrwIso.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains code to handle basic Read/Write I/O IRPs to perform short,
non-continuous isochronous data transfers.</FONT></TD>
</TR>

<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IsoStrm.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains code to handle long, continuous isochronous data transfers by 
continually 'recycling' a pair of IRPs, insuring one is always available.
 </FONT></TD>
</TR>


<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IusbDbg.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains the functions used for debug output.</FONT></TD>
</TR>
</TABLE>

<FONT size=2><P ALIGN="RIGHT"></P>
</FONT><FONT size=2><P>The following header files are available in the same
directory:</P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=7 WIDTH=615>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>Iso82930.h</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Defines DeviceExtension for instances of IsoUsb devices
and the ISOUSB_RW_CONTEXT structure used for tracking information on Read/Write
IRP processing. </FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>IsoUsb.h</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Defines the IsoUsb.sys IOCTLs.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>GuidIso.h</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Defines the globally unique identifier (GUID) used to generate
symbolic links to driver instances created from user mode.</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>iusbdbg.h</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Debugging header file</FONT></TD>
</TR>
</TABLE>

<FONT size=2><P ALIGN="RIGHT"></P>
</FONT><FONT size=2><P>Other files that are available in the same
directory:</P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=7 WIDTH=615>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>isousb.rc</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Resource file</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>isousb.inf</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Installation file</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>makefile</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>DDK build environment makefile</FONT></TD>
</TR>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>sources</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Generic sources file</FONT></TD>
</TR>


</TABLE>

<FONT size=2><P ALIGN="RIGHT"></P>
</FONT><B><FONT size=2><P>RwIso.exe Console Application</P>
</B><P>RwIso.exe is a console application used to initiate isochronous transfer and
 to obtain a dump of information on the device抯 I/O endpoints (named pipes)
 from USBDI. The application also demonstrates how to use GUID-based device names
  and pipe names generated by the operating system using the SetupDi<I>XXX</I> user-mode APIs.
   The source code file that makes up the RwIso console application sample and
   its function is the following:</P></FONT>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=7 WIDTH=590>
<TR><TD WIDTH="17%" VALIGN="TOP">
<FONT SIZE=2><P>RwIso.c</FONT></TD>
<TD WIDTH="83%" VALIGN="TOP">
<FONT SIZE=2><P>Contains source code for a simple console application to test
 writing to a Isochronous mode output pipe and reading from a Isochronous mode input pipe.
 For the Read/Write test, various command-line switches allow for either single or multiple iterations
 of the read/write test with or without data dumps, as well as a dump of
  information on all the endpoints (named pipes) available on the device.
  A special test function is provided to start a continuous Isochronous input stream from the
  device and have it run for a specified number of seconds then stop. On our test
  board, we have no meaningful data actually streaming from the  device; the point is

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -