On Apr 2, 2005 10:29 PM, Stephen Atkins <[EMAIL PROTECTED]> wrote:
> Paul K wrote:
> 
> >OK.. Clean copy of source. New patch. Maybe I'm applying the patch
> >incorrectly? Different errors in msp3400.c :
> >

No, you're probably doing it right, but I'm an idiot.  I put up two
different versions of the patch here with two different typos in them.
 I'm not sure how that happened 'cause I'm sure I did a compile before
posting the last one and it worked.  Anway, I've generated yet another
patch and verified that this one does, in fact, compile correctly. 
Try applying this one to another clean set of the source.

> I'm also using this patch with my pvr-150mce and a 2.4.25 kernel.  The
> only thing I had to do was get rid of the msp3400 part.  After that I
> could load the cx25840 drivers.  Just thought I would let you know.

Theoretically this patch should work just fine if you take out the
msp3400 portion of the patch before applying it.  However, the code is
much cleaner and less repetitive if you include the msp3400 changes. 
I wanted to make sure I included that portion of the patch though in
the hopes that someone will pick up this patch and apply it so future
versions of the driver will be compatible with 2.4 series kernels.

Brad
diff -ru ivtv-0.3.2q/driver/compat.h ivtv-0.3.2q.patched/driver/compat.h
--- ivtv-0.3.2q/driver/compat.h	2005-03-31 10:44:17.000000000 -0500
+++ ivtv-0.3.2q.patched/driver/compat.h	2005-04-02 23:30:58.000000000 -0500
@@ -22,6 +22,7 @@
 
 #include <linux/kernel.h>
 #include <linux/version.h>
+#include <linux/unistd.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 #define LINUX26 1
@@ -94,6 +95,12 @@
 	kfree(vfd);
 }
 
+#ifdef INIT_SIGHAND
+#define SIGMASK_LOCK(current)    (&(current)->sighand->siglock)
+#else
+#define SIGMASK_LOCK(current)    (&(current)->sigmask_lock)
+#endif
+
 #define IRQ_NONE
 #define IRQ_HANDLED
 #define IRQRETURN_T void
diff -ru ivtv-0.3.2q/driver/cx25840-driver.c ivtv-0.3.2q.patched/driver/cx25840-driver.c
--- ivtv-0.3.2q/driver/cx25840-driver.c	2005-03-31 10:44:15.000000000 -0500
+++ ivtv-0.3.2q.patched/driver/cx25840-driver.c	2005-04-02 13:06:10.000000000 -0500
@@ -615,7 +615,11 @@
 		if (sha1)
 			crypto_digest_init(sha1);
 		sg[0].page = virt_to_page(&fw_buffer[2]);
+#ifdef LINUX26
 		sg[0].offset = offset_in_page(&fw_buffer[2]);
+#else
+		sg[0].offset = ((unsigned long)(&fw_buffer[2]) & ~PAGE_MASK);
+#endif
 
 		tsize = 0;
 
diff -ru ivtv-0.3.2q/driver/ivtv-kthreads.c ivtv-0.3.2q.patched/driver/ivtv-kthreads.c
--- ivtv-0.3.2q/driver/ivtv-kthreads.c	2005-03-31 10:44:15.000000000 -0500
+++ ivtv-0.3.2q.patched/driver/ivtv-kthreads.c	2005-04-01 17:16:18.000000000 -0500
@@ -32,6 +32,7 @@
 #include "ivtv-kthreads.h"
 #include "ivtv-irq.h"
 #include "ivtv-video.h"
+#include "compat.h"
 
 #include <linux/smp_lock.h>
 
@@ -1015,17 +1016,9 @@
 					     atomic_read(&itv->dec_dma_stat.
 							 intr))) {
 #ifdef SCHED_NORMAL
-#ifndef INIT_SIGHAND
-			spin_lock_irq(&current->sighand->siglock);
-#else
-			spin_lock_irq(&current->sigmask_lock);
-#endif
+                        spin_lock_irq(SIGMASK_LOCK(current));
 			flush_signals(current);
-#ifndef INIT_SIGHAND
-			spin_unlock_irq(&current->sighand->siglock);
-#else
-			spin_unlock_irq(&current->sigmask_lock);
-#endif
+                        spin_unlock_irq(SIGMASK_LOCK(current));
 #else
 			spin_lock_irq(&current->sig->siglock);
 			flush_signals(current);
@@ -1081,17 +1074,9 @@
 					     atomic_read(&itv->
 							 enc_dma_stat_intr))) {
 #ifdef SCHED_NORMAL
-#ifndef INIT_SIGHAND
-			spin_lock_irq(&current->sighand->siglock);
-#else
-			spin_lock_irq(&current->sigmask_lock);
-#endif
+			spin_lock_irq(SIGMASK_LOCK(current));
 			flush_signals(current);
-#ifndef INIT_SIGHAND
-			spin_unlock_irq(&current->sighand->siglock);
-#else
-			spin_unlock_irq(&current->sigmask_lock);
-#endif
+			spin_unlock_irq(SIGMASK_LOCK(current));
 #else
 			spin_lock_irq(&current->sig->siglock);
 			flush_signals(current);
diff -ru ivtv-0.3.2q/driver/msp3400.c ivtv-0.3.2q.patched/driver/msp3400.c
--- ivtv-0.3.2q/driver/msp3400.c	2005-03-31 10:44:15.000000000 -0500
+++ ivtv-0.3.2q.patched/driver/msp3400.c	2005-04-01 17:16:36.000000000 -0500
@@ -62,12 +62,6 @@
 
 #include "compat.h"
 
-#ifdef INIT_SIGHAND
-#define SIGMASK_LOCK(current)   (&(current)->sighand->siglock)
-#else
-#define SIGMASK_LOCK(current)   (&(current)->sigmask_lock)
-#endif
-
 /* Addresses to scan */
 static unsigned short normal_i2c[] = { I2C_CLIENT_END };
 static unsigned short normal_i2c_range[] = { 0x40, 0x40, I2C_CLIENT_END };

Reply via email to