diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9d1c7b56090a..873c82014b16 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -316,28 +316,24 @@ 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 |
319 | char * | 319 | const char * |
320 | qla2x00_get_link_speed_str(struct qla_hw_data *ha) | 320 | qla2x00_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 | ||
340 | void | 336 | static void |
341 | qla83xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb) | 337 | qla83xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb) |
342 | { | 338 | { |
343 | struct qla_hw_data *ha = vha->hw; | 339 | struct qla_hw_data *ha = vha->hw; |
@@ -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. |
@@ -2944,7 +2940,9 @@ skip_msi: | |||
2944 | "Failed to reserve interrupt %d already in use.\n", | 2940 | "Failed to reserve interrupt %d already in use.\n", |
2945 | ha->pdev->irq); | 2941 | ha->pdev->irq); |
2946 | goto fail; | 2942 | goto fail; |
2947 | } | 2943 | } else if (!ha->flags.msi_enabled) |
2944 | ql_dbg(ql_dbg_init, vha, 0x0125, | ||
2945 | "INTa mode: Enabled.\n"); | ||
2948 | 2946 | ||
2949 | clear_risc_ints: | 2947 | clear_risc_ints: |
2950 | 2948 | ||