As about read_urb_finished probably it's OK. But we shouldn't decrease open_count in the case of error as then we return normal exit value.
Here is what we had before:
dev->interrupt_in_endpoint->bInterval);
dev->read_urb_finished = 0;
retval = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL);
if (retval) {
dev->read_urb_finished = 1;
--dev->open_count;
}
So I can left it but w/o this line:
--dev->open_count;
What is more critical is that I added:
/* initialize out direction */
dev->out_urb_finished = 1;
Without this we'll always have write timeouts.
Vitaliy
-