diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2011-08-01 03:26:17 -0700 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 08:36:34 -0600 |
commit | 91ec7cec4acf0d6b7de34009fc49c8c3353b8035 (patch) | |
tree | 05e8ce502f3e5406b511cbeab34cf0f7ae42498d /drivers/scsi/qla4xxx/ql4_init.c | |
parent | 7c07d139cfec3172e813b468a8a173ad73bb5da9 (diff) |
[SCSI] qla4xxx: Added vendor specific sysfs attributes
Added board_id, fw_state, phy_port_cnt, phy_port_num,
iscsi_func_cnt, hba_model
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>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_init.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 21f6f4bacd9d..b0bffe15c287 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c @@ -446,6 +446,21 @@ static int qla4xxx_init_firmware(struct scsi_qla_host *ha) return qla4xxx_get_firmware_status(ha); } +static void qla4xxx_set_model_info(struct scsi_qla_host *ha) +{ + uint16_t board_id_string[8]; + int i; + int size = sizeof(ha->nvram->isp4022.boardIdStr); + int offset = offsetof(struct eeprom_data, isp4022.boardIdStr) / 2; + + for (i = 0; i < (size / 2) ; i++) { + board_id_string[i] = rd_nvram_word(ha, offset); + offset += 1; + } + + memcpy(ha->model_name, board_id_string, size); +} + static int qla4xxx_config_nvram(struct scsi_qla_host *ha) { unsigned long flags; @@ -481,6 +496,12 @@ static int qla4xxx_config_nvram(struct scsi_qla_host *ha) else return QLA_ERROR; } + + if (is_qla4022(ha) || is_qla4032(ha)) + qla4xxx_set_model_info(ha); + else + strcpy(ha->model_name, "QLA4010"); + DEBUG(printk("scsi%ld: %s: Setting extHwConfig to 0xFFFF%04x\n", ha->host_no, __func__, extHwConfig.Asuint32_t)); |