Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44127
b: refs/heads/master
c: 5f7fb87
h: refs/heads/master
i:
  44125: 5e67858
  44123: 843104e
  44119: 7190f1d
  44111: 8463ca8
  44095: 4ba9d22
v: v3
  • Loading branch information
Thierry authored and Mauro Carvalho Chehab committed Dec 10, 2006
1 parent 4a72ca7 commit e63348e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2242ee5474f46d87a45cd4e214b5c3aa02ff293
refs/heads/master: 5f7fb877be14da92803f0b5b60955e071ebe2d58
17 changes: 8 additions & 9 deletions trunk/drivers/media/video/usbvision/usbvision-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ static void usbvision_isocIrq(struct urb *urb, struct pt_regs *regs)

/* 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;
Expand Down Expand Up @@ -3092,7 +3092,7 @@ static int usbvision_stream_interrupt(struct usb_usbvision *usbvision)

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;
}
Expand Down Expand Up @@ -3579,7 +3579,7 @@ static int usbvision_init_isoc(struct usb_usbvision *usbvision)
}
}

usbvision->streaming = Stream_On;
usbvision->streaming = Stream_Idle;
PDEBUG(DBG_ISOC, "%s: streaming=1 usbvision->video_endp=$%02x", __FUNCTION__, usbvision->video_endp);
return 0;
}
Expand All @@ -3595,8 +3595,7 @@ static void usbvision_stop_isoc(struct usb_usbvision *usbvision)
{
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 */
Expand Down Expand Up @@ -4292,7 +4291,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file,
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,
Expand Down Expand Up @@ -5665,6 +5664,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf, const struct us
usbvision->isocPacketSize = 0;
usbvision->usb_bandwidth = 0;
usbvision->user = 0;
usbvision->streaming = Stream_Off;

usbvision_register_video(usbvision);
usbvision_configure_video(usbvision);
Expand Down Expand Up @@ -5713,13 +5713,12 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
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);
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/media/video/usbvision/usbvision.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ enum FrameState {

/* stream states */
enum StreamState {
Stream_Off,
Stream_Interrupt,
Stream_On,
Stream_Off, /* Driver streaming is completely OFF */
Stream_Idle, /* Driver streaming is ready to be put ON by the application */
Stream_Interrupt, /* Driver streaming must be interrupted */
Stream_On, /* Driver streaming is put ON by the application */
};

enum IsocState {
Expand Down

0 comments on commit e63348e

Please sign in to comment.