[cpia] Problem compiling cpia-1.2 under 2.4.2 kernel

Michael Jarvis michael@jarvis.com
Tue, 27 Feb 2001 08:01:29 -0600


When I attempt to compile the cpia-1.2 source for the 2.4.2 kernel, I get
an error in cpia.c around line 3906.  It looks as if the format of the
"struct video_device" has changed in the file
/usr/src/linux/include/linux/videodev.h.  Specificly, in cpia.c the
statement causing the error is:

static struct video_device cpia_template = {
	"CPiA Camera",
	VID_TYPE_CAPTURE,
	VID_HARDWARE_CPIA,
	cpia_open,              /* open */
	cpia_close,             /* close */
	cpia_read,              /* read */
	NULL,                   /* no write */
	NULL,                   /* no poll */
	cpia_ioctl,             /* ioctl */
	cpia_mmap,              /* mmap */
	cpia_video_init,        /* initialize */
	NULL,                   /* priv */
	0,                      /* busy */
	-1                      /* minor - unset */
};

The structure is now defined in /usr/src/linux/include/linux/videodev.h as:

struct video_device
{
	struct module *owner;
	char name[32];
	int type;
	int hardware;
	int (*open)(struct video_device *, int mode);
	void (*close)(struct video_device *);
	long (*read)(struct video_device *, char *, unsigned long, int noblock);
	/* Do we need a write method ? */
	long (*write)(struct video_device *, const char *, unsigned long, int noblock);
	#if LINUX_VERSION_CODE >= 0x020100
	unsigned int (*poll)(struct video_device *, struct file *, poll_table *);
	#endif
	int (*ioctl)(struct video_device *, unsigned int , void *);
	int (*mmap)(struct video_device *, const char *, unsigned long);
	int (*initialize)(struct video_device *);
	void *priv;             /* Used to be 'private' but that upsets C++ */
	int busy;
	int minor;
	devfs_handle_t devfs_handle;
};

Note that they don't match up.  I tried inserting a NULL pointer at the
beginning and setting devfs_handle to 0.  It fixed the compilation error,
but I have no idea what what the struct module *owner pointer should be
set to, or what should be used for the devfs_handle.

By the way this was using gcc 2.95.3 on a Mandrake 7.2 box.

Cheers,
Michael

-- 
Michael Jarvis
michael@jarvis.com
http://www.jarvis.com/home.php
"Freiheit stirbt in kleinen Stücken."