vserver 1.9.5.x5
[linux-2.6.git] / drivers / message / i2o / i2o_proc.c
index a535c7a..b176d0e 100644 (file)
  *                     Changes for new I2O API
  */
 
+#define OSM_NAME       "proc-osm"
+#define OSM_VERSION    "$Rev$"
+#define OSM_DESCRIPTION        "I2O ProcFS OSM"
+
 #define I2O_MAX_MODULES 4
 // FIXME!
 #define FMT_U64_HEX "0x%08x%08x"
@@ -60,7 +64,7 @@ static struct proc_dir_entry *i2o_proc_dir_root;
 
 /* proc OSM driver struct */
 static struct i2o_driver i2o_proc_driver = {
-       .name = "proc-osm",
+       .name = OSM_NAME,
 };
 
 static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len)
@@ -290,7 +294,7 @@ static char *bus_strings[] = {
        "CARDBUS"
 };
 
-int i2o_seq_show_hrt(struct seq_file *seq, void *v)
+static int i2o_seq_show_hrt(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        i2o_hrt *hrt = (i2o_hrt *) c->hrt.virt;
@@ -391,7 +395,7 @@ int i2o_seq_show_hrt(struct seq_file *seq, void *v)
        return 0;
 }
 
-int i2o_seq_show_lct(struct seq_file *seq, void *v)
+static int i2o_seq_show_lct(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        i2o_lct *lct = (i2o_lct *) c->lct;
@@ -521,7 +525,7 @@ int i2o_seq_show_lct(struct seq_file *seq, void *v)
        return 0;
 }
 
-int i2o_seq_show_status(struct seq_file *seq, void *v)
+static int i2o_seq_show_status(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        char prodstr[25];
@@ -718,7 +722,7 @@ int i2o_seq_show_status(struct seq_file *seq, void *v)
        return 0;
 }
 
-int i2o_seq_show_hw(struct seq_file *seq, void *v)
+static int i2o_seq_show_hw(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        static u32 work32[5];
@@ -775,7 +779,7 @@ int i2o_seq_show_hw(struct seq_file *seq, void *v)
 }
 
 /* Executive group 0003h - Executing DDM List (table) */
-int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
+static int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        int token;
@@ -851,7 +855,7 @@ int i2o_seq_show_ddm_table(struct seq_file *seq, void *v)
 }
 
 /* Executive group 0004h - Driver Store (scalar) */
-int i2o_seq_show_driver_store(struct seq_file *seq, void *v)
+static int i2o_seq_show_driver_store(struct seq_file *seq, void *v)
 {
        struct i2o_controller *c = (struct i2o_controller *)seq->private;
        u32 work32[8];
@@ -874,7 +878,7 @@ int i2o_seq_show_driver_store(struct seq_file *seq, void *v)
 }
 
 /* Executive group 0005h - Driver Store Table (table) */
-int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
+static int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
 {
        typedef struct _i2o_driver_store {
                u16 stored_ddm_index;
@@ -938,11 +942,6 @@ int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
                        seq_printf(seq, "                ");
                }
 
-#if 0
-               if (c->i2oversion == 0x02)
-                       seq_printf(seq, "%-d", dst->module_state);
-#endif
-
                seq_printf(seq, "%-#7x", dst->i2o_vendor_id);
                seq_printf(seq, "%-#8x", dst->module_id);
                seq_printf(seq, "%-29s", chtostr(dst->module_name_version, 28));
@@ -950,10 +949,6 @@ int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
                seq_printf(seq, "%8d ", dst->module_size);
                seq_printf(seq, "%8d ", dst->mpb_size);
                seq_printf(seq, "0x%04x", dst->module_flags);
-#if 0
-               if (c->i2oversion == 0x02)
-                       seq_printf(seq, "%d", dst->notification_level);
-#endif
                seq_printf(seq, "\n");
        }
 
@@ -962,7 +957,7 @@ int i2o_seq_show_drivers_stored(struct seq_file *seq, void *v)
 }
 
 /* Generic group F000h - Params Descriptor (table) */
-int i2o_seq_show_groups(struct seq_file *seq, void *v)
+static int i2o_seq_show_groups(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1038,7 +1033,7 @@ int i2o_seq_show_groups(struct seq_file *seq, void *v)
 }
 
 /* Generic group F001h - Physical Device Table (table) */
-int i2o_seq_show_phys_device(struct seq_file *seq, void *v)
+static int i2o_seq_show_phys_device(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1079,7 +1074,7 @@ int i2o_seq_show_phys_device(struct seq_file *seq, void *v)
 }
 
 /* Generic group F002h - Claimed Table (table) */
-int i2o_seq_show_claimed(struct seq_file *seq, void *v)
+static int i2o_seq_show_claimed(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1119,7 +1114,7 @@ int i2o_seq_show_claimed(struct seq_file *seq, void *v)
 }
 
 /* Generic group F003h - User Table (table) */
-int i2o_seq_show_users(struct seq_file *seq, void *v)
+static int i2o_seq_show_users(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1173,7 +1168,7 @@ int i2o_seq_show_users(struct seq_file *seq, void *v)
 }
 
 /* Generic group F005h - Private message extensions (table) (optional) */
-int i2o_seq_show_priv_msgs(struct seq_file *seq, void *v)
+static int i2o_seq_show_priv_msgs(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1222,7 +1217,7 @@ int i2o_seq_show_priv_msgs(struct seq_file *seq, void *v)
 }
 
 /* Generic group F006h - Authorized User Table (table) */
-int i2o_seq_show_authorized_users(struct seq_file *seq, void *v)
+static int i2o_seq_show_authorized_users(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1263,7 +1258,7 @@ int i2o_seq_show_authorized_users(struct seq_file *seq, void *v)
 }
 
 /* Generic group F100h - Device Identity (scalar) */
-int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
+static int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        static u32 work32[128]; // allow for "stuff" + up to 256 byte (max) serial number
@@ -1301,7 +1296,7 @@ int i2o_seq_show_dev_identity(struct seq_file *seq, void *v)
        return 0;
 }
 
-int i2o_seq_show_dev_name(struct seq_file *seq, void *v)
+static int i2o_seq_show_dev_name(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
 
@@ -1311,7 +1306,7 @@ int i2o_seq_show_dev_name(struct seq_file *seq, void *v)
 }
 
 /* Generic group F101h - DDM Identity (scalar) */
-int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
+static int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1348,7 +1343,7 @@ int i2o_seq_show_ddm_identity(struct seq_file *seq, void *v)
 }
 
 /* Generic group F102h - User Information (scalar) */
-int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
+static int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1380,7 +1375,7 @@ int i2o_seq_show_uinfo(struct seq_file *seq, void *v)
 }
 
 /* Generic group F103h - SGL Operating Limits (scalar) */
-int i2o_seq_show_sgl_limits(struct seq_file *seq, void *v)
+static int i2o_seq_show_sgl_limits(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        static u32 work32[12];
@@ -1427,7 +1422,7 @@ int i2o_seq_show_sgl_limits(struct seq_file *seq, void *v)
 }
 
 /* Generic group F200h - Sensors (scalar) */
-int i2o_seq_show_sensors(struct seq_file *seq, void *v)
+static int i2o_seq_show_sensors(struct seq_file *seq, void *v)
 {
        struct i2o_device *d = (struct i2o_device *)seq->private;
        int token;
@@ -1947,11 +1942,11 @@ static void i2o_proc_device_add(struct proc_dir_entry *dir,
 
        sprintf(buff, "%03x", dev->lct_data.tid);
 
-       pr_debug("Adding device /proc/i2o/iop%d/%s\n", dev->iop->unit, buff);
+       osm_debug("adding device /proc/i2o/%s/%s\n", dev->iop->name, buff);
 
        devdir = proc_mkdir(buff, dir);
        if (!devdir) {
-               printk(KERN_WARNING "i2o: Could not allocate procdir!\n");
+               osm_warn("Could not allocate procdir!\n");
                return;
        }
 
@@ -1987,13 +1982,10 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir,
 {
        struct proc_dir_entry *iopdir;
        struct i2o_device *dev;
-       char buff[10];
 
-       snprintf(buff, 10, "iop%d", c->unit);
+       osm_debug("adding IOP /proc/i2o/%s\n", c->name);
 
-       pr_debug("Adding IOP /proc/i2o/%s\n", buff);
-
-       iopdir = proc_mkdir(buff, dir);
+       iopdir = proc_mkdir(c->name, dir);
        if (!iopdir)
                return -1;
 
@@ -2027,7 +2019,7 @@ static void i2o_proc_iop_remove(struct proc_dir_entry *dir,
                        i2o_proc_subdir_remove(pe);
                        remove_proc_entry(pe->name, dir);
                }
-               pr_debug("Removing IOP /proc/i2o/iop%d\n", c->unit);
+               osm_debug("removing IOP /proc/i2o/%s\n", c->name);
                pe = tmp;
        }
 }
@@ -2085,6 +2077,8 @@ static int __init i2o_proc_init(void)
 {
        int rc;
 
+       printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");
+
        rc = i2o_driver_register(&i2o_proc_driver);
        if (rc)
                return rc;
@@ -2110,8 +2104,9 @@ static void __exit i2o_proc_exit(void)
 };
 
 MODULE_AUTHOR("Deepak Saxena");
-MODULE_DESCRIPTION("I2O procfs Handler");
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION(OSM_DESCRIPTION);
+MODULE_VERSION(OSM_VERSION);
 
 module_init(i2o_proc_init);
 module_exit(i2o_proc_exit);