/* Copy data from URB */
spin_lock(&dev->slock);
- dev->isoc_ctl.isoc_copy(dev, urb);
+ dev->usb_ctl.urb_data_copy(dev, urb);
spin_unlock(&dev->slock);
/* Reset urb buffers */
em28xx_isocdbg("em28xx: called em28xx_uninit_isoc in mode %d\n", mode);
if (mode == EM28XX_DIGITAL_MODE)
- isoc_bufs = &dev->isoc_ctl.digital_bufs;
+ isoc_bufs = &dev->usb_ctl.digital_bufs;
else
- isoc_bufs = &dev->isoc_ctl.analog_bufs;
+ isoc_bufs = &dev->usb_ctl.analog_bufs;
for (i = 0; i < isoc_bufs->num_bufs; i++) {
urb = isoc_bufs->urb[i];
{
int i;
struct urb *urb;
- struct em28xx_usb_bufs *isoc_bufs = &dev->isoc_ctl.digital_bufs;
+ struct em28xx_usb_bufs *isoc_bufs = &dev->usb_ctl.digital_bufs;
em28xx_isocdbg("em28xx: called em28xx_stop_urbs\n");
em28xx_isocdbg("em28xx: called em28xx_alloc_isoc in mode %d\n", mode);
if (mode == EM28XX_DIGITAL_MODE)
- isoc_bufs = &dev->isoc_ctl.digital_bufs;
+ isoc_bufs = &dev->usb_ctl.digital_bufs;
else
- isoc_bufs = &dev->isoc_ctl.analog_bufs;
+ isoc_bufs = &dev->usb_ctl.analog_bufs;
/* De-allocates all pending stuff */
em28xx_uninit_isoc(dev, mode);
isoc_bufs->max_pkt_size = max_pkt_size;
isoc_bufs->num_packets = num_packets;
- dev->isoc_ctl.vid_buf = NULL;
- dev->isoc_ctl.vbi_buf = NULL;
+ dev->usb_ctl.vid_buf = NULL;
+ dev->usb_ctl.vbi_buf = NULL;
sb_size = isoc_bufs->num_packets * isoc_bufs->max_pkt_size;
for (i = 0; i < isoc_bufs->num_bufs; i++) {
urb = usb_alloc_urb(isoc_bufs->num_packets, GFP_KERNEL);
if (!urb) {
- em28xx_err("cannot alloc isoc_ctl.urb %i\n", i);
+ em28xx_err("cannot alloc usb_ctl.urb %i\n", i);
em28xx_uninit_isoc(dev, mode);
return -ENOMEM;
}
em28xx_isocdbg("em28xx: called em28xx_init_isoc in mode %d\n", mode);
- dev->isoc_ctl.isoc_copy = isoc_copy;
+ dev->usb_ctl.urb_data_copy = isoc_copy;
if (mode == EM28XX_DIGITAL_MODE) {
- isoc_bufs = &dev->isoc_ctl.digital_bufs;
+ isoc_bufs = &dev->usb_ctl.digital_bufs;
/* no need to free/alloc isoc buffers in digital mode */
alloc = 0;
} else {
- isoc_bufs = &dev->isoc_ctl.analog_bufs;
+ isoc_bufs = &dev->usb_ctl.analog_bufs;
alloc = 1;
}
VIDEOBUF_ACTIVE, it won't be, though.
*/
spin_lock_irqsave(&dev->slock, flags);
- if (dev->isoc_ctl.vbi_buf == buf)
- dev->isoc_ctl.vbi_buf = NULL;
+ if (dev->usb_ctl.vbi_buf == buf)
+ dev->usb_ctl.vbi_buf = NULL;
spin_unlock_irqrestore(&dev->slock, flags);
videobuf_vmalloc_free(&buf->vb);
buf->vb.field_count++;
v4l2_get_timestamp(&buf->vb.ts);
- dev->isoc_ctl.vid_buf = NULL;
+ dev->usb_ctl.vid_buf = NULL;
list_del(&buf->vb.queue);
wake_up(&buf->vb.done);
buf->vb.field_count++;
v4l2_get_timestamp(&buf->vb.ts);
- dev->isoc_ctl.vbi_buf = NULL;
+ dev->usb_ctl.vbi_buf = NULL;
list_del(&buf->vb.queue);
wake_up(&buf->vb.done);
if (list_empty(&dma_q->active)) {
em28xx_isocdbg("No active queue to serve\n");
- dev->isoc_ctl.vid_buf = NULL;
+ dev->usb_ctl.vid_buf = NULL;
*buf = NULL;
return;
}
outp = videobuf_to_vmalloc(&(*buf)->vb);
memset(outp, 0, (*buf)->vb.size);
- dev->isoc_ctl.vid_buf = *buf;
+ dev->usb_ctl.vid_buf = *buf;
return;
}
if (list_empty(&dma_q->active)) {
em28xx_isocdbg("No active queue to serve\n");
- dev->isoc_ctl.vbi_buf = NULL;
+ dev->usb_ctl.vbi_buf = NULL;
*buf = NULL;
return;
}
outp = videobuf_to_vmalloc(&(*buf)->vb);
memset(outp, 0x00, (*buf)->vb.size);
- dev->isoc_ctl.vbi_buf = *buf;
+ dev->usb_ctl.vbi_buf = *buf;
return;
}
return 0;
}
- buf = dev->isoc_ctl.vid_buf;
+ buf = dev->usb_ctl.vid_buf;
if (buf != NULL)
outp = videobuf_to_vmalloc(&buf->vb);
return 0;
}
- buf = dev->isoc_ctl.vid_buf;
+ buf = dev->usb_ctl.vid_buf;
if (buf != NULL)
outp = videobuf_to_vmalloc(&buf->vb);
- vbi_buf = dev->isoc_ctl.vbi_buf;
+ vbi_buf = dev->usb_ctl.vbi_buf;
if (vbi_buf != NULL)
vbioutp = videobuf_to_vmalloc(&vbi_buf->vb);
VIDEOBUF_ACTIVE, it won't be, though.
*/
spin_lock_irqsave(&dev->slock, flags);
- if (dev->isoc_ctl.vid_buf == buf)
- dev->isoc_ctl.vid_buf = NULL;
+ if (dev->usb_ctl.vid_buf == buf)
+ dev->usb_ctl.vid_buf = NULL;
spin_unlock_irqrestore(&dev->slock, flags);
videobuf_vmalloc_free(&buf->vb);
goto fail;
}
- if (!dev->isoc_ctl.analog_bufs.num_bufs)
+ if (!dev->usb_ctl.analog_bufs.num_bufs)
urb_init = 1;
if (urb_init) {
char **transfer_buffer;
};
-struct em28xx_usb_isoc_ctl {
- /* isoc transfer buffers for analog mode */
+struct em28xx_usb_ctl {
+ /* isoc/bulk transfer buffers for analog mode */
struct em28xx_usb_bufs analog_bufs;
- /* isoc transfer buffers for digital mode */
+ /* isoc/bulk transfer buffers for digital mode */
struct em28xx_usb_bufs digital_bufs;
/* Stores already requested buffers */
struct em28xx_buffer *vid_buf;
struct em28xx_buffer *vbi_buf;
- /* isoc urb callback */
- int (*isoc_copy) (struct em28xx *dev, struct urb *urb);
+ /* copy data from URB */
+ int (*urb_data_copy) (struct em28xx *dev, struct urb *urb);
};
/* Isoc control struct */
struct em28xx_dmaqueue vidq;
struct em28xx_dmaqueue vbiq;
- struct em28xx_usb_isoc_ctl isoc_ctl;
+ struct em28xx_usb_ctl usb_ctl;
spinlock_t slock;
/* usb transfer */