ChangeSet 1.893.2.18, 2002/12/26 18:53:43-08:00, spse@secret.org.uk [PATCH] 2.4.20 usbvideo fixes from 2.5 3/5 Add startDataPump and stopDataPump callbacks to usbvideo.c diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c --- a/drivers/usb/usbvideo.c Mon Jan 6 11:30:27 2003 +++ b/drivers/usb/usbvideo.c Mon Jan 6 11:30:27 2003 @@ -769,6 +769,10 @@ cams->cb.getFrame = usbvideo_GetFrame; if (cams->cb.disconnect == NULL) cams->cb.disconnect = usbvideo_Disconnect; + if (cams->cb.startDataPump == NULL) + cams->cb.startDataPump = usbvideo_StartDataPump; + if (cams->cb.stopDataPump == NULL) + cams->cb.stopDataPump = usbvideo_StopDataPump; #if USES_PROC_FS /* * If both /proc fs callbacks are NULL then we assume that the driver @@ -939,7 +943,7 @@ uvd->remove_pending = 1; /* Now all ISO data will be ignored */ /* At this time we ask to cancel outstanding URBs */ - usbvideo_StopDataPump(uvd); + GET_CALLBACK(uvd, stopDataPump)(uvd); for (i=0; i < USBVIDEO_NUMSBUF; i++) usb_free_urb(uvd->sbuf[i].urb); @@ -1272,7 +1276,7 @@ if (errCode == 0) { /* Start data pump if we have valid endpoint */ if (uvd->video_endp != 0) - errCode = usbvideo_StartDataPump(uvd); + errCode = GET_CALLBACK(uvd, startDataPump)(uvd); if (errCode == 0) { if (VALID_CALLBACK(uvd, setupOnOpen)) { if (uvd->debug > 1) @@ -1321,8 +1325,8 @@ if (uvd->debug > 1) info("%s($%p)", __FUNCTION__, dev); - down(&uvd->lock); - usbvideo_StopDataPump(uvd); + down(&uvd->lock); + GET_CALLBACK(uvd, stopDataPump)(uvd); usbvideo_rvfree(uvd->fbuf, uvd->fbuf_size); uvd->fbuf = NULL; RingQueue_Free(&uvd->dp); diff -Nru a/drivers/usb/usbvideo.h b/drivers/usb/usbvideo.h --- a/drivers/usb/usbvideo.h Mon Jan 6 11:30:27 2003 +++ b/drivers/usb/usbvideo.h Mon Jan 6 11:30:27 2003 @@ -268,6 +268,8 @@ int (*getFrame)(struct uvd *, int); int (*procfs_read)(char *page,char **start,off_t off,int count,int *eof,void *data); int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data); + int (*startDataPump)(struct uvd *uvd); + void (*stopDataPump)(struct uvd *uvd); }; struct usbvideo {