diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-03-13 20:37:26 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-03-28 04:49:34 -0400 |
commit | acea241510b068b0a92a0e023915aeeaf1065866 (patch) | |
tree | 52154a907e2c0c626514d895eb3292648acb615e /drivers/scsi | |
parent | 714be35885093305b7491cc3eea959bb3e1be6f2 (diff) |
[SCSI] bfa: Add fc host issue lip support
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfad_attr.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index 1938fe0473e9..06310b8e562d 100644 --- a/drivers/scsi/bfa/bfad_attr.c +++ b/drivers/scsi/bfa/bfad_attr.c | |||
@@ -442,6 +442,43 @@ bfad_im_vport_create(struct fc_vport *fc_vport, bool disable) | |||
442 | return status; | 442 | return status; |
443 | } | 443 | } |
444 | 444 | ||
445 | int | ||
446 | bfad_im_issue_fc_host_lip(struct Scsi_Host *shost) | ||
447 | { | ||
448 | struct bfad_im_port_s *im_port = | ||
449 | (struct bfad_im_port_s *) shost->hostdata[0]; | ||
450 | struct bfad_s *bfad = im_port->bfad; | ||
451 | struct bfad_hal_comp fcomp; | ||
452 | unsigned long flags; | ||
453 | uint32_t status; | ||
454 | |||
455 | init_completion(&fcomp.comp); | ||
456 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
457 | status = bfa_port_disable(&bfad->bfa.modules.port, | ||
458 | bfad_hcb_comp, &fcomp); | ||
459 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
460 | |||
461 | if (status != BFA_STATUS_OK) | ||
462 | return -EIO; | ||
463 | |||
464 | wait_for_completion(&fcomp.comp); | ||
465 | if (fcomp.status != BFA_STATUS_OK) | ||
466 | return -EIO; | ||
467 | |||
468 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
469 | status = bfa_port_enable(&bfad->bfa.modules.port, | ||
470 | bfad_hcb_comp, &fcomp); | ||
471 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
472 | if (status != BFA_STATUS_OK) | ||
473 | return -EIO; | ||
474 | |||
475 | wait_for_completion(&fcomp.comp); | ||
476 | if (fcomp.status != BFA_STATUS_OK) | ||
477 | return -EIO; | ||
478 | |||
479 | return 0; | ||
480 | } | ||
481 | |||
445 | static int | 482 | static int |
446 | bfad_im_vport_delete(struct fc_vport *fc_vport) | 483 | bfad_im_vport_delete(struct fc_vport *fc_vport) |
447 | { | 484 | { |
@@ -579,7 +616,7 @@ struct fc_function_template bfad_im_fc_function_template = { | |||
579 | .show_rport_dev_loss_tmo = 1, | 616 | .show_rport_dev_loss_tmo = 1, |
580 | .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo, | 617 | .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo, |
581 | .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo, | 618 | .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo, |
582 | 619 | .issue_fc_host_lip = bfad_im_issue_fc_host_lip, | |
583 | .vport_create = bfad_im_vport_create, | 620 | .vport_create = bfad_im_vport_create, |
584 | .vport_delete = bfad_im_vport_delete, | 621 | .vport_delete = bfad_im_vport_delete, |
585 | .vport_disable = bfad_im_vport_disable, | 622 | .vport_disable = bfad_im_vport_disable, |