Partial devfs support for raw IO devices

Partial devfs support for raw IO devices

Post by Chris Ranki » Mon, 18 Jun 2001 13:30:08



Hi,
I hacked together this quick patch to make the "master" raw IO device
appear in devfs. It seems odd that I need *both* devfs_register...()
calls but the first one only seems to make the entry appear in
/proc/devices.

The logical corollary to this patch is to make raw IO devices
magically appear in devfs as they are bound to block devices. However,
this presents namespacing issues. Would it be reasonable to assume
that they should appear in a subdirectory called /dev/rawIO, e.g.

/dev/rawIO/1
/dev/rawIO/2  ... etc?

devfsd could then provide compatibility links.

Anyway, first things first :-)
Cheers,
Chris

--- linux-2.4.5/drivers/char/raw.c.orig Sat May 26 11:58:45 2001

 #include <linux/raw.h>
 #include <linux/capability.h>
 #include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
 #include <asm/uaccess.h>


 } raw_device_data_t;

 static raw_device_data_t raw_devices[256];
+static const char RAW_DEVICE_NAME[] = "raw";

 static ssize_t rw_raw_dev(int rw, struct file *, char *, size_t, loff_t *);

 static int __init raw_init(void)
 {
        int i;
-       register_chrdev(RAW_MAJOR, "raw", &raw_fops);
+       devfs_register_chrdev(RAW_MAJOR, RAW_DEVICE_NAME, &raw_fops);
+       devfs_register(NULL, RAW_DEVICE_NAME, DEVFS_FL_DEFAULT,
+                      RAW_MAJOR, 0,
+                      S_IFCHR | S_IRUSR | S_IWUSR,
+                      &raw_fops, NULL);

        for (i = 0; i < 256; i++)
                init_MUTEX(&raw_devices[i].mutex);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Devfs and raw devices

On Monday, 10 December 2001, at 18:13:40 -0500,

Somebody sent a patch to support raw devices on devfs a couple of days
ago. Search the list archives and it should be there. As far as I know,
Richard Gooch hasn't integrated this code into devfs yet.

--
Jos Luis Domingo Lpez
Linux Registered User #189436     Debian Linux Woody (P166 64 MB RAM)

jdomingo EN internautas PUNTO org  => ? Spam ? Atente a las consecuencias
jdomingo AT internautas DOT   org  => Spam at your own risk

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Survey

3. 2.4.21pre7 make raw devices appear in devfs

4. LILO on a 3 drive system

5. - Linux 2.4.5; devfs support for /dev/raw

6. Integer problem in shell !!

7. 2.5.70: raw.c devfs support

8. ftpserver shutdown

9. Raw Devices and Asynch IO on Sybase/Linux

10. Raw IO Device Drivers

11. PAGE_SIZE IO for RAW (RAW VARY)

12. raw vs quick-io vs direct io

13. device driver using devfs on system with not mounted devfs