On Wed, Jul 8, 2009 at 12:43 PM, Xiaofan Chen<[email protected]> wrote: > I will ask in the libusb mailing list why it still works under Linux > and Mac OS X.
Here is the answer from Alan Stern in the libusb mailing list. >> Apparently the code is not correct. >> After this one, the usb_handle should not be valid any more. >> usb_reset(result->usb_handle); >> >> So it will fail the next two. >> /* usb_set_configuration required under win32 >> */ >> usb_set_configuration(result->usb_handle, >> dev->config[0].bConfigurationValue); >> usb_claim_interface(result->usb_handle, 0); >> >> But in reality, the above "wrong codes" seem to work under Linux >> and Mac OS X even though it failed under Windows. >> >> Why does it work under Linux and Mac OS X? >> Does the usb_handle survive the usb_reset() under Linux and Mac OS X? > > Under Linux, sometimes it does and sometimes it doesn't. It depends on > whether any of the descriptors have changed and on what version of the > kernel you are using; with 2.6.27 or later the handle won't survive. > >> Is this something related to the following? >> http://kerneltrap.org/mailarchive/linux-usb/2008/11/28/4259024 > > No; it is related to this: > > http://marc.info/?l=linux-usb&m=121425133223338&w=2 > > Alan Stern > > So the code is apparently wrong. It will not work in the later version of the Linux kernel. So we need to find a better patch even under Linux. -- Xiaofan http://mcuee.blogspot.com _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
