WinDriver ™ USB User's Manual

Version 10.2.1

Jungo Ltd.

Information in this document is subject to change without notice. The software described in this document is furnished under a license agreement. The software may be used, copied or distributed only in accordance with that agreement. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or any means, electronically or mechanically, including photocopying and recording for any purpose without the written permission of Jungo Ltd.

Brand and product names mentioned in this document are trademarks of their respective owners and are used here only for identification purposes.


Table of Contents

1. WinDriver Overview
1.1. Introduction to WinDriver
1.2. Background
1.2.1. The Challenge
1.2.2. The WinDriver Solution
1.3. Conclusion
1.4. WinDriver Benefits
1.5. WinDriver Architecture
1.6. What Platforms Does WinDriver Support?
1.7. Limitations of the Different Evaluation Versions
1.8. How Do I Develop My Driver with WinDriver?
1.8.1. On Windows and Linux
1.8.2. On Windows CE
1.9. What Does the WinDriver Toolkit Include?
1.9.1. WinDriver Modules
1.9.2. Utilities
1.9.3. WinDriver's Specific Chipset Support
1.9.4. Samples
1.10. Can I Distribute the Driver Created with WinDriver?
2. Understanding Device Drivers
2.1. Device Driver Overview
2.2. Classification of Drivers According to Functionality
2.2.1. Monolithic Drivers
2.2.2. Layered Drivers
2.2.3. Miniport Drivers
2.3. Classification of Drivers According to Operating Systems
2.3.1. WDM Drivers
2.3.2. VxD Drivers
2.3.3. Unix Device Drivers
2.3.4. Linux Device Drivers
2.4. The Entry Point of the Driver
2.5. Associating the Hardware with the Driver
2.6. Communicating with Drivers
3. WinDriver USB Overview
3.1. Introduction to USB
3.2. WinDriver USB Benefits
3.3. USB Components
3.4. Data Flow in USB Devices
3.5. USB Data Exchange
3.6. USB Data Transfer Types
3.6.1. Control Transfer
3.6.2. Isochronous Transfer
3.6.3. Interrupt Transfer
3.6.4. Bulk Transfer
3.7. USB Configuration
3.8. WinDriver USB
3.9. WinDriver USB Architecture
3.10. Which Drivers Can I Write with WinDriver USB?
4. Installing WinDriver
4.1. System Requirements
4.1.1. Windows System Requirements
4.1.2. Windows CE System Requirements
4.1.3. Linux System Requirements
4.2. WinDriver Installation Process
4.2.1. Windows WinDriver Installation Instructions
4.2.2. Windows CE WinDriver Installation Instructions
4.2.2.1. Installing WinDriver CE when Building New CE-Based Platforms
4.2.2.2. Installing WinDriver CE when Developing Applications for Windows CE Computers
4.2.2.3. Windows CE Installation Note
4.2.3. Linux WinDriver Installation Instructions
4.2.3.1. Preparing the System for Installation
4.2.3.2. Installation
4.2.3.3. Restricting Hardware Access on Linux
4.3. Upgrading Your Installation
4.4. Checking Your Installation
4.4.1. Windows and Linux Installation Check
4.4.2. Windows CE Installation Check
4.5. Uninstalling WinDriver
4.5.1. Windows WinDriver Uninstall Instructions
4.5.2. Linux WinDriver Uninstall Instructions
5. Using DriverWizard
5.1. An Overview
5.2. DriverWizard Walkthrough
5.2.1. Logging WinDriver API Calls
5.2.2. DriverWizard Logger
5.2.3. Automatic Code Generation
5.2.3.1. Generating the Code
5.2.3.2. The Generated USB C Code
5.2.3.3. The Generated Visual Basic and Delphi Code
5.2.3.4. The Generated C# and Visual Basic .NET Code
5.2.4. Compiling the Generated Code
5.2.4.1. Windows and Windows CE Compilation
5.2.4.2. Linux Compilation
5.2.5. Bus Analyzer Integration – Ellisys Visual USB
6. Developing a Driver
6.1. Using DriverWizard to Build a Device Driver
6.2. Writing the Device Driver Without DriverWizard
6.2.1. Include the Required WinDriver Files
6.2.2. Write Your Code
6.2.3. Configure and Build Your Code
6.3. Developing Your Driver on Windows CE Platforms
6.4. Developing in Visual Basic and Delphi
6.4.1. Using DriverWizard
6.4.2. Samples
6.4.3. Creating your Driver
7. Debugging Drivers
7.1. User-Mode Debugging
7.2. Debug Monitor
7.2.1. The wddebug_gui Utility
7.2.1.1. Running wddebug_gui for a Renamed Driver
7.2.2. The wddebug Utility
7.2.2.1. Console-Mode wddebug Execution
7.2.2.2. Windows CE GUI wddebug Execution
8. Enhanced Support for Specific Chipsets
8.1. Overview
8.2. Developing a Driver Using the Enhanced Chipset Support
9. USB Transfers
9.1. Overview
9.2. USB Control Transfers
9.2.1. USB Control Transfers Overview
9.2.1.1. Control Data Exchange
9.2.1.2. More About the Control Transfer
9.2.1.3. The Setup Packet
9.2.1.4. USB Setup Packet Format
9.2.1.5. Standard Device Request Codes
9.2.1.6. Setup Packet Example
9.2.2. Performing Control Transfers with WinDriver
9.2.2.1. Control Transfers with DriverWizard
9.2.2.2. Control Transfers with WinDriver API
9.3. Functional USB Data Transfers
9.3.1. Functional USB Data Transfers Overview
9.3.2. Single Blocking Transfers
9.3.2.1. Performing Single Blocking Transfers with WinDriver
9.3.3. Streaming Data Transfers
9.3.3.1. Performing Streaming with WinDriver
10. Dynamically Loading Your Driver
10.1. Why Do You Need a Dynamically Loadable Driver?
10.2. Windows Dynamic Driver Loading
10.2.1. Windows Driver Types
10.2.2. The wdreg Utility
10.2.2.1. Overview
10.2.3. Dynamically Loading/Unloading windrvr6.sys INF Files
10.3. Linux Dynamic Driver Loading
10.4. Windows Mobile Dynamic Driver Loading
11. Distributing Your Driver
11.1. Getting a Valid License for WinDriver
11.2. Windows Driver Distribution
11.2.1. Preparing the Distribution Package
11.2.2. Installing Your Driver on the Target Computer
11.3. Windows CE Driver Distribution
11.3.1. Distribution to New Windows CE Platforms
11.3.2. Distribution to Windows CE Computers
11.4. Linux Driver Distribution
11.4.1. Kernel Modules
11.4.2. User-Mode Hardware Control Application/Shared Objects
11.4.3. Installation Script
12. Driver Installation – Advanced Issues
12.1. Windows INF Files
12.1.1. Why Should I Create an INF File?
12.1.2. How Do I Install an INF File When No Driver Exists?
12.1.3. How Do I Replace an Existing Driver Using the INF File?
12.2. Renaming the WinDriver Kernel Driver
12.2.1. Windows Driver Renaming
12.2.2. Linux Driver Renaming
12.3. Digital Driver Signing and Certification – Windows 7/Vista/Server 2008/Server 2003/XP/2000
12.3.1. Overview
12.3.1.1. Authenticode Driver Signature
12.3.1.2. WHQL Driver Certification
12.3.2. Driver Signing and Certification of WinDriver-Based Drivers
12.3.2.1. WHQL DTM Test Notes
12.4. Windows XP Embedded WinDriver Component
A. 64-Bit Operating Systems Support
A.1. Supported 64-Bit Architectures
A.2. Support for 32-Bit Applications on 64-Bit Windows and Linux Platforms
A.3. 64-Bit and 32-Bit Data Types
B. WinDriver USB PC Host API Reference
B.1. WD_DriverName
B.2. WinDriver USB (WDU) Library Overview
B.2.1. Calling Sequence for WinDriver USB
B.2.2. Upgrading from the WD_xxx USB API to the WDU_xxx API
B.3. USB User Callback Functions
B.3.1. WDU_ATTACH_CALLBACK
B.3.2. WDU_DETACH_CALLBACK
B.3.3. WDU_POWER_CHANGE_CALLBACK
B.4. USB Functions
B.4.1. WDU_Init
B.4.2. WDU_SetInterface
B.4.3. WDU_GetDeviceAddr
B.4.4. WDU_GetDeviceRegistryProperty
B.4.5. WDU_GetDeviceInfo
B.4.6. WDU_PutDeviceInfo
B.4.7. WDU_Uninit
B.4.8. Single Blocking Transfer Functions
B.4.8.1. WDU_Transfer
B.4.8.2. WDU_HaltTransfer
B.4.8.3. WDU_TransferDefaultPipe
B.4.8.4. WDU_TransferBulk
B.4.8.5. WDU_TransferIsoch
B.4.8.6. WDU_TransferInterrupt
B.4.9. Streaming Data Transfer Functions
B.4.9.1. WDU_StreamOpen
B.4.9.2. WDU_StreamStart
B.4.9.3. WDU_StreamRead
B.4.9.4. WDU_StreamWrite
B.4.9.5. WDU_StreamFlush
B.4.9.6. WDU_StreamGetStatus
B.4.9.7. WDU_StreamStop
B.4.9.8. WDU_StreamClose
B.4.10. WDU_ResetPipe
B.4.11. WDU_ResetDevice
B.4.12. WDU_SelectiveSuspend
B.4.13. WDU_Wakeup
B.4.14. WDU_GetLangIDs
B.4.15. WDU_GetStringDesc
B.5. USB Data Types
B.5.1. WD_DEVICE_REGISTRY_PROPERTY Enumeration
B.5.2. USB Structures
B.5.2.1. WDU_MATCH_TABLE Structure
B.5.2.2. WDU_EVENT_TABLE Structure
B.5.2.3. WDU_DEVICE Structure
B.5.2.4. WDU_CONFIGURATION Structure
B.5.2.5. WDU_INTERFACE Structure
B.5.2.6. WDU_ALTERNATE_SETTING Structure
B.5.2.7. WDU_DEVICE_DESCRIPTOR Structure
B.5.2.8. WDU_CONFIGURATION_DESCRIPTOR Structure
B.5.2.9. WDU_INTERFACE_DESCRIPTOR Structure
B.5.2.10. WDU_ENDPOINT_DESCRIPTOR Structure
B.5.2.11. WDU_PIPE_INFO Structure
B.6. General WD_xxx Functions
B.6.1. Calling Sequence WinDriver – General Use
B.6.2. WD_Open
B.6.3. WD_Version
B.6.4. WD_Close
B.6.5. WD_Debug
B.6.6. WD_DebugAdd
B.6.7. WD_DebugDump
B.6.8. WD_Sleep
B.6.9. WD_License
B.7. User-Mode Utility Functions
B.7.1. Stat2Str
B.7.2. get_os_type
B.7.3. ThreadStart
B.7.4. ThreadWait
B.7.5. OsEventCreate
B.7.6. OsEventClose
B.7.7. OsEventWait
B.7.8. OsEventSignal
B.7.9. OsEventReset
B.7.10. OsMutexCreate
B.7.11. OsMutexClose
B.7.12. OsMutexLock
B.7.13. OsMutexUnlock
B.7.14. PrintDbgMessage
B.7.15. WD_LogStart
B.7.16. WD_LogStop
B.7.17. WD_LogAdd
B.8. WinDriver Status Codes
B.8.1. Introduction
B.8.2. Status Codes Returned by WinDriver
B.8.3. Status Codes Returned by USBD
C. Troubleshooting and Support
D. Evaluation Version Limitations
D.1. Windows WinDriver Evaluation Limitations
D.2. Windows CE WinDriver Evaluation Limitations
D.3. Linux WinDriver Evaluation Limitations
E. Purchasing WinDriver
F. Distributing Your Driver – Legal Issues
G. Additional Documentation

List of Figures

1.1. WinDriver Architecture
2.1. Monolithic Drivers
2.2. Layered Drivers
2.3. Miniport Drivers
3.1. USB Endpoints
3.2. USB Pipes
3.3. Device Descriptors
3.4. WinDriver USB Architecture
5.1. Create or Open a WinDriver Project
5.2. Select Your Device
5.3. DriverWizard INF File Information
5.4. DriverWizard Multi-Interface INF File Information – Specific Interface
5.5. DriverWizard Multi-Interface INF File Information – Composite Device
5.6. Select Device Interface
5.7. USB Control Transfers
5.8. Listen to Pipe
5.9. Write to Pipe
5.10. Code Generation Options
5.11. Ellisys Visual USB Integration
7.1. Start Debug Monitor
7.2. Debug Options
7.3. wddebug Windows CE Start Log Message
7.4. wddebug Windows CE Stop Log Message
9.1. USB Data Exchange
9.2. USB Read and Write
9.3. Custom Request
9.4. Requests List
9.5. USB Request Log
B.1. WinDriver USB Calling Sequence
B.2. WinDriver USB Structures
B.3. WinDriver API Calling Sequence