em28xx  

Re: [Em28xx] Compile fails on kubuntu 8.04 (kernel 2.6.24-5)

Edward J. Sheldrake
Thu, 31 Jan 2008 00:45:57 -0800

--- TommyDrum <[EMAIL PROTECTED]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello list!
> 
> I have used the em2880-dvb module with my Cinergy USB Hybrid T XS
> with
> great success up until this update I made to my box which previously
> ran
> Kubuntu 7.10.
> 
> The compile failure occurs either with the v4l-dvb-kernel or with the
> v4l-experimental (posted both):
<snip> 
> Any hints?
> 
> Cheers,
> Tommy

I had a go at fixing all the compile errors caused by the changes in
kernel 2.6.24, the patch is attached (I just googled each error). Apply
it with "patch -p1". Also, something in the Makefiles must have
changed, so you'll need to do

make LINUXINCLUDE="-I`pwd`/linux/include -I`pwd`/v4l -Iinclude -include
include/linux/autoconf.h"

I can only test it with the analogue side of an em28xx device (HVR
900), and it does not work anymore - all I get is static regardless of
what channel I try to set. But it may work for you. If not, we'll have
to wait for the userspace drivers from Markus.

Good luck,
Edward Sheldrake


      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/common/saa7146_core.c v4l-dvb-kernel/linux/drivers/media/common/saa7146_core.c
--- v4l-dvb-kernel.orig/linux/drivers/media/common/saa7146_core.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/common/saa7146_core.c	2008-01-27 11:34:35.000000000 +0000
@@ -117,8 +117,9 @@
 		if (NULL == pg)
 			goto err;
 		BUG_ON(PageHighMem(pg));
-		sglist[i].page   = pg;
-		sglist[i].length = PAGE_SIZE;
+		/* sglist[i].page   = pg;
+		sglist[i].length = PAGE_SIZE; */
+		sg_set_page(&sglist[i], pg, PAGE_SIZE, 0);
 	}
 	return sglist;
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/dvb/dvb-core/dvbdev.c v4l-dvb-kernel/linux/drivers/media/dvb/dvb-core/dvbdev.c
--- v4l-dvb-kernel.orig/linux/drivers/media/dvb/dvb-core/dvbdev.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/dvb/dvb-core/dvbdev.c	2008-01-27 11:18:32.000000000 +0000
@@ -120,10 +120,7 @@
 	.open =		dvb_device_open,
 };
 
-static struct cdev dvb_device_cdev = {
-	.kobj   = {.name = "dvb", },
-	.owner  =       THIS_MODULE,
-};
+static struct cdev dvb_device_cdev;
 
 int dvb_generic_open(struct inode *inode, struct file *file)
 {
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/dvb/dvb-core/dvb_net.c v4l-dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_net.c
--- v4l-dvb-kernel.orig/linux/drivers/media/dvb/dvb-core/dvb_net.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_net.c	2008-01-27 11:19:35.000000000 +0000
@@ -1286,7 +1286,7 @@
 	dev->set_mac_address    = dvb_net_set_mac;
 	dev->mtu		= 4096;
 	dev->mc_count           = 0;
-	dev->hard_header_cache  = NULL;
+	/* dev->hard_header_cache  = NULL; */
 	dev->flags |= IFF_NOARP;
 }
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/bt8xx/bttv-i2c.c v4l-dvb-kernel/linux/drivers/media/video/bt8xx/bttv-i2c.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/bt8xx/bttv-i2c.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/bt8xx/bttv-i2c.c	2008-01-27 11:15:54.000000000 +0000
@@ -131,12 +131,6 @@
 /* ----------------------------------------------------------------------- */
 /* I2C functions - hardware i2c                                            */
 
-static int algo_control(struct i2c_adapter *adapter,
-			unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
 static u32 functionality(struct i2c_adapter *adap)
 {
 	return I2C_FUNC_SMBUS_EMUL;
@@ -285,7 +279,6 @@
 
 static struct i2c_algorithm bttv_algo = {
 	.master_xfer   = bttv_i2c_xfer,
-	.algo_control  = algo_control,
 	.functionality = functionality,
 };
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/em28xx/em28xx-i2c.c v4l-dvb-kernel/linux/drivers/media/video/em28xx/em28xx-i2c.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/em28xx/em28xx-i2c.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/em28xx/em28xx-i2c.c	2008-01-27 11:22:53.000000000 +0000
@@ -568,15 +568,6 @@
 /* ----------------------------------------------------------- */
 
 /*
- * algo_control()
- */
-static int algo_control(struct i2c_adapter *adapter,
-			unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
-/*
  * functionality()
  */
 static u32 functionality(struct i2c_adapter *adap)
@@ -585,7 +576,7 @@
 }
 
 #ifndef I2C_PEC
-static void inc_use(struct i2c_adapter *adap)
+/* static void inc_use(struct i2c_adapter *adap)
 {
 	MOD_INC_USE_COUNT;
 }
@@ -593,7 +584,7 @@
 static void dec_use(struct i2c_adapter *adap)
 {
 	MOD_DEC_USE_COUNT;
-}
+} */
 #endif
 
 static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client)
@@ -768,7 +759,6 @@
 
 static struct i2c_algorithm em28xx_algo = {
 	.master_xfer   = em28xx_i2c_xfer,
-	.algo_control  = algo_control,
 	.functionality = functionality,
 };
 
@@ -776,8 +766,8 @@
 #ifdef I2C_PEC
 	.owner = THIS_MODULE,
 #else
-	.inc_use = inc_use,
-	.dec_use = dec_use,
+	/* .inc_use = inc_use,
+	.dec_use = dec_use, */
 #endif
 #ifdef I2C_CLASS_TV_ANALOG
 	.class = I2C_CLASS_TV_ANALOG,
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/ivtv/ivtv-udma.c v4l-dvb-kernel/linux/drivers/media/video/ivtv/ivtv-udma.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/ivtv/ivtv-udma.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/ivtv/ivtv-udma.c	2008-01-27 11:30:14.000000000 +0000
@@ -50,7 +50,8 @@
 			dma->SGlist[map_offset].length = PAGE_SIZE - offset;
 		}
 		dma->SGlist[map_offset].offset = offset;
