Re: A bug with libusb0
Xiaofan Chen <[email protected]> Wed, 4 Mar 2015 09:18:38 +0800
| Newsgroups | gmane.comp.lib.libusb.devel.windows |
|---|---|
| Message-ID | <CAGjSPUAwbtSMTbYcDyTX=AAT3xWwo4Cdffg4QFAqQr5+NRN2xQ@mail.gmail.com> |
On Wed, Jan 28, 2015 at 8:22 PM, <[email protected]> wrote: >>> In file ioctl.c, function dispatch_ioctl, case LIBUSB_IOCTL_CONTROL_WRITE: >>> It's possible for transfer_buffer_mdl to be NULL. So the check is >>> unnecessary. > >>Why do you think transfer_buffer_mdl can be NULL ? > > I met a device which send a control packet without data. > I see. This could potentially be a bug of libusb-win32. I will let Travis confirm whether this is a real bug or not. -- Xiaofan PS: here is another report in libusb mailing list. +++++++++++++++ ---------- Forwarded message ---------- From: Tim Roberts <[email protected]> Date: Wed, Mar 4, 2015 at 1:42 AM Subject: Re: [libusb] control transfer with a data size of zero To: Libusb Mailing List <[email protected]> Blaine Bergeson (bbergeson) wrote: > > I found that if I use the libusbK.sys driver instead of libusb0.sys, > it works fine so it does look like either a bug or a zero data size is > not supported or allowed in the libusb0.sys driver. > Almost all of the most common control requests do not have data. SetConfiguration, SetInterface, SetFeature and ClearFeature come immediately to mind. The issue many people run into is that, unless you are using a vendor request (where bmRequestType is 4x or Cx), all control request have a meaning that is specifically defined in the USB specs. Some standard bRequests must have data, some must not, and many are invalid. Another issue that people run into is that a vendor request to an interface (41 or C1) must have a proper claimed interface number in wIndex, and a vendor request to an endpoint (42 or C2) must have a proper endpoint number in wIndex. If you want to use arbitrarily data, you must use vendor to device (40/C0) or vendor to other (43/C3). -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. ++++++++++++++++++++++ ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/