/* Manage streaming interruption */
if (usbvision->streaming == Stream_Interrupt) {
- usbvision->streaming = Stream_Off;
+ usbvision->streaming = Stream_Idle;
if ((*f)) {
(*f)->grabstate = FrameState_Ready;
(*f)->scanstate = ScanState_Scanning;
usbvision->streaming = Stream_Interrupt;
ret = wait_event_timeout(usbvision->wait_stream,
- (usbvision->streaming == Stream_Off),
+ (usbvision->streaming == Stream_Idle),
msecs_to_jiffies(USBVISION_NUMSBUF*USBVISION_URB_FRAMES));
return ret;
}
}
}
- usbvision->streaming = Stream_On;
+ usbvision->streaming = Stream_Idle;
PDEBUG(DBG_ISOC, "%s: streaming=1 usbvision->video_endp=$%02x", __FUNCTION__, usbvision->video_endp);
return 0;
}
{
int bufIdx, errCode, regValue;
- // FIXME : removed the streaming==Stream_Off. This field has not the same signification than before !
- if (usbvision->dev == NULL)
+ if ((usbvision->streaming == Stream_Off) || (usbvision->dev == NULL))
return;
/* Unschedule all of the iso td's */
return -EINVAL;
if (list_empty(&(usbvision->outqueue))) {
- if (usbvision->streaming == Stream_Off)
+ if (usbvision->streaming == Stream_Idle)
return -EINVAL;
ret = wait_event_interruptible
(usbvision->wait_frame,
usbvision->isocPacketSize = 0;
usbvision->usb_bandwidth = 0;
usbvision->user = 0;
+ usbvision->streaming = Stream_Off;
usbvision_register_video(usbvision);
usbvision_configure_video(usbvision);
usb_put_dev(usbvision->dev);
usbvision->dev = NULL; // USB device is no more
- wake_up_interruptible(&usbvision->wait_frame);
- wake_up_interruptible(&usbvision->wait_stream);
-
up(&usbvision->lock);
if (usbvision->user) {
info("%s: In use, disconnect pending", __FUNCTION__);
+ wake_up_interruptible(&usbvision->wait_frame);
+ wake_up_interruptible(&usbvision->wait_stream);
}
else {
usbvision_release(usbvision);