The following patch against dvbdev.c (CVS version 1.8) creates the proc
directories
/proc/ost/
and 
/proc/ost/dev

All modules using dvbdev can than add to these directories, e.g.
/proc/ost/dev/frontend/debug
/proc/ost/dev/frontend/0/tuned

This is similar to what videodev.c does for video4linux.

Kai

--- driver/dvbdev.c     Fri Oct 12 13:42:42 2001
+++ driver_axcent/dvbdev.c      Fri Oct 12 13:45:34 2001
@@ -34,6 +34,7 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/kmod.h>
+#include <linux/proc_fs.h>
 
 #include "dvbdev.h"
 
@@ -41,6 +42,9 @@
 
 static struct dvb_device *dvb_device[DVB_NUM_DEVICES];
 devfs_handle_t dvb_devfs_handle;
+#if defined(CONFIG_PROC_FS)
+static struct proc_dir_entry *proc_dir_ost, *proc_dir_ost_dev;
+#endif
 
 static inline struct dvb_device *
 inode2dev (struct inode *inode)
@@ -191,10 +195,26 @@
        dvb_devfs_handle = devfs_mk_dir (NULL, "dvb", NULL);
        if(devfs_register_chrdev(DVB_MAJOR,"DVB", &dvb_device_fops))
        {
-               printk("video_dev: unable to get major %d\n",
DVB_MAJOR);
+               printk("dvbdev: unable to get major %d\n", DVB_MAJOR);
                return -EIO;
        }
 
+#if defined(CONFIG_PROC_FS)
+       proc_dir_ost = proc_mkdir("ost", NULL);
+       if (proc_dir_ost) {
+               proc_dir_ost->owner = THIS_MODULE;
+               proc_dir_ost_dev = proc_mkdir("dev", proc_dir_ost);
+               if (proc_dir_ost_dev) {
+                       proc_dir_ost_dev->owner = THIS_MODULE;
+               } else {
+                       remove_proc_entry("ost", NULL);
+               }
+       }
+       if (!proc_dir_ost || !proc_dir_ost_dev) {
+               printk(KERN_WARNING "dvbdev: unable to create proc
entry\n");
+       }
+#endif
+
        return 0;
 }
 
@@ -208,6 +228,12 @@
 {
        devfs_unregister_chrdev(DVB_MAJOR, "DVB");
         devfs_unregister(dvb_devfs_handle);
+#if defined(CONFIG_PROC_FS)
+       if (proc_dir_ost) {
+               remove_proc_entry("dev", proc_dir_ost);
+               remove_proc_entry("ost", NULL);
+       }
+#endif
 }
 #endif
 


--
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as 
subject.

Reply via email to