summaryrefslogtreecommitdiff
path: root/community/qc-usb-messenger
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/qc-usb-messenger
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/qc-usb-messenger')
-rw-r--r--community/qc-usb-messenger/PKGBUILD35
-rw-r--r--community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.33.patch251
-rw-r--r--community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.36.patch12
-rw-r--r--community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.37.patch21
-rw-r--r--community/qc-usb-messenger/qc-usb-messenger.install35
5 files changed, 354 insertions, 0 deletions
diff --git a/community/qc-usb-messenger/PKGBUILD b/community/qc-usb-messenger/PKGBUILD
new file mode 100644
index 000000000..aab42fbf7
--- /dev/null
+++ b/community/qc-usb-messenger/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 38937 2011-02-03 15:23:52Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Luiz Ribeiro <luizribeiro@gmail.com>
+
+pkgname=qc-usb-messenger
+pkgver=1.8
+pkgrel=14
+pkgdesc="QuickCam Messenger & Communicate driver for Linux"
+arch=('i686' 'x86_64')
+url="http://home.mag.cx/messenger/"
+license=('GPL')
+depends=("kernel26")
+conflicts=('qc-usb')
+install=$pkgname.install
+source=(http://home.mag.cx/messenger/source/$pkgname-$pkgver.tar.gz
+ qc-usb-messenger-kernel-2.6.33.patch
+ qc-usb-messenger-kernel-2.6.36.patch
+ qc-usb-messenger-kernel-2.6.37.patch)
+md5sums=('58dc5652a0c91e6cc2adc682ca848964'
+ 'aa4bb3f2262622d16c3827a4f23400d9'
+ 'ac2bec633194ac3f06aa683d6ff5668e'
+ '56a9f78ad1448fa870fa9ca3521fd2a7')
+
+build() {
+ _kernver=`pacman -Q kernel26 | cut -d . -f 3 | cut -f 1 -d -`
+ depends=("kernel26>=2.6.${_kernver}" "kernel26<2.6.`expr ${_kernver} + 1`")
+
+ cd $srcdir/$pkgname-$pkgver
+ patch -p1 < $srcdir/qc-usb-messenger-kernel-2.6.33.patch
+ patch -p1 < $srcdir/qc-usb-messenger-kernel-2.6.36.patch
+ patch -p1 < $srcdir/qc-usb-messenger-kernel-2.6.37.patch
+ make all
+ _kernelver=`uname -r`
+ make install PREFIX=$pkgdir/usr MODULE_DIR=$pkgdir/lib/modules/${_kernelver} LINUX_DIR=/lib/modules/${_kernelver}/build
+}
diff --git a/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.33.patch b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.33.patch
new file mode 100644
index 000000000..b4f6f9833
--- /dev/null
+++ b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.33.patch
@@ -0,0 +1,251 @@
+Only in qc-usb-messenger-1.8.my: input_read
+Only in qc-usb-messenger-1.8.my: modules.order
+Only in qc-usb-messenger-1.8.my: Module.symvers
+diff -wbBur qc-usb-messenger-1.8/qc-driver.c qc-usb-messenger-1.8.my/qc-driver.c
+--- qc-usb-messenger-1.8/qc-driver.c 2008-05-26 11:29:16.000000000 +0000
++++ qc-usb-messenger-1.8.my/qc-driver.c 2010-04-12 15:59:23.000000000 +0000
+@@ -49,10 +49,8 @@
+ #include <linux/quickcam.h>
+ #endif
+ #include <linux/version.h>
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)) || (HAVE_UTSRELEASE_H == 1)
+-#include <linux/utsrelease.h>
+-#endif
+-#include <linux/autoconf.h>
++#include <generated/utsrelease.h>
++#include <generated/autoconf.h>
+ #include <linux/module.h>
+
+ #include "qc-memory.h"
+@@ -1124,7 +1122,6 @@
+ PRINTK(KERN_WARNING,"Could not register procfs file entry");
+ return -ENXIO;
+ }
+- entry->owner = THIS_MODULE;
+ entry->data = qc;
+ entry->read_proc = qc_proc_read;
+ entry->write_proc = qc_proc_write;
+@@ -1137,7 +1134,6 @@
+ PRINTK(KERN_WARNING,"Could not register procfs file entry");
+ return -ENXIO;
+ }
+- entry->owner = THIS_MODULE;
+ entry->data = qc;
+ entry->read_proc = qc_proc_button_read;
+ entry->write_proc = qc_proc_write;
+@@ -1179,13 +1175,11 @@
+ PRINTK(KERN_WARNING,"Could not register procfs dir entry");
+ return -ENXIO;
+ }
+- qc_proc_video_entry->owner = THIS_MODULE;
+ qc_proc_quickcam_entry = create_proc_entry(qc_proc_quickcam_name, S_IFDIR, qc_proc_video_entry);
+ if (!qc_proc_quickcam_entry) {
+ PRINTK(KERN_WARNING,"Could not register procfs dir entry");
+ return -ENXIO;
+ }
+- qc_proc_quickcam_entry->owner = THIS_MODULE;
+ return 0;
+ }
+ /* }}} */
+@@ -2622,7 +2616,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct video_device *dev = video_devdata(file);
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
+ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ struct qc_frame_data *fd = &qc->frame_data;
+ int mask;
+
+@@ -2674,7 +2672,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct video_device *dev = video_devdata(file);
+ #endif
+- struct quickcam *qc = dev->priv;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
++ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ int r;
+
+ if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_open(qc=%p)", qc);
+@@ -2739,7 +2741,11 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ struct video_device *dev = video_devdata(file);
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
+ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_close(dev=%p,qc=%p)",dev,qc);
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+@@ -2788,7 +2794,11 @@
+ struct video_device *dev = video_devdata(file);
+ int noblock = file->f_flags & O_NONBLOCK;
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
+ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ int frame_len;
+ unsigned char *frame;
+ long r = 0;
+@@ -2845,7 +2855,11 @@
+ const void *start = (void *)vma->vm_start;
+ unsigned long size = vma->vm_end - vma->vm_start;
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
+ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ unsigned char *frame;
+ int ret = 0, frame_size;
+ #if !HAVE_VMA && LINUX_VERSION_CODE<KERNEL_VERSION(2,6,0)
+@@ -2877,7 +2891,11 @@
+ struct video_device *dev = video_devdata(file);
+ void *argp = (void *)arg;
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
++#else
+ struct quickcam *qc = (struct quickcam *)dev->priv;
++#endif
+ int i, retval = 0;
+
+ if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_ioctl(dev=%p,cmd=%u,arg=%p,qc=%p)",dev,cmd,argp,qc);
+@@ -2895,7 +2913,7 @@
+ if (qcdebug&QC_DEBUGUSER) PDEBUG("VIDIOCGCAP");
+ memset(&b, 0, sizeof(b));
+ strcpy(b.name, "Logitech QuickCam USB"); /* Max 31 characters */
+- b.type = qc->vdev.type;
++ b.type = qc->vdev.vfl_type;
+ b.channels = 1;
+ b.audios = 0;
+ b.maxwidth = qc->sensor_data.maxwidth;
+@@ -3484,7 +3502,7 @@
+
+ static struct video_device qc_v4l_template = {
+ name: "QuickCam USB",
+- type: VID_TYPE_CAPTURE, // | VID_TYPE_SUBCAPTURE,
++ vfl_type: VID_TYPE_CAPTURE, // | VID_TYPE_SUBCAPTURE,
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ hardware: VID_HARDWARE_QCAM_USB,
+ #endif
+@@ -3662,7 +3680,7 @@
+ #endif
+ /* Register input device for button */
+ qc->input_ptr->name = "Quickcam snapshot button";
+- qc->input_ptr->private = qc;
++ input_set_drvdata(qc->input_ptr, qc);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+ qc->input_ptr->evbit[0] = BIT_MASK(EV_KEY);
+ qc->input_ptr->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
+@@ -3736,7 +3754,12 @@
+
+ /* Register V4L video device */
+ memcpy(&qc->vdev, &qc_v4l_template, sizeof(qc_v4l_template));
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
++ video_set_drvdata(&qc->vdev, qc);
++#else
+ qc->vdev.priv = qc;
++#endif
+
+ mb();
+ r = video_register_device(&qc->vdev, VFL_TYPE_GRABBER, video_nr);
+Only in qc-usb-messenger-1.8.my: qc-driver.c.rej
+Only in qc-usb-messenger-1.8.my: qc-driver.o
+Only in qc-usb-messenger-1.8.my: .qc-driver.o.cmd
+Only in qc-usb-messenger-1.8.my: qc-formats.o
+Only in qc-usb-messenger-1.8.my: .qc-formats.o.cmd
+diff -wbBur qc-usb-messenger-1.8/qc-memory.c qc-usb-messenger-1.8.my/qc-memory.c
+--- qc-usb-messenger-1.8/qc-memory.c 2006-11-05 06:36:51.000000000 +0000
++++ qc-usb-messenger-1.8.my/qc-memory.c 2010-04-12 15:58:26.000000000 +0000
+@@ -27,7 +27,7 @@
+ */
+ /* }}} */
+ /* {{{ [fold] Includes */
+-#include <linux/autoconf.h>
++#include <generated/autoconf.h>
+ #include <linux/version.h>
+
+ #ifdef CONFIG_SMP
+@@ -81,12 +81,14 @@
+ #define pte_offset(pmd,adr) pte_offset_map(pmd,adr) /* Emulation for a kernel using the new rmap-vm */
+ #endif /* Fix by Michele Balistreri <brain87@gmx.net> */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+ #ifndef SetPageReserved
+ #define SetPageReserved(p) mem_map_reserve(p)
+ #endif
+ #ifndef ClearPageReserved
+ #define ClearPageReserved(p) mem_map_unreserve(p)
+ #endif
++#endif
+ /* }}} */
+
+ /* {{{ [fold] kvirt_to_pa(): obtain physical address from virtual address obtained by vmalloc() */
+Only in qc-usb-messenger-1.8.my: qc-memory.c.rej
+Only in qc-usb-messenger-1.8.my: qc-memory.o
+Only in qc-usb-messenger-1.8.my: .qc-memory.o.cmd
+Only in qc-usb-messenger-1.8.my: qcmessenger.ko
+Only in qc-usb-messenger-1.8.my: .qcmessenger.ko.cmd
+Only in qc-usb-messenger-1.8.my: qcmessenger.mod.c
+Only in qc-usb-messenger-1.8.my: qcmessenger.mod.o
+Only in qc-usb-messenger-1.8.my: .qcmessenger.mod.o.cmd
+Only in qc-usb-messenger-1.8.my: qcmessenger.o
+Only in qc-usb-messenger-1.8.my: .qcmessenger.o.cmd
+Only in qc-usb-messenger-1.8.my: qcset
+Only in qc-usb-messenger-1.8.my: qc-vv6450.o
+Only in qc-usb-messenger-1.8.my: .qc-vv6450.o.cmd
+diff -wbBur qc-usb-messenger-1.8/quickcam.h qc-usb-messenger-1.8.my/quickcam.h
+--- qc-usb-messenger-1.8/quickcam.h 2008-05-27 06:53:17.000000000 +0000
++++ qc-usb-messenger-1.8.my/quickcam.h 2010-04-12 15:58:33.000000000 +0000
+@@ -92,7 +92,7 @@
+
+ #include <linux/version.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
+-#include <linux/autoconf.h>
++#include <generated/autoconf.h>
+ #else
+ #include <linux/config.h>
+ #endif
+@@ -242,7 +242,7 @@
+ #if LINUX_VERSION_CODE<KERNEL_VERSION(2,4,20) || LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,0)
+ /* Things come and go... */
+ /* Used only for debugging, so this could be actually removed if needed */
+-#define sem_getcount(sem) atomic_read(&(sem)->count)
++#define sem_getcount(sem) 0
+ #endif
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+Only in qc-usb-messenger-1.8.my: quickcam.h.rej
+diff -wbBur qc-usb-messenger-1.8/quickcam.sh qc-usb-messenger-1.8.my/quickcam.sh
+--- qc-usb-messenger-1.8/quickcam.sh 2008-05-27 06:53:16.000000000 +0000
++++ qc-usb-messenger-1.8.my/quickcam.sh 2010-04-12 15:58:18.000000000 +0000
+@@ -374,7 +374,7 @@
+ echo "[!] Can not find version.h in kernel source."
+ KERNELOK="n"
+ fi
+-if [ ! -r "$KERNEL_SOURCE/include/linux/autoconf.h" ]; then
++if [ ! -r "$KERNEL_SOURCE/include/generated/autoconf.h" ]; then
+ echo "[!] Kernel source is not configured properly."
+ KERNELOK="n"
+ fi
+@@ -414,7 +414,7 @@
+ echo "[!] Can still not find version.h in kernel source."
+ KERNELOK="n"
+ fi
+- if [ ! -r "$KERNEL_SOURCE/include/linux/autoconf.h" ]; then
++ if [ ! -r "$KERNEL_SOURCE/include/generated/autoconf.h" ]; then
+ echo "[!] Kernel source is still not configured properly."
+ KERNELOK="n"
+ fi
+Only in qc-usb-messenger-1.8.my: .tmp_versions
diff --git a/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.36.patch b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.36.patch
new file mode 100644
index 000000000..426bf95a7
--- /dev/null
+++ b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.36.patch
@@ -0,0 +1,12 @@
+diff -wbBur qc-usb-messenger-1.8/qc-driver.c qc-usb-messenger-1.8.my/qc-driver.c
+--- qc-usb-messenger-1.8/qc-driver.c 2008-05-26 11:29:16.000000000 +0000
++++ qc-usb-messenger-1.8.my/qc-driver.c 2010-12-16 14:08:06.000000000 +0000
+@@ -3476,7 +3494,7 @@
+ release: qc_v4l_close,
+ read: qc_v4l_read,
+ // write: qc_v4l_write,
+- ioctl: qc_v4l_ioctl,
++ compat_ioctl: qc_v4l_ioctl,
+ mmap: qc_v4l_mmap,
+ poll: qc_v4l_poll,
+ };
diff --git a/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.37.patch b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.37.patch
new file mode 100644
index 000000000..234f21e53
--- /dev/null
+++ b/community/qc-usb-messenger/qc-usb-messenger-kernel-2.6.37.patch
@@ -0,0 +1,21 @@
+diff -wbBur qc-usb-messenger-1.8/qc-driver.c qc-usb-messenger-1.8.my/qc-driver.c
+--- qc-usb-messenger-1.8/qc-driver.c 2008-05-26 11:29:16.000000000 +0000
++++ qc-usb-messenger-1.8.my/qc-driver.c 2011-02-03 15:21:38.000000000 +0000
+@@ -225,7 +223,7 @@
+ };
+
+ static LIST_HEAD(quickcam_list); /* Linked list containing all QuickCams */
+-static DECLARE_MUTEX(quickcam_list_lock); /* Always lock first quickcam_list_lock, then qc->lock */
++static struct semaphore quickcam_list_lock; /* Always lock first quickcam_list_lock, then qc->lock */
+
+ /* Default values for user-specified lookup-table; may be overwritten by user */
+ static unsigned char userlut_contents[QC_LUT_SIZE] = {
+@@ -3588,7 +3606,7 @@
+ PDEBUG("poisoning qc in qc_usb_init");
+ POISON(*qc);
+ if (qcdebug&QC_DEBUGMUTEX) PDEBUG("init down(%p) in qc_usb_init()", qc);
+- init_MUTEX_LOCKED(&qc->lock);
++ sema_init(&qc->lock, 1);
+ qc->users = 0;
+ qc->dev = usbdev;
+ qc->iface = ifacenum;
diff --git a/community/qc-usb-messenger/qc-usb-messenger.install b/community/qc-usb-messenger/qc-usb-messenger.install
new file mode 100644
index 000000000..3f6611aea
--- /dev/null
+++ b/community/qc-usb-messenger/qc-usb-messenger.install
@@ -0,0 +1,35 @@
+# This is a default template for a post-install scriptlet. You can
+# remove any functions you don't need (and this header).
+
+# arg 1: the new package version
+pre_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+post_install() {
+ /sbin/depmod -a
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ /bin/true
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ /sbin/depmod -a
+}
+
+# arg 1: the old package version
+pre_remove() {
+ /bin/true
+}
+
+# arg 1: the old package version
+post_remove() {
+ /sbin/depmod -a
+}
+