diff options
author | Seokmann Ju <seokmann.ju@qlogic.com> | 2007-07-05 16:16:51 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-14 20:08:05 -0400 |
commit | 2c3dfe3f6ad8daff5acdb01713e4f2b116e78136 (patch) | |
tree | 8d95e2356c0f5121ceab48ab564d2796b6530d29 /drivers/scsi/qla2xxx/qla_isr.c | |
parent | 968a5763fb7247feb0e69573a2975a7a0c094267 (diff) |
[SCSI] qla2xxx: add support for NPIV
Following patch adds support for NPIV (N-Port ID Virtualization) to the
qla2xxx.
- supported within switched-fabric topologies only.
- supports up to 63 virtual ports on each physical port.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 6ce532cdc4c1..0ba4c8d37879 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <scsi/scsi_tcq.h> | 9 | #include <scsi/scsi_tcq.h> |
10 | 10 | ||
11 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); | 11 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); |
12 | static void qla2x00_async_event(scsi_qla_host_t *, uint16_t *); | ||
13 | static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t); | 12 | static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t); |
14 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); | 13 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); |
15 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); | 14 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); |
@@ -244,7 +243,7 @@ qla2x00_mbx_completion(scsi_qla_host_t *ha, uint16_t mb0) | |||
244 | * @ha: SCSI driver HA context | 243 | * @ha: SCSI driver HA context |
245 | * @mb: Mailbox registers (0 - 3) | 244 | * @mb: Mailbox registers (0 - 3) |
246 | */ | 245 | */ |
247 | static void | 246 | void |
248 | qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | 247 | qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) |
249 | { | 248 | { |
250 | #define LS_UNKNOWN 2 | 249 | #define LS_UNKNOWN 2 |
@@ -386,6 +385,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
386 | qla2x00_mark_all_devices_lost(ha, 1); | 385 | qla2x00_mark_all_devices_lost(ha, 1); |
387 | } | 386 | } |
388 | 387 | ||
388 | if (ha->parent) { | ||
389 | atomic_set(&ha->vp_state, VP_FAILED); | ||
390 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
391 | } | ||
392 | |||
389 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); | 393 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); |
390 | 394 | ||
391 | ha->flags.management_server_logged_in = 0; | 395 | ha->flags.management_server_logged_in = 0; |
@@ -422,6 +426,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
422 | qla2x00_mark_all_devices_lost(ha, 1); | 426 | qla2x00_mark_all_devices_lost(ha, 1); |
423 | } | 427 | } |
424 | 428 | ||
429 | if (ha->parent) { | ||
430 | atomic_set(&ha->vp_state, VP_FAILED); | ||
431 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
432 | } | ||
433 | |||
425 | ha->flags.management_server_logged_in = 0; | 434 | ha->flags.management_server_logged_in = 0; |
426 | ha->link_data_rate = PORT_SPEED_UNKNOWN; | 435 | ha->link_data_rate = PORT_SPEED_UNKNOWN; |
427 | if (ql2xfdmienable) | 436 | if (ql2xfdmienable) |
@@ -440,6 +449,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
440 | qla2x00_mark_all_devices_lost(ha, 1); | 449 | qla2x00_mark_all_devices_lost(ha, 1); |
441 | } | 450 | } |
442 | 451 | ||
452 | if (ha->parent) { | ||
453 | atomic_set(&ha->vp_state, VP_FAILED); | ||
454 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
455 | } | ||
456 | |||
443 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); | 457 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); |
444 | 458 | ||
445 | ha->operating_mode = LOOP; | 459 | ha->operating_mode = LOOP; |
@@ -465,6 +479,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
465 | qla2x00_mark_all_devices_lost(ha, 1); | 479 | qla2x00_mark_all_devices_lost(ha, 1); |
466 | } | 480 | } |
467 | 481 | ||
482 | if (ha->parent) { | ||
483 | atomic_set(&ha->vp_state, VP_FAILED); | ||
484 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
485 | } | ||
486 | |||
468 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) { | 487 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) { |
469 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); | 488 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); |
470 | } | 489 | } |
@@ -491,6 +510,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
491 | qla2x00_mark_all_devices_lost(ha, 1); | 510 | qla2x00_mark_all_devices_lost(ha, 1); |
492 | } | 511 | } |
493 | 512 | ||
513 | if (ha->parent) { | ||
514 | atomic_set(&ha->vp_state, VP_FAILED); | ||
515 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
516 | } | ||
517 | |||
494 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); | 518 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); |
495 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); | 519 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); |
496 | break; | 520 | break; |
@@ -530,6 +554,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
530 | break; | 554 | break; |
531 | 555 | ||
532 | case MBA_RSCN_UPDATE: /* State Change Registration */ | 556 | case MBA_RSCN_UPDATE: /* State Change Registration */ |
557 | /* Check if the Vport has issued a SCR */ | ||
558 | if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags)) | ||
559 | break; | ||
560 | |||
533 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", | 561 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", |
534 | ha->host_no)); | 562 | ha->host_no)); |
535 | DEBUG(printk(KERN_INFO | 563 | DEBUG(printk(KERN_INFO |
@@ -589,6 +617,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
589 | ha->host_no, mb[1], mb[2])); | 617 | ha->host_no, mb[1], mb[2])); |
590 | break; | 618 | break; |
591 | } | 619 | } |
620 | |||
621 | if (!ha->parent && ha->num_vhosts) | ||
622 | qla2x00_alert_all_vps(ha, mb); | ||
592 | } | 623 | } |
593 | 624 | ||
594 | static void | 625 | static void |
@@ -1393,6 +1424,10 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha) | |||
1393 | case MS_IOCB_TYPE: | 1424 | case MS_IOCB_TYPE: |
1394 | qla24xx_ms_entry(ha, (struct ct_entry_24xx *)pkt); | 1425 | qla24xx_ms_entry(ha, (struct ct_entry_24xx *)pkt); |
1395 | break; | 1426 | break; |
1427 | case VP_RPT_ID_IOCB_TYPE: | ||
1428 | qla24xx_report_id_acquisition(ha, | ||
1429 | (struct vp_rpt_id_entry_24xx *)pkt); | ||
1430 | break; | ||
1396 | default: | 1431 | default: |
1397 | /* Type Not Supported. */ | 1432 | /* Type Not Supported. */ |
1398 | DEBUG4(printk(KERN_WARNING | 1433 | DEBUG4(printk(KERN_WARNING |