Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / drivers / message / i2o / i2o_proc.c
index e02ea8f..a61cb17 100644 (file)
  *                     Changes for new I2O API
  */
 
+#define OSM_NAME       "proc-osm"
+#define OSM_VERSION    "1.316"
+#define OSM_DESCRIPTION        "I2O ProcFS OSM"
+
 #define I2O_MAX_MODULES 4
 // FIXME!
 #define FMT_U64_HEX "0x%08x%08x"
@@ -52,7 +56,7 @@
 typedef struct _i2o_proc_entry_t {
        char *name;             /* entry name */
        mode_t mode;            /* mode */
-       struct file_operations *fops;   /* open function */
+       const struct file_operations *fops;     /* open function */
 } i2o_proc_entry;
 
 /* global I2O /proc/i2o entry */
@@ -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)
@@ -159,7 +163,7 @@ static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len)
  *     i2o_get_class_name -    do i2o class name lookup
  *     @class: class number
  *
- *     Return a descriptive string for an i2o class
+ *     Return a descriptive string for an i2o class.
  */
 static const char *i2o_get_class_name(int class)
 {
@@ -224,7 +228,7 @@ static const char *i2o_get_class_name(int class)
        case I2O_CLASS_FLOPPY_DEVICE:
                idx = 12;
                break;
-       case I2O_CLASS_BUS_ADAPTER_PORT:
+       case I2O_CLASS_BUS_ADAPTER:
                idx = 13;
                break;
        case I2O_CLASS_PEER_TRANSPORT_AGENT:
@@ -486,7 +490,7 @@ static int i2o_seq_show_lct(struct seq_file *seq, void *v)
                                seq_printf(seq, ", Unknown Device Type");
                        break;
 
-               case I2O_CLASS_BUS_ADAPTER_PORT:
+               case I2O_CLASS_BUS_ADAPTER:
                        if (lct->lct_entry[i].sub_class < BUS_TABLE_SIZE)
                                seq_printf(seq, ", %s",
                                           bus_ports[lct->lct_entry[i].
@@ -1938,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;
        }
 
@@ -1978,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;
 
@@ -2018,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;
        }
 }
@@ -2076,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;
@@ -2101,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);