-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SCSI] qla4xxx: Added vendor specific sysfs attributes
Added fw_version, serial_num, iscsi version and boot loader version sysfs attributes. Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <jbottomley@parallels.com>
- Loading branch information
Harish Zunjarrao
authored and
James Bottomley
committed
May 24, 2011
1 parent
8f0722c
commit 7ad633c
Showing
8 changed files
with
150 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
qla4xxx-y := ql4_os.o ql4_init.o ql4_mbx.o ql4_iocb.o ql4_isr.o \ | ||
ql4_nx.o ql4_nvram.o ql4_dbg.o | ||
ql4_nx.o ql4_nvram.o ql4_dbg.o ql4_attr.o | ||
|
||
obj-$(CONFIG_SCSI_QLA_ISCSI) += qla4xxx.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* QLogic iSCSI HBA Driver | ||
* Copyright (c) 2003-2011 QLogic Corporation | ||
* | ||
* See LICENSE.qla4xxx for copyright and licensing details. | ||
*/ | ||
|
||
#include "ql4_def.h" | ||
#include "ql4_glbl.h" | ||
#include "ql4_dbg.h" | ||
|
||
/* Scsi_Host attributes. */ | ||
static ssize_t | ||
qla4xxx_fw_version_show(struct device *dev, | ||
struct device_attribute *attr, char *buf) | ||
{ | ||
struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); | ||
|
||
if (is_qla8022(ha)) | ||
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", | ||
ha->firmware_version[0], | ||
ha->firmware_version[1], | ||
ha->patch_number, ha->build_number); | ||
else | ||
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d.%02d\n", | ||
ha->firmware_version[0], | ||
ha->firmware_version[1], | ||
ha->patch_number, ha->build_number); | ||
} | ||
|
||
static ssize_t | ||
qla4xxx_serial_num_show(struct device *dev, struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); | ||
return snprintf(buf, PAGE_SIZE, "%s\n", ha->serial_number); | ||
} | ||
|
||
static ssize_t | ||
qla4xxx_iscsi_version_show(struct device *dev, struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); | ||
return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->iscsi_major, | ||
ha->iscsi_minor); | ||
} | ||
|
||
static ssize_t | ||
qla4xxx_optrom_version_show(struct device *dev, struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
struct scsi_qla_host *ha = to_qla_host(class_to_shost(dev)); | ||
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d.%02d\n", | ||
ha->bootload_major, ha->bootload_minor, | ||
ha->bootload_patch, ha->bootload_build); | ||
} | ||
|
||
static DEVICE_ATTR(fw_version, S_IRUGO, qla4xxx_fw_version_show, NULL); | ||
static DEVICE_ATTR(serial_num, S_IRUGO, qla4xxx_serial_num_show, NULL); | ||
static DEVICE_ATTR(iscsi_version, S_IRUGO, qla4xxx_iscsi_version_show, NULL); | ||
static DEVICE_ATTR(optrom_version, S_IRUGO, qla4xxx_optrom_version_show, NULL); | ||
|
||
struct device_attribute *qla4xxx_host_attrs[] = { | ||
&dev_attr_fw_version, | ||
&dev_attr_serial_num, | ||
&dev_attr_iscsi_version, | ||
&dev_attr_optrom_version, | ||
NULL, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters