summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-05-28 07:46:27 +0000
committerMichael Hunold <devnull@localhost>2003-05-28 07:46:27 +0000
commit0df7b4ed2d78a2ba2001aaee8963cc1091b4070b (patch)
tree6857fa30358730a8c9b0ffdecf961e3e0bce54e6 /linux/drivers
parent2feacfc60c10a49db84307b7e1fb63d19349d484 (diff)
downloadmediapointer-dvb-s2-0df7b4ed2d78a2ba2001aaee8963cc1091b4070b.tar.gz
mediapointer-dvb-s2-0df7b4ed2d78a2ba2001aaee8963cc1091b4070b.tar.bz2
Feed 2.5 changes to CVS.
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/dvb-core/Kconfig10
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_compat.c5
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_compat.h9
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c47
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.h5
5 files changed, 37 insertions, 39 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/Kconfig b/linux/drivers/media/dvb/dvb-core/Kconfig
index ea925e5c0..99e2d6b9d 100644
--- a/linux/drivers/media/dvb/dvb-core/Kconfig
+++ b/linux/drivers/media/dvb/dvb-core/Kconfig
@@ -5,13 +5,3 @@ config DVB_CORE
DVB core utility functions for device handling, software fallbacks etc.
Say Y when you have a DVB card and want to use it. If unsure say N.
-
-config DVB_DEVFS_ONLY
- bool "devfs only"
- depends on DVB_CORE=y && DEVFS_FS
- help
- If you rely completly on devfs, you can drop support for the old
- major/minor device scheme. This omits some really awkward lines of
- code and saves some space in your kernel image.
-
- But as always: If unsure say N.
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.c b/linux/drivers/media/dvb/dvb-core/dvb_compat.c
index 0b35ed168..bc10b5b78 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_compat.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.c
@@ -9,6 +9,11 @@
*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+devfs_handle_t dvb_devfs_handle;
+EXPORT_SYMBOL(dvb_devfs_handle);
+#endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
static
u32 crc32_table[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
index d2793a5d9..0cd86638a 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h
@@ -6,6 +6,15 @@
#include <linux/smp_lock.h>
#include <linux/version.h>
#include <linux/fs.h>
+#include <linux/devfs_fs_kernel.h>
+
+#define irqreturn_t void
+#define IRQ_NONE
+#define IRQ_HANDLED
+#define strlcpy strncpy
+extern devfs_handle_t dvb_devfs_handle;
+
+int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...);
/* necessary dummy functions due to the > 2.5.67 kernel i2c changes */
#define i2c_get_adapdata(adapter) (struct saa7146_dev*)adapter->data;
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index 3848c873f..1963ac731 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -38,9 +38,6 @@
static int dvbdev_debug = 0;
#define dprintk if (dvbdev_debug) printk
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-static devfs_handle_t dvb_devfs_handle;
-#endif
static LIST_HEAD(dvb_adapter_list);
static DECLARE_MUTEX(dvbdev_register_lock);
@@ -194,7 +191,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
const struct dvb_device *template, void *priv, int type)
{
struct dvb_device *dvbdev;
- char name[64];
int id;
if (down_interruptible (&dvbdev_register_lock))
@@ -225,6 +221,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
list_add_tail (&dvbdev->list_head, &adap->device_list);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+ {
+ char name[64];
snprintf(name, sizeof(name), "%s%d", dnames[type], id);
dvbdev->devfs_handle = devfs_register(adap->devfs_handle, name,
DEVFS_FL_DEFAULT,
@@ -232,18 +230,19 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
nums2minor(adap->num, type, id),
S_IFCHR | S_IRUSR | S_IWUSR,
dvbdev->fops, dvbdev);
-#else
- snprintf(name, sizeof(name), "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
- dvbdev->devfs_handle = devfs_register(NULL, name,
- DEVFS_FL_DEFAULT,
- DVB_MAJOR,
- nums2minor(adap->num, type, id),
- S_IFCHR | S_IRUSR | S_IWUSR,
- dvbdev->fops, dvbdev);
-#endif
dprintk("DVB: register adapter%d/%s @ minor: %i (0x%02x)\n",
adap->num, name, nums2minor(adap->num, type, id),
nums2minor(adap->num, type, id));
+ }
+#else
+ devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
+ S_IFCHR | S_IRUSR | S_IWUSR,
+ "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
+
+ dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
+ adap->num, dnames[type], id, nums2minor(adap->num, type, id),
+ nums2minor(adap->num, type, id));
+#endif
return 0;
}
@@ -251,21 +250,14 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
void dvb_unregister_device(struct dvb_device *dvbdev)
{
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
- char name[64];
- struct dvb_adapter *adap = dvbdev->adapter;
-#endif
-
if (!dvbdev)
return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
devfs_unregister(dvbdev->devfs_handle);
#else
- snprintf(name, sizeof(name), "dvb/adapter%d/%s%d", adap->num, dnames[dvbdev->type], dvbdev->id);
- /* fixme */
- printk("dvb_unregister_device: %s\n",name);
- devfs_remove(name);
+ devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num,
+ dnames[dvbdev->type], dvbdev->id);
#endif
list_del (&dvbdev->list_head);
kfree (dvbdev);
@@ -296,7 +288,6 @@ skip:
int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
{
- char dirname[64];
struct dvb_adapter *adap;
int num;
@@ -319,11 +310,13 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
printk ("DVB: registering new adapter (%s).\n", name);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+ {
+ char dirname[64];
snprintf(dirname, sizeof(dirname), "adapter%d", num);
adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL);
+ }
#else
- snprintf(dirname, sizeof(dirname), "dvb/adapter%d", num);
- devfs_mk_dir(dirname);
+ devfs_mk_dir("dvb/adapter%d", num);
#endif
adap->num = num;
adap->name = name;
@@ -341,9 +334,7 @@ int dvb_unregister_adapter(struct dvb_adapter *adap)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
devfs_unregister(adap->devfs_handle);
#else
- char dirname[64]; /* fixme */
- snprintf(dirname, sizeof(dirname), "dvb/adapter%d", adap->num);
- devfs_remove(dirname);
+ devfs_remove("dvb/adapter%d", adap->num);
#endif
if (down_interruptible (&dvbdev_register_lock))
return -ERESTARTSYS;
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
index 33b8089b2..d1d9922c1 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -27,7 +27,6 @@
#include <asm/types.h>
#include <linux/poll.h>
#include <linux/fs.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/list.h>
#define DVB_MAJOR 250
@@ -45,7 +44,9 @@
struct dvb_adapter {
int num;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
devfs_handle_t devfs_handle;
+#endif
struct list_head list_head;
struct list_head device_list;
const char *name;
@@ -55,7 +56,9 @@ struct dvb_adapter {
struct dvb_device {
struct list_head list_head;
struct file_operations *fops;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
devfs_handle_t devfs_handle;
+#endif
struct dvb_adapter *adapter;
int type;
u32 id;