Dear Experts, I have a simple user-space driver that uses usbdevfs.
As I understand it, there is no way to select() on data being available on an endpoint. So I have one thread per endpoint which does an ioctl(USBDEVFS_BULK) read. This is fine, until I need to shut down (that part of) the driver. Ideally, I would like to be able to pthread_cancel the threads - but ioctl is not a cancellation point. Similarly, I could send a signal to the thread, but according to 'man ioctl', ioctl does not return EINTR to indicate that it has been interrupted by a signal. I've considered the possibility that ioctl(USBDEVFS_BULK) might in fact return EINTR if it gets a signal; I've tracked the code path as far as a call to wait_for_completion_timeout() in usb_start_wait_urb(); I think that that would be wait_for_completion_interruptible_timeout() if it were interruptible by a signal, yes? So, I'm now looking at using ioctl(USBDEVFS_SUBMITURB) and ioctl(USBDEVFS_REAPURB) instead. (I think I'll need to use these anyway eventually, in order to have more than one URB in progress simultaneously, for improved throughput.) Hopefully I can submit a request (which should not block) and I'll get a signal when it's ready - except that usbdevfs.h says "signal to be sent on error" - does it really not send a signal if the URB completes successfully? The code in async_completed() seems to send the signal irrespective of the value in urb->status. Or maybe there is some other approach that I should be taking. Many thanks for any suggestions. Regards, Phil. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users