]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SCSI] be2iscsi: Display driver name and version in device attribute
authorJohn Soni Jose <sony.john-n@emulex.com>
Fri, 19 Oct 2012 23:12:25 +0000 (04:42 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 27 Nov 2012 04:59:36 +0000 (08:59 +0400)
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/be2iscsi/be_mgmt.c
drivers/scsi/be2iscsi/be_mgmt.h

index 2d1bbb898d969eec1d17af1e807b4afeca2ce9b6..bd0f49f2b76f1f637fa86db69891e873743024d0 100644 (file)
@@ -153,8 +153,10 @@ BEISCSI_RW_ATTR(log_enable, 0x00,
                "\t\t\t\tIO Path Events         : 0x10\n"
                "\t\t\t\tConfiguration Path     : 0x20\n");
 
+DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
 struct device_attribute *beiscsi_attrs[] = {
        &dev_attr_beiscsi_log_enable,
+       &dev_attr_beiscsi_drvr_ver,
        NULL,
 };
 
index aab5dd359e2c2cbd5a945becbbcb44dd5638d727..1ec1db3a1465bd0fbb3ebbdcc723ae7fefb04f7e 100644 (file)
@@ -1136,3 +1136,19 @@ int mgmt_set_vlan(struct beiscsi_hba *phba,
        free_mcc_tag(&phba->ctrl, tag);
        return 0;
 }
+
+/**
+ * beiscsi_drvr_ver_disp()- Display the driver Name and Version
+ * @dev: ptr to device not used.
+ * @attr: device attribute, not used.
+ * @buf: contains formatted text driver name and version
+ *
+ * return
+ * size of the formatted string
+ **/
+ssize_t
+beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute *attr,
+                      char *buf)
+{
+       return snprintf(buf, PAGE_SIZE, BE_NAME "\n");
+}
index c50cef6fec0db3921908638411d9749bb879cdf2..291c68476c149ce39335a3fef3f07eb2a58070af 100644 (file)
@@ -301,4 +301,7 @@ int be_mgmt_get_boot_shandle(struct beiscsi_hba *phba,
 unsigned int mgmt_get_all_if_id(struct beiscsi_hba *phba);
 
 int mgmt_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag);
+
+ssize_t beiscsi_drvr_ver_disp(struct device *dev,
+                              struct device_attribute *attr, char *buf);
 #endif