From: Pete B. <pb...@gm...> - 2011-02-20 20:52:39
|
On 20 February 2011 12:54, Xiaofan Chen <xia...@gm...> wrote: >> Therefore I have some doubts about the following codes in windows_usb.c. >> /* >> * from http://msdn.microsoft.com/en-us/library/ms793522.aspx: "The port driver >> * does not currently expose a service that allows higher-level drivers to set >> * the configuration." >> */ >> static int windows_set_configuration(struct libusb_device_handle >> *dev_handle, int config) >> { >> struct windows_device_priv *priv = __device_priv(dev_handle->dev); >> int r = LIBUSB_SUCCESS; >> >> if (config >= USB_MAXCONFIG) >> return LIBUSB_ERROR_INVALID_PARAM; >> >> r = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_OUT | >> LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE, >> LIBUSB_REQUEST_SET_CONFIGURATION, (uint16_t)config, >> 0, NULL, 0, 1000); >> >> if (r == LIBUSB_SUCCESS) { >> priv->active_config = (uint8_t)config; >> } >> return r; >> } Hehehe. This code was there to find out if the information from Microsoft about set configuration should be taken to face value or not. However, I did not expect it to cause problems when the default configuration was used. Will be fixing this soon. Thanks for looking into it! Regards, /Pete |