On Mon, Jun 20, 2016 at 7:19 PM, Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> wrote: > > Hi, > > Muni Sekhar <munisekharrms@xxxxxxxxx> writes: >>> Muni Sekhar <munisekharrms@xxxxxxxxx> writes: >>>> Hi All, >>>> >>>> Usb.h file is having the below mentioned USB_CTRL_SET_TIMEOUT & >>>> USB_CTRL_GET_TIMEOUT macros. >>>> >>>> >>>> >>>> /* >>>> >>>> * timeouts, in milliseconds, used for sending/receiving control messages >>>> >>>> * they typically complete within a few frames (msec) after they're issued >>>> >>>> * USB identifies 5 second timeouts, maybe more in a few cases, and a few >>>> >>>> * slow devices (like some MGE Ellipse UPSes) actually push that limit. >>>> >>>> */ >>>> >>>> #define USB_CTRL_GET_TIMEOUT 5000 >>>> >>>> #define USB_CTRL_SET_TIMEOUT 5000 >>>> >>>> >>>> >>>> >>>> >>>> Does the above mentioned timeouts will vary based on the packet length >>>> of control transfers (8, 16, 32 or 64 bytes)? >>>> >>>> >>>> >>>> I do have a USB Bluetooth device and it exposes the control endpoint >>>> for sending HCI commands. >>>> >>>> >>>> >>>> I’m not sure what will be the good value for the >>>> usb_control_msg()timeout for sending HCI commands, will it be safe to >>>> use USB_CTRL_SET_TIMEOUT? >>> >>> why wouldn't it? If your device doesn't respond to a control message in >>> 5 seconds, then you should really get that FW fixed or change your >>> device to something that works. 5 seconds to transfer a few bytes is a >>> really long time. Even for low-speed pipes (1.5Mbps), you can transfer >>> 960 kiB in 5 seconds if you saturate the bus. How big are your HCI >>> commands? >> >> HCI Command Packets with up to maximum of 255 bytes of data. > > then 5s is more than enough for you ;-) What usually triggers the usb_control_msg() call to return? Is it just an acknowledgement from the device that the command has been received? > > -- > balbi -- Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html