Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Kernel 2.6.7 compatibility patch



Hi,
I'm not sure if this is the best way to do things, but I have created a patch to enable the cvs drivers to compile under kernel 2.6.7 (struct iovec / struct kvec difference)

Cheers,
Richard.


-- 
Richard Taylor
Software Engineer
Birmingham,
UK. 
(Only 9483 Days 'til retirement!)
--- temp/dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_net.c	2004-10-06 01:13:28.000000000 +0100
+++ dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_net.c	2004-10-08 13:52:07.000000000 +0100
@@ -37,6 +37,7 @@
 #include <linux/uio.h>
 #include <asm/uaccess.h>
 #include <linux/crc32.h>
+#include <linux/version.h>
 
 #include "dvb_demux.h"
 #include "dvb_net.h"
@@ -47,8 +48,11 @@
 
 #define dprintk(x...) do { if (dvb_net_debug) printk(x); } while (0)
 
-
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7))
+static inline __u32 iov_crc32( __u32 c, struct iovec *iov, unsigned int cnt )
+#else
 static inline __u32 iov_crc32( __u32 c, struct kvec *iov, unsigned int cnt )
+#endif
 {
 	unsigned int j;
 	for (j = 0; j < cnt; j++)
@@ -479,7 +483,11 @@
 			/* Check CRC32, we've got it in our skb already. */
 			unsigned short ulen = htons(priv->ule_sndu_len);
 			unsigned short utype = htons(priv->ule_sndu_type);
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7))
+			struct iovec iov[4] = {
+#else
 			struct kvec iov[4] = {
+#endif
 				{ &ulen, sizeof ulen },
 				{ &utype, sizeof utype },
 				{ NULL, 0 },

Home | Main Index | Thread Index