aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfad_attr.c')
-rw-r--r--drivers/scsi/bfa/bfad_attr.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 1938fe0473e9..7b1ecd2b3ffe 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
445int
446bfad_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
445static int 482static int
446bfad_im_vport_delete(struct fc_vport *fc_vport) 483bfad_im_vport_delete(struct fc_vport *fc_vport)
447{ 484{
@@ -457,8 +494,11 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
457 unsigned long flags; 494 unsigned long flags;
458 struct completion fcomp; 495 struct completion fcomp;
459 496
460 if (im_port->flags & BFAD_PORT_DELETE) 497 if (im_port->flags & BFAD_PORT_DELETE) {
461 goto free_scsi_host; 498 bfad_scsi_host_free(bfad, im_port);
499 list_del(&vport->list_entry);
500 return 0;
501 }
462 502
463 port = im_port->port; 503 port = im_port->port;
464 504
@@ -489,7 +529,6 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
489 529
490 wait_for_completion(vport->comp_del); 530 wait_for_completion(vport->comp_del);
491 531
492free_scsi_host:
493 bfad_scsi_host_free(bfad, im_port); 532 bfad_scsi_host_free(bfad, im_port);
494 list_del(&vport->list_entry); 533 list_del(&vport->list_entry);
495 kfree(vport); 534 kfree(vport);
@@ -579,7 +618,7 @@ struct fc_function_template bfad_im_fc_function_template = {
579 .show_rport_dev_loss_tmo = 1, 618 .show_rport_dev_loss_tmo = 1,
580 .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo, 619 .get_rport_dev_loss_tmo = bfad_im_get_rport_loss_tmo,
581 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo, 620 .set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
582 621 .issue_fc_host_lip = bfad_im_issue_fc_host_lip,
583 .vport_create = bfad_im_vport_create, 622 .vport_create = bfad_im_vport_create,
584 .vport_delete = bfad_im_vport_delete, 623 .vport_delete = bfad_im_vport_delete,
585 .vport_disable = bfad_im_vport_disable, 624 .vport_disable = bfad_im_vport_disable,