Re: FUSB200 xhci issue
From: Alan Stern <stern@rowland.harvard.edu>
Date: 2013-08-08 20:19:33
On Thu, 8 Aug 2013, Christian Lamparter wrote:
Anyway, I do have a question about something else too. in ath9k_htc's hif_usb:quoted
struct usb_host_interface *alt = &hif_dev->interface->altsetting[0]; struct usb_endpoint_descriptor *endp; ... /* On downloading the firmware to the target, the USB descriptor of EP4 * is 'patched' to change the type of the endpoint to Bulk. This will * bring down CPU usage during the scan period. */ for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) { endp = &alt->endpoint[idx].desc; if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) { endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK; endp->bmAttributes |= USB_ENDPOINT_XFER_BULK; // endp->bInterval = 0; } }Alan, can you please tell us, if it is really safe to override the bmAttributes this way? After all (according to the comment) the device has "morphed" (EP4 has changed).
This does not look like a good idea. Why does the driver do it?
Or, is it necessary for the driver call "usb_reset_device" or (usb_reset_configuration) in this case?
After loading firmware, a reset generally is necessary. Some devices will do it themselves; others require you to call usb_reset_device(). Alan Stern