2.4.21pre7 make raw devices appear in devfs

2.4.21pre7 make raw devices appear in devfs

Post by Tom Reinhar » Tue, 08 Apr 2003 00:50:12



This short patch was originally posted a while back by someone else.  For
the original post and patch, see:

http://www.cs.helsinki.fi/linux/linux-kernel/2001-24/0435.html

This fix makes the raw devices appear in devfs.  Its useful for DVD movie
playback, among other things.

I've had this patch applied for 6 months running Gentoo Linux, and its still
working fine for me in 2.4.21pre7 so I thought I'd bring your attention to
it again.

Thanks,
Tom

--- drivers/char/raw.c.orig     2003-04-05 12:12:48.000000000 -0600

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


static int __init raw_init(void)
{
        int i;
-       register_chrdev(RAW_MAJOR, "raw", &raw_fops);
+       if (devfs_register_chrdev(RAW_MAJOR, "raw", &raw_fops) != 0) {
+               printk(KERN_ERR "Unable to get major device %d for raw block
devices",
+               RAW_MAJOR);
+       } else {
+               /*
+                * Make a directory for raw devices to go in ...
+                */
+               devfs_mk_dir(NULL, "raw", NULL);
+
+               /*
+                * Make the "control" device node for raw devices ...
+                */
+               devfs_register(NULL, "rawctl", 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);

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail

-
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. 2.4.21pre7, 2.4.21pre5ac3, 2.5.66 generic HDLC update

Hi,

The last update to generic HDLC is here:
ftp://ftp.pm.waw.pl/pub/linux/hdlc/hdlc-2.4.21pre7-1.14.patch
ftp://ftp.pm.waw.pl/pub/linux/hdlc/hdlc-2.4.21pre5-ac3-1.14.patch
ftp://ftp.pm.waw.pl/pub/linux/hdlc/hdlc-2.5.66-1.14.patch

This version fixes:
- missing rtnl_lock()/rtnl_unload() bug on unregister_hdlc_device
- N2, C101: interrupt handler now works under high IRQ load from other
  devices (with previous versions, the IRQ processing for the card could
  sometimes stop after reaching "work limit")

This is production-tested on devices I have access to (N2, C101, PC300,
PCI200SYN).
Please apply.
Thanks.

PS. It would be nice to have this code in final 2.4.21. In comparison
to 2.4.21pre7, this version fixes some small bugs and problems (TX packet
latency on HD64570-based boards), and provides support for Ethernet over
HDLC and Frame-Relay, while being API/ABI compatible (use of new features
require new version of user-space sethdlc tool).
--
Krzysztof Halasa
Network Administrator
-
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. Kernel compile problems-help!

3. 2.4.21-pre7 & 2.4.21-pre5-ac3 IDE resets

4. Cabeltron E2100 ethernet card with RH 6.0

5. cciss patches for 2.4.21pre7

6. Mach64 & Noisy screen

7. 2.4.21pre6 - devfs+alsa: could not append to parent, err: -17

8. help configuring Intel Ether Pro 100

9. Linux 2.4.21pre7-ac1

10. FW: cciss patches for 2.4.21pre7

11. kernel 2.4.21pre7 is unable to start my 2 rtl8139 cards

12. 2.4.21pre6 devfs + bluez: could not append to parent, err: -17

13. 2.4.21pre7 : amd74xx+nForce2+DMA+CD-RW = hang