-		dma->SGlist[map_offset].page = dma->map[map_offset];
+		/* dma->SGlist[map_offset].page = dma->map[map_offset]; */
+		sg_set_page(&dma->SGlist[map_offset], dma->map[map_offset], dma->SGlist[map_offset].length, offset);
 		offset = 0;
 		map_offset++;
 	}
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c v4l-dvb-kernel/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c	2008-01-27 11:31:31.000000000 +0000
@@ -601,12 +601,6 @@
 	return ret;
 }
 
-static int pvr2_i2c_control(struct i2c_adapter *adapter,
-			    unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
 static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
 {
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C | I2C_FUNC_SMBUS_BYTE_DATA;
@@ -1053,7 +1047,6 @@
 	.id            = I2C_HW_B_BT848,
 #endif
 	.master_xfer   = pvr2_i2c_xfer,
-	.algo_control  = pvr2_i2c_control,
 	.functionality = pvr2_i2c_functionality,
 };
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/saa7134/saa7134-i2c.c v4l-dvb-kernel/linux/drivers/media/video/saa7134/saa7134-i2c.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/saa7134/saa7134-i2c.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/saa7134/saa7134-i2c.c	2008-01-27 11:32:40.000000000 +0000
@@ -321,12 +321,6 @@
 
 /* ----------------------------------------------------------- */
 
-static int algo_control(struct i2c_adapter *adapter,
-			unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
 static u32 functionality(struct i2c_adapter *adap)
 {
 	return I2C_FUNC_SMBUS_EMUL;
@@ -510,7 +504,6 @@
 
 static struct i2c_algorithm saa7134_algo = {
 	.master_xfer   = saa7134_i2c_xfer,
-	.algo_control  = algo_control,
 	.functionality = functionality,
 };
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/usbvideo/konicawc.c v4l-dvb-kernel/linux/drivers/media/video/usbvideo/konicawc.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/usbvideo/konicawc.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/usbvideo/konicawc.c	2008-01-27 11:49:46.000000000 +0000
@@ -254,7 +254,7 @@
 #endif
 
 	input_dev->evbit[0] = BIT(EV_KEY);
-	input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
+	input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
 
 	input_dev->private = cam;
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/usbvideo/quickcam_messenger.c v4l-dvb-kernel/linux/drivers/media/video/usbvideo/quickcam_messenger.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/usbvideo/quickcam_messenger.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/usbvideo/quickcam_messenger.c	2008-01-27 11:50:31.000000000 +0000
@@ -116,7 +116,7 @@
 #endif
 
 	input_dev->evbit[0] = BIT(EV_KEY);
-	input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
+	input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
 
 	input_dev->private = cam;
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/usbvision/usbvision-cards.c v4l-dvb-kernel/linux/drivers/media/video/usbvision/usbvision-cards.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/usbvision/usbvision-cards.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/usbvision/usbvision-cards.c	2008-01-27 11:54:09.000000000 +0000
@@ -1082,6 +1082,7 @@
 	{ USB_DEVICE(0x2304, 0x0301), .driver_info=PINNA_LINX_VD_IN_CAB_PAL },
 	{ USB_DEVICE(0x2304, 0x0419), .driver_info=PINNA_PCTV_BUNGEE_PAL_FM },
 	{ USB_DEVICE(0x2400, 0x4200), .driver_info=HPG_WINTV },
+	{ },    /* terminate list */
 };
 
 MODULE_DEVICE_TABLE (usb, usbvision_table);
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/usbvision/usbvision-i2c.c v4l-dvb-kernel/linux/drivers/media/video/usbvision/usbvision-i2c.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/usbvision/usbvision-i2c.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/usbvision/usbvision-i2c.c	2008-01-27 11:38:13.000000000 +0000
@@ -188,18 +188,13 @@
 	return num;
 }
 
-static int algo_control(struct i2c_adapter *adapter, unsigned int cmd, unsigned long arg)
-{
-	return 0;
-}
-
 static u32 functionality(struct i2c_adapter *adap)
 {
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
 }
 
 #ifndef I2C_PEC
-static void inc_use(struct i2c_adapter *adap)
+/* static void inc_use(struct i2c_adapter *adap)
 {
 	MOD_INC_USE_COUNT;
 }
@@ -207,7 +202,7 @@
 static void dec_use(struct i2c_adapter *adap)
 {
 	MOD_DEC_USE_COUNT;
-}
+} */
 #endif
 
 /* -----exported algorithm data: -------------------------------------	*/
@@ -222,7 +217,6 @@
 #endif
 	.master_xfer   = usbvision_i2c_xfer,
 	.smbus_xfer    = NULL,
-	.algo_control  = algo_control,
 	.functionality = functionality,
 };
 
@@ -542,8 +536,8 @@
 #ifdef I2C_PEC
 	.owner = THIS_MODULE,
 #else
-	.inc_use = inc_use,
-	.dec_use = dec_use,
+	/* .inc_use = inc_use,
+	.dec_use = dec_use, */
 #endif
 	.name              = "usbvision",
 	.id                = I2C_HW_B_BT848, /* FIXME */
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/v4l1-compat.c v4l-dvb-kernel/linux/drivers/media/video/v4l1-compat.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/v4l1-compat.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/v4l1-compat.c	2008-01-27 11:39:48.000000000 +0000
@@ -146,7 +146,7 @@
 	[VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
 };
 
-static unsigned int __attribute_pure__
+static unsigned int __pure
 palette_to_pixelformat(unsigned int palette)
 {
 	if (palette < ARRAY_SIZE(palette2pixelformat))
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/video-buf.c v4l-dvb-kernel/linux/drivers/media/video/video-buf.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/video-buf.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/video-buf.c	2008-01-27 11:45:11.000000000 +0000
@@ -61,13 +61,15 @@
 	sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
 	if (NULL == sglist)
 		return NULL;
+	sg_init_table(sglist, nr_pages);
 	for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
 		pg = vmalloc_to_page(virt);
 		if (NULL == pg)
 			goto err;
 		BUG_ON(PageHighMem(pg));
-		sglist[i].page   = pg;
-		sglist[i].length = PAGE_SIZE;
+		/* sglist[i].page   = pg;
+		sglist[i].length = PAGE_SIZE; */
+		sg_set_page(&sglist[i], pg, PAGE_SIZE, 0);
 	}
 	return sglist;
 
@@ -87,22 +89,25 @@
 	sglist = kcalloc(nr_pages, sizeof(*sglist), GFP_KERNEL);
 	if (NULL == sglist)
 		return NULL;
+	sg_init_table(sglist, nr_pages);
 
 	if (NULL == pages[0])
 		goto nopage;
 	if (PageHighMem(pages[0]))
 		/* DMA to highmem pages might not work */
 		goto highmem;
-	sglist[0].page   = pages[0];
+	/* sglist[0].page   = pages[0];
 	sglist[0].offset = offset;
-	sglist[0].length = PAGE_SIZE - offset;
+	sglist[0].length = PAGE_SIZE - offset; */
+	sg_set_page(&sglist[0], pages[0], PAGE_SIZE - offset, offset);
 	for (i = 1; i < nr_pages; i++) {
 		if (NULL == pages[i])
 			goto nopage;
 		if (PageHighMem(pages[i]))
 			goto highmem;
-		sglist[i].page   = pages[i];
-		sglist[i].length = PAGE_SIZE;
+		/* sglist[i].page   = pages[i];
+		sglist[i].length = PAGE_SIZE; */
+		sg_set_page(&sglist[i], pages[i], PAGE_SIZE, 0);
 	}
 	return sglist;
 
diff -Naur v4l-dvb-kernel.orig/linux/drivers/media/video/w9968cf.c v4l-dvb-kernel/linux/drivers/media/video/w9968cf.c
--- v4l-dvb-kernel.orig/linux/drivers/media/video/w9968cf.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/drivers/media/video/w9968cf.c	2008-01-27 11:46:10.000000000 +0000
@@ -1566,7 +1566,6 @@
 
 	static struct i2c_algorithm algo = {
 		.smbus_xfer =    w9968cf_i2c_smbus_xfer,
-		.algo_control =  w9968cf_i2c_control,
 		.functionality = w9968cf_i2c_func,
 	};
 
diff -Naur v4l-dvb-kernel.orig/linux/sound/pci/bt87x.c v4l-dvb-kernel/linux/sound/pci/bt87x.c
--- v4l-dvb-kernel.orig/linux/sound/pci/bt87x.c	2008-01-27 11:10:13.000000000 +0000
+++ v4l-dvb-kernel/linux/sound/pci/bt87x.c	2008-01-27 11:37:01.000000000 +0000
@@ -858,7 +858,7 @@
 	const struct pci_device_id *supported;
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
-	supported = pci_match_device(&driver, pci);
+	supported = pci_match_id(driver.id_table, pci);
 #else
 	supported = pci_match_device(driver.id_table, pci);
 #endif
_______________________________________________
Em28xx mailing list
Em28xx@mcentral.de
http://mcentral.de/mailman/listinfo/em28xx