]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2iscsi: Display driver name and version in device attribute
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Thu, 27 Sep 2012 21:39:34 +0000 (03:09 +0530)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Tue, 8 Jan 2013 23:37:30 +0000 (16:37 -0700)
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/be2iscsi/be_mgmt.c
drivers/scsi/be2iscsi/be_mgmt.h

index 54267c23f946c7f1cb03253b92d08390dab3bc95..6f699e328ff4cb4253d864ab8e766ecbaff8836b 100644 (file)
@@ -152,8 +152,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 78409c0227072f9e35b52b2605d08edf985e8fc8..b195a3d2d9ff9a15d7426c61226daf3f560f9bcb 100644 (file)
@@ -1109,3 +1109,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