Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
4.2 KiB

  1. <HTML>
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-
  4. 1252">
  5. <META NAME="Generator" CONTENT="Microsoft FrontPage 5.0">
  6. <TITLE>Bulk Usb</TITLE>
  7. </HEAD>
  8. <BODY LINK="#0000ff">
  9. <p><b><font face="Times New Roman">The Bulkusb driver</font></b></p>
  10. <ul>
  11. <li><font face="Times New Roman">The bulkusb driver is a generic function driver, based on the
  12. Windows Driver Model (WDM).</font></li>
  13. <li><font face="Times New Roman">Supports Plug and Play(PnP), Power
  14. Management(PM), Windows Management Instrumentation (WMI) and the Selective
  15. Suspend (SS) features.</font></li>
  16. <li><font face="Times New Roman">This sample is based off the selSusp DDK
  17. sample. Please refer the selSusp sample and the DDK docs to understand the
  18. handling of PnP, PM, WMI and SS features and implementations.</font></li>
  19. <li>
  20. <p><font face="Times New Roman">The USB device used for this sample is a generic
  21. Intel I82930 USB evaluation board programmed with a simple loopback test using a
  22. 64 KB circular buffer. None of the code in the sample is specific to this
  23. controller chip. </font></p>
  24. </li>
  25. </ul>
  26. <p><font face="Times New Roman">The bulkusb.sys is a minidriver that transfers
  27. asynchronous bulk data packets to and from this board. The USB Request Block (URBs)
  28. allow an abstracted chip-independent transfer to and from the core USB stack. The
  29. sample also consists of a console application</font></p>
  30. <p><font face="Times New Roman">The section below describes the driver routines
  31. that allow a user-mode application to perform bulk reads and writes.</font></p>
  32. <p><b>Bulkusb Reads/Writes</b></p>
  33. <table border="1" width="68%">
  34. <tr>
  35. <td width="50%"><font face="Courier New">Requests</font></td>
  36. <td width="50%"><font face="Courier New">Dispatch Routines</font></td>
  37. </tr>
  38. <tr>
  39. <td width="50%"><font face="Courier New">IRP_MJ_CREATE</font></td>
  40. <td width="50%"><font face="Courier New">BulkUsb_DispatchCreate()</font></td>
  41. </tr>
  42. <tr>
  43. <td width="50%"><font face="Courier New">IRP_MJ_CLOSE</font></td>
  44. <td width="50%"><font face="Courier New">BulkUsb_DispatchClose()</font></td>
  45. </tr>
  46. <tr>
  47. <td width="50%"><font face="Courier New">IRP_MJ_READ</font></td>
  48. <td width="50%"><font face="Courier New">BulkUsb_DispatchReadWrite()</font></td>
  49. </tr>
  50. <tr>
  51. <td width="50%"><font face="Courier New">IRP_MJ_WRITE</font></td>
  52. <td width="50%"><font face="Courier New">BulkUsb_DispatchReadWrite()</font></td>
  53. </tr>
  54. </table>
  55. <p>Notes</p>
  56. <ul>
  57. <li>The <font face="Courier New">BulkUsb_DispatchCreate</font> allows
  58. user-mode app to open handles to the device or to a specific pipe.</li>
  59. <li>The pipe # 3 and pipe # 4 correspond to the bulk IN and bulk OUT pipes on
  60. the I82930 board respectively.
  61. The driver does not hard-code the pipe # for reads and writes.</li>
  62. <li>The <font face="Courier New">BulkUsb_DispatchClose</font> closes open handle to a specific pipe and the
  63. device.</li>
  64. </ul>
  65. <p><font face="Times New Roman">The </font><font face="Courier New">BulkUsb_DispatchReadWrite</font><font face="Times New Roman">,
  66. transforms the </font>original read/write request into an internal device
  67. control request, creates and initializes an URB for this request and sets a completion routine for this
  68. request (<font face="Courier New">BulkUsb_ReadWriteCompletion)</font><font face="Times New Roman">.
  69. </font>The amount of data transferred is
  70. limited by the BULKUSB_MAX_TRANSFER_SIZE (64KB circular buffer limitation). For additional data
  71. transfers, the request (Irp/Urb
  72. pair) is re-initialized and re-submitted in the completion routine.</p>
  73. <p>Since the driver does not save the read-write context information anywhere in the
  74. driver, but passes it along to the completion routine, it is multi-threaded safe.</p>
  75. <p>Please refer the detailed inline comments in the bulkusb driver for
  76. implementation details.</p>
  77. <p>The rwbulk.exe console application is used to initiate bulk transfers and
  78. obtain a dump of information on the device's I/O endpoints. The application also
  79. demonstrates how to use GUID-based device names and pipe names generated by the
  80. operating system using the SetupDiXXX user-mode APIs.</p>
  81. <p>&nbsp;</p>
  82. <p>&nbsp;</p>
  83. <p>&nbsp;</p>
  84. </BODY>
  85. </HTML>