aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c32
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)
316} 316}
317 317
318#define LS_UNKNOWN 2 318#define LS_UNKNOWN 2
319char * 319const char *
320qla2x00_get_link_speed_str(struct qla_hw_data *ha) 320qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed)
321{ 321{
322 static char *link_speeds[] = {"1", "2", "?", "4", "8", "16", "10"}; 322 static const char * const link_speeds[] = {
323 char *link_speed; 323 "1", "2", "?", "4", "8", "16", "10"
324 int fw_speed = ha->link_data_rate; 324 };
325 325
326 if (IS_QLA2100(ha) || IS_QLA2200(ha)) 326 if (IS_QLA2100(ha) || IS_QLA2200(ha))
327 link_speed = link_speeds[0]; 327 return link_speeds[0];
328 else if (fw_speed == 0x13) 328 else if (speed == 0x13)
329 link_speed = link_speeds[6]; 329 return link_speeds[6];
330 else { 330 else if (speed < 6)
331 link_speed = link_speeds[LS_UNKNOWN]; 331 return link_speeds[speed];
332 if (fw_speed < 6) 332 else
333 link_speed = 333 return link_speeds[LS_UNKNOWN];
334 link_speeds[fw_speed];
335 }
336
337 return link_speed;
338} 334}
339 335
340static void 336static void
@@ -671,7 +667,7 @@ skip_rio:
671 667
672 ql_dbg(ql_dbg_async, vha, 0x500a, 668 ql_dbg(ql_dbg_async, vha, 0x500a,
673 "LOOP UP detected (%s Gbps).\n", 669 "LOOP UP detected (%s Gbps).\n",
674 qla2x00_get_link_speed_str(ha)); 670 qla2x00_get_link_speed_str(ha, ha->link_data_rate));
675 671
676 vha->flags.management_server_logged_in = 0; 672 vha->flags.management_server_logged_in = 0;
677 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate); 673 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate);
@@ -860,7 +856,7 @@ skip_rio:
860 mb[1], mb[2], mb[3]); 856 mb[1], mb[2], mb[3]);
861 ql_log(ql_log_warn, vha, 0x505f, 857 ql_log(ql_log_warn, vha, 0x505f,
862 "Link is operational (%s Gbps).\n", 858 "Link is operational (%s Gbps).\n",
863 qla2x00_get_link_speed_str(ha)); 859 qla2x00_get_link_speed_str(ha, ha->link_data_rate));
864 860
865 /* 861 /*
866 * Mark all devices as missing so we will login again. 862 * Mark all devices as missing so we will login again.