? .quickcam.ko.cmd ? Makefile.25 Index: qc-driver.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-driver.c,v retrieving revision 1.10 diff -u -a -r1.10 qc-driver.c --- qc-driver.c 24 Feb 2003 08:25:24 -0000 1.10 +++ qc-driver.c 29 Mar 2003 21:09:27 -0000 @@ -62,11 +62,7 @@ #include #include -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif #include "qc-memory.h" MODULE_PARM_DESC(debug, "Sets the debug output (bitfield)"); @@ -131,7 +127,9 @@ MODULE_DESCRIPTION("Logitech Quickcam USB driver"); MODULE_AUTHOR("See README"); MODULE_LICENSE("GPL"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) EXPORT_NO_SYMBOLS; +#endif static const int min_framewidth = 32; /* Minimum image size we allow delivering to user application */ static const int min_frameheight = 32; @@ -451,7 +449,7 @@ urb->transfer_buffer_length = length; cr->wValue = cpu_to_le16(regnum); cr->wLength = cpu_to_le16(length); - r = usb_submit_urb(urb); + r = usb_submit_urb(urb, GFP_ATOMIC); if (r<0) { PRINTK(KERN_ERR,"Failed qc_i2c_nextpacket()=%i", r); goto nourbs; @@ -604,7 +602,7 @@ init_waitqueue_head(&id->wq); /* Allocate an URB and associated buffers and fill them */ - urb = id->urb = usb_alloc_urb(0); + urb = id->urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) goto fail1; urb->setup_packet = (unsigned char *)cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL); if (!cr) goto fail2; @@ -615,7 +613,6 @@ urb->complete = (usb_complete_t)qc_i2c_handler; urb->context = qc; urb->timeout = HZ; /* 1 s */ - urb->next = NULL; cr->bRequestType = 0x40; cr->bRequest = 0x04; cr->wIndex = 0; @@ -1421,7 +1418,7 @@ /* Resubmit URB */ if (qc->isoc_data.errorcount < ISOC_PACKETS*ISOC_URBS*2) { urb->dev = qc->dev; /* Required for 2.4.x */ - i = usb_submit_urb(urb); + i = usb_submit_urb(urb, GFP_KERNEL); if (i) PDEBUG("failed to resubmit URB, code=%i",i); } else { PDEBUG("Too many errors, giving up"); @@ -1454,7 +1451,7 @@ /* Allocate URBs, fill them, and put them in the URB array */ for (b=0; burbs[b] = usb_alloc_urb(ISOC_PACKETS); /* Zeroes the allocated data up to iso_frame_desc[], *not* including the last! */ + urb = id->urbs[b] = usb_alloc_urb(ISOC_PACKETS, GFP_KERNEL); /* Zeroes the allocated data up to iso_frame_desc[], *not* including the last! */ if (!urb) { PDEBUG("Out of memory allocating urbs"); goto fail2; @@ -1462,7 +1459,7 @@ urb->dev = qc->dev; urb->context = qc; urb->pipe = usb_rcvisocpipe(qc->dev, QUICKCAM_ISOPIPE); - urb->transfer_flags = USB_ISO_ASAP; + urb->transfer_flags = URB_ISO_ASAP; urb->complete = qc_isoc_handler; urb->number_of_packets = ISOC_PACKETS; urb->transfer_buffer = id->buffer; @@ -1485,7 +1482,7 @@ /* Submit URBs */ for (b=0; burbs[b]); + ret = usb_submit_urb(id->urbs[b], GFP_KERNEL); if (ret<0) { PDEBUG("submit urbs failed"); goto fail4; @@ -1899,7 +1896,7 @@ return r; } -static int qc_v4l_mmap(struct video_device *dev, const char *adr, unsigned long size) +static int qc_v4l_mmap(struct vm_area_struct *vma, struct video_device *dev, const char *adr, unsigned long size) { struct quickcam *qc = (struct quickcam *)dev->priv; unsigned long start = (unsigned long)adr; @@ -1917,8 +1914,7 @@ pos = (unsigned long)frame; while (size > 0) { page = kvirt_to_pa(pos); - /* FIXME: should use qc_remap_page_range() here instead, but where do we get vma? */ - if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED)<0) { + if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)<0) { ret = -EAGAIN; goto fail; } @@ -2298,20 +2294,23 @@ if (debug&DEBUGLOGIC || debug&DEBUGUSER) PDEBUG("qc_v4l_write()"); return -EINVAL; } +static struct file_operations qc_fops = { + .owner = THIS_MODULE, + .open = qc_v4l_open, + .release = qc_v4l_close, + .read = qc_v4l_read, + .write = qc_v4l_write, + .ioctl = qc_v4l_ioctl, + .mmap = qc_v4l_mmap, + .poll = qc_v4l_poll, +}; static struct video_device qc_v4l_template = { - name: "QuickCam USB", - type: VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE, - hardware: VID_HARDWARE_QCAM_USB, - initialize: NULL, - open: qc_v4l_open, - close: qc_v4l_close, - read: qc_v4l_read, - write: qc_v4l_write, - ioctl: qc_v4l_ioctl, - mmap: qc_v4l_mmap, - poll: qc_v4l_poll, - minor: 0 + .owner = THIS_MODULE, + .name = "QuickCam USB", + .type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE, + .hardware = VID_HARDWARE_QCAM_USB, + .fops = &qc_fops, }; /********************* end of Video 4 Linux API ************************/ Index: qc-formats.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-formats.c,v retrieving revision 1.8 diff -u -a -r1.8 qc-formats.c --- qc-formats.c 24 Feb 2003 08:25:25 -0000 1.8 +++ qc-formats.c 29 Mar 2003 21:09:30 -0000 @@ -23,11 +23,7 @@ * */ -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif #ifndef v4l2_fourcc /* Four-character-code (FOURCC) */ Index: qc-hdcs.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-hdcs.c,v retrieving revision 1.8 diff -u -a -r1.8 qc-hdcs.c --- qc-hdcs.c 24 Feb 2003 08:25:26 -0000 1.8 +++ qc-hdcs.c 29 Mar 2003 21:09:30 -0000 @@ -19,11 +19,7 @@ * */ -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif /* LSB bit of I2C or register address signifies write (0) or read (1) */ Index: qc-memory.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-memory.c,v retrieving revision 1.1 diff -u -a -r1.1 qc-memory.c --- qc-memory.c 27 Jan 2003 10:47:02 -0000 1.1 +++ qc-memory.c 29 Mar 2003 21:09:30 -0000 @@ -26,6 +26,7 @@ #include /* Required on Alpha */ #include /* Required on Alpha */ #include /* pmd_offset requires this on SuSE supplied kernels */ +#include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #define MAP_NR virt_to_page Index: qc-mjpeg.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-mjpeg.c,v retrieving revision 1.4 diff -u -a -r1.4 qc-mjpeg.c --- qc-mjpeg.c 17 Feb 2003 12:18:40 -0000 1.4 +++ qc-mjpeg.c 29 Mar 2003 21:09:31 -0000 @@ -33,11 +33,7 @@ #endif #endif /* __KERNEL__ */ -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif #if COMPRESS Index: qc-pb0100.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-pb0100.c,v retrieving revision 1.7 diff -u -a -r1.7 qc-pb0100.c --- qc-pb0100.c 24 Feb 2003 08:25:26 -0000 1.7 +++ qc-pb0100.c 29 Mar 2003 21:09:31 -0000 @@ -19,11 +19,7 @@ * */ -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif /* I2C Address */ #define PB_ADDR 0xBA Index: qc-vv6410.c =================================================================== RCS file: /cvsroot/qce-ga/qc-usb/qc-vv6410.c,v retrieving revision 1.7 diff -u -a -r1.7 qc-vv6410.c --- qc-vv6410.c 24 Feb 2003 08:25:27 -0000 1.7 +++ qc-vv6410.c 29 Mar 2003 21:09:32 -0000 @@ -19,11 +19,7 @@ * */ -#ifdef NOKERNEL #include "quickcam.h" -#else -#include -#endif /* LSB bit of I2C address signifies write (0) or read (1) */