1 diff -u linux-2.4.22/drivers/media/video/videodev.c linux/drivers/media/video/videodev.c
2 --- linux-2.4.22/drivers/media/video/videodev.c 2003-09-08 17:26:56.000000000 +0200
3 +++ linux/drivers/media/video/videodev.c 2003-09-08 17:28:40.000000000 +0200
6 #endif /* CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS */
8 +struct video_device *video_device_alloc(void)
10 + struct video_device *vfd;
11 + vfd = kmalloc(sizeof(*vfd),GFP_KERNEL);
14 + memset(vfd,0,sizeof(*vfd));
18 +void video_device_release(struct video_device *vfd)
24 * Read will do some smarts later on. Buffer pin etc.
28 devfs_unregister (vfd->devfs_handle);
31 video_device[vfd->minor]=NULL;
35 module_init(videodev_init)
36 module_exit(videodev_exit)
38 +EXPORT_SYMBOL(video_device_alloc);
39 +EXPORT_SYMBOL(video_device_release);
40 EXPORT_SYMBOL(video_register_device);
41 EXPORT_SYMBOL(video_unregister_device);
42 EXPORT_SYMBOL(video_devdata);
43 diff -u linux-2.4.22/include/linux/videodev.h linux/include/linux/videodev.h
44 --- linux-2.4.22/include/linux/videodev.h 2003-09-08 17:27:56.000000000 +0200
45 +++ linux/include/linux/videodev.h 2003-09-08 17:28:40.000000000 +0200
47 #include <linux/types.h>
48 #include <linux/version.h>
52 - * v4l2 is still work-in-progress, integration planed for 2.5.x
53 - * v4l2 project homepage: http://www.thedirks.org/v4l2/
54 - * patches available from: http://bytesex.org/patches/
57 -# include <linux/videodev2.h>
64 #include <linux/poll.h>
65 +#include <linux/mm.h>
66 #include <linux/devfs_fs_kernel.h>
70 - struct module *owner;
72 - int type; /* v4l1 */
73 - int type2; /* v4l2 */
76 + int type; /* v4l1 */
77 + int type2; /* v4l2 */
81 + /* device ops + callbacks */
82 + struct file_operations *fops;
83 + void (*release)(struct video_device *vfd);
85 /* old, obsolete interface -- dropped in 2.5.x, don't use it */
86 int (*open)(struct video_device *, int mode);
87 void (*close)(struct video_device *);
89 int (*mmap)(struct video_device *, const char *, unsigned long);
90 int (*initialize)(struct video_device *);
92 - /* new interface -- we will use file_operations directly
93 - * like soundcore does. */
94 - struct file_operations *fops;
95 - void *priv; /* Used to be 'private' but that upsets C++ */
97 - /* for videodev.c intenal usage -- don't touch */
99 - struct semaphore lock;
100 - devfs_handle_t devfs_handle;
101 +#if 1 /* to be removed in 2.7.x */
102 + /* obsolete -- fops->owner is used instead */
103 + struct module *owner;
104 + /* dev->driver_data will be used instead some day.
105 + * Use the video_{get|set}_drvdata() helper functions,
106 + * so the switch over will be transparent for you.
107 + * Or use {pci|usb}_{get|set}_drvdata() directly. */
111 + /* for videodev.c intenal usage -- please don't touch */
112 + int users; /* video_exclusive_{open|close} ... */
113 + struct semaphore lock; /* ... helper function uses these */
114 + devfs_handle_t devfs_handle; /* devfs */
117 #define VIDEO_MAJOR 81
118 -extern int video_register_device(struct video_device *, int type, int nr);
120 #define VFL_TYPE_GRABBER 0
121 #define VFL_TYPE_VBI 1
122 #define VFL_TYPE_RADIO 2
123 #define VFL_TYPE_VTX 3
125 +extern int video_register_device(struct video_device *, int type, int nr);
126 extern void video_unregister_device(struct video_device *);
127 extern struct video_device* video_devdata(struct file*);
130 +/* helper functions to alloc / release struct video_device, the
131 + later can be used for video_device->release() */
132 +struct video_device *video_device_alloc(void);
133 +void video_device_release(struct video_device *vfd);
135 +/* helper functions to access driver private data. */
136 +static inline void *video_get_drvdata(struct video_device *dev)
141 +static inline void video_set_drvdata(struct video_device *dev, void *data)
146 extern int video_exclusive_open(struct inode *inode, struct file *file);
147 extern int video_exclusive_release(struct inode *inode, struct file *file);
148 extern int video_usercopy(struct inode *inode, struct file *file,
150 #define VID_HARDWARE_PWC 31 /* Philips webcams */
151 #define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */
152 #define VID_HARDWARE_CPIA2 33
153 -#define VID_HARDWARE_VICAM 34 /* ViCam, 3Com Homeconnect */
154 +#define VID_HARDWARE_VICAM 34
155 #define VID_HARDWARE_SF16FMR2 35
157 #endif /* __LINUX_VIDEODEV_H */