diff options
author | Joe Carnuccio <joe.carnuccio@qlogic.com> | 2012-11-21 08:40:40 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-11-30 16:14:48 +0100 |
commit | d0297c9a3f429d76e7e5b6cdbdd9868d3e20e547 (patch) | |
tree | de5aa7a09ae36134108b1013ba502ab42a5be3b1 /drivers/scsi/qla2xxx/qla_isr.c | |
parent | [SCSI] qla2xxx: Add 16Gb/s case to get port speed capability. (diff) | |
download | linux-d0297c9a3f429d76e7e5b6cdbdd9868d3e20e547.tar.xz linux-d0297c9a3f429d76e7e5b6cdbdd9868d3e20e547.zip |
[SCSI] qla2xxx: Parameterize the link speed of hba rather than fcport.
Parameterize qla2x00_get_link_speed_str() to be generic on link speed.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index bb611e21b301..e43b4d5d923b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -316,25 +316,21 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr) } #define LS_UNKNOWN 2 -char * -qla2x00_get_link_speed_str(struct qla_hw_data *ha) +const char * +qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed) { - static char *link_speeds[] = {"1", "2", "?", "4", "8", "16", "10"}; - char *link_speed; - int fw_speed = ha->link_data_rate; + static const char * const link_speeds[] = { + "1", "2", "?", "4", "8", "16", "10" + }; if (IS_QLA2100(ha) || IS_QLA2200(ha)) - link_speed = link_speeds[0]; - else if (fw_speed == 0x13) - link_speed = link_speeds[6]; - else { - link_speed = link_speeds[LS_UNKNOWN]; - if (fw_speed < 6) - link_speed = - link_speeds[fw_speed]; - } - - return link_speed; + return link_speeds[0]; + else if (speed == 0x13) + return link_speeds[6]; + else if (speed < 6) + return link_speeds[speed]; + else + return link_speeds[LS_UNKNOWN]; } static void @@ -671,7 +667,7 @@ skip_rio: ql_dbg(ql_dbg_async, vha, 0x500a, "LOOP UP detected (%s Gbps).\n", - qla2x00_get_link_speed_str(ha)); + qla2x00_get_link_speed_str(ha, ha->link_data_rate)); vha->flags.management_server_logged_in = 0; qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate); @@ -860,7 +856,7 @@ skip_rio: mb[1], mb[2], mb[3]); ql_log(ql_log_warn, vha, 0x505f, "Link is operational (%s Gbps).\n", - qla2x00_get_link_speed_str(ha)); + qla2x00_get_link_speed_str(ha, ha->link_data_rate)); /* * Mark all devices as missing so we will login again. |