Skip to contentSkip to conversation

/proc/net/atm/<device> handling wrong 2.4.0-test9+

PATCH Berkley Shands 1 participant 1 message Nov 28, 2000

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This has been reported in the linux-atm mailing list as well.. /usr/src/linux/net/atm/proc.c has a problem.
in 2.4.0-test9 and later, the routine atm_proc_dev_register(); is called before atm_proc_init();
the latter is called at the very end of startup, long after the pci devices are
initialized. This results in the /proc devices being in /proc/eni:1 or /proc/wuapic:1
not in /proc/net/atm/eni:1 or /proc/net/atm/wuapic:1

here is a quicky patch to correct this.

net/atm/proc.c Tue Nov 28 10:24:17 2000 renamed from net/atm/proc.c Sat Jul 8 21:26:13 2000 +8 -0
diff -Naur linux-2.4.0-test11-clean/net/atm/proc.c linux/net/atm/proc.c
@@ -547,6 +547,11 @@
        int digits,num;
        int error;
 
+/* atm_proc_init isn't called until the end of the startup */
+/* so make the call now instead */
+
+       if (! atm_proc_root)
+          atm_proc_init();             /* force /proc/net/atm to exist */
        error = -ENOMEM;
        digits = 0;
        for (num = dev->number; num; num /= 10) digits++;
@@ -589,9 +594,12 @@
        struct proc_dir_entry *devices = NULL,*pvc = NULL,*svc = NULL;
        struct proc_dir_entry *arp = NULL,*lec = NULL,*vc = NULL;
 
+       if (atm_proc_root)
+          return 0;            /* already made */
        atm_proc_root = proc_mkdir("net/atm",NULL);
        if (!atm_proc_root)
                return -ENOMEM;
+
        CREATE_ENTRY(devices);
        CREATE_ENTRY(pvc);
        CREATE_ENTRY(svc);

berkley
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/