wiki:windows_backend

Version 22 (modified by pbatard, 3 years ago) (diff)

--

Windows backend

About

The aim of this project is to bring a Windows backend to the mainline libusb 1.0 version, so that libusb 1.0 can easily be used on Windows platforms.

Status

The Windows backend is still in alpha stages. As of 2010.01.05, it should include the main libusb v1.0 features, apart from isochronous transfers (which is a limitation from the WinUSB Microsoft API).

Source

The (initial and now dated) Windows backend is available in the winusb git branch.

For those not familiar with git, here are the git commands you can use to work on the winusb branch:

git clone git://git.libusb.org/libusb.git ; retrieve the main branch (if you don't have it already)
cd libusb
git branch winusb origin/winusb           ; add the remote "origin/winusb" branch to your repository under the local name "winusb"
git checkout winusb                       ; select "winusb" as your default development branch
git pull                                  ; to keep in sync with the remote tree

A separate svn repository for the more up-to-date work-in-progress (non-reviewed => very alpha) also exists at http://code.google.com/p/libusb-winusb-wip/.

To compile this source, pthread-win32 is also required.
To compile projects using libusb 1.0, you should then add "-lusb-1.0 -lpthread -lsetupapi -lole32" to your library dependencies.

Finally, access to your USB devices with libusb-winusb, you need the WinUSB driver for your device to be configured and installed on your platform.

Development Considerations

  • For convenience reasons, the development toolchain used for the Windows backend is MinGW and the target for the first stable release is XP and later Windows versions (including 64 bit Windows).
  • The method of dealing with USB devices in the first release will be WinUSB only, with provisions for other access modes to be included later.
  • Windows' handling of composite devices will be done with multiple WinUSB drivers (VID_####&PID_####&MI_##), descendants of the usbccgp.sys driver (Composite Generic Parent). For more info, see "2. How Windows handles a composite device" at http://www.cygnal.org/ubb/Forum9/HTML/001050.html.

Current Issues

To Do

  • threading
  • automated WinUSB driver installation?
  • hotplug detection

Done

  • device enumeration
  • descriptors retrieval
  • composite devices & interface selection
  • poll and pipe
  • control transfers
  • bulk/interrupt transfers
  • device reset
  • transfer cancellation

Development's status log

  • [2009.12.13 and later] Consult the Work-In-Progress Repository (SVN) or the Activity Log.
  • [2009.12.12]
    • Back on track after resubmission of git patches and timer related fixes.
  • [2009.12.04]
  • [2009.12.03]
    • matching of libusb enumerated devices with WinUSB GUID devices (WIP)
    • WinUSB driver cleanup & documentation.
  • [2009.12.02]
    • WinUSB generic device installation (x86 & x64)
    • retrieval of device handles for use with WinUSB
    • WinUSB init
  • [2009.12.01]
    • configuration descriptors retrieval
    • initial possible API breakdown & more code cleanup
  • [2009.11.30]
    • Added clock_gettime() with hires timer detection for monotonic and GetSystemTimeAsFileTime?() (100 ns resolution) for realtime.
    • Moved the USB 2.0 root hub caps detection into set_hcd_device_descriptor()
  • [2009.11.29]
    • First release with working lsusb enumeration

Attachments

Download all attachments as: .zip