diff options
Diffstat (limited to 'drivers/scsi/bfa/vport.c')
-rw-r--r-- | drivers/scsi/bfa/vport.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/vport.c b/drivers/scsi/bfa/vport.c index 27cd619a227a..f14e9f2d2c30 100644 --- a/drivers/scsi/bfa/vport.c +++ b/drivers/scsi/bfa/vport.c | |||
@@ -594,6 +594,15 @@ bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /** | 596 | /** |
597 | * delete notification from fabric SM. To be invoked from within FCS. | ||
598 | */ | ||
599 | void | ||
600 | bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport) | ||
601 | { | ||
602 | bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELETE); | ||
603 | } | ||
604 | |||
605 | /** | ||
597 | * Delete completion callback from associated lport | 606 | * Delete completion callback from associated lport |
598 | */ | 607 | */ |
599 | void | 608 | void |
@@ -646,6 +655,7 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, | |||
646 | return BFA_STATUS_VPORT_MAX; | 655 | return BFA_STATUS_VPORT_MAX; |
647 | 656 | ||
648 | vport->vport_drv = vport_drv; | 657 | vport->vport_drv = vport_drv; |
658 | vport_cfg->preboot_vp = BFA_FALSE; | ||
649 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_uninit); | 659 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_uninit); |
650 | 660 | ||
651 | bfa_fcs_lport_attach(&vport->lport, fcs, vf_id, vport); | 661 | bfa_fcs_lport_attach(&vport->lport, fcs, vf_id, vport); |
@@ -657,6 +667,36 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, | |||
657 | } | 667 | } |
658 | 668 | ||
659 | /** | 669 | /** |
670 | * Use this function to instantiate a new FCS PBC vport object. This | ||
671 | * function will not trigger any HW initialization process (which will be | ||
672 | * done in vport_start() call) | ||
673 | * | ||
674 | * param[in] vport - pointer to bfa_fcs_vport_t. This space | ||
675 | * needs to be allocated by the driver. | ||
676 | * param[in] fcs - FCS instance | ||
677 | * param[in] vport_cfg - vport configuration | ||
678 | * param[in] vf_id - VF_ID if vport is created within a VF. | ||
679 | * FC_VF_ID_NULL to specify base fabric. | ||
680 | * param[in] vport_drv - Opaque handle back to the driver's vport | ||
681 | * structure | ||
682 | * | ||
683 | * retval BFA_STATUS_OK - on success. | ||
684 | * retval BFA_STATUS_FAILED - on failure. | ||
685 | */ | ||
686 | bfa_status_t | ||
687 | bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, | ||
688 | uint16_t vf_id, struct bfa_port_cfg_s *vport_cfg, | ||
689 | struct bfad_vport_s *vport_drv) | ||
690 | { | ||
691 | bfa_status_t rc; | ||
692 | |||
693 | rc = bfa_fcs_vport_create(vport, fcs, vf_id, vport_cfg, vport_drv); | ||
694 | vport->lport.port_cfg.preboot_vp = BFA_TRUE; | ||
695 | |||
696 | return rc; | ||
697 | } | ||
698 | |||
699 | /** | ||
660 | * Use this function initialize the vport. | 700 | * Use this function initialize the vport. |
661 | * | 701 | * |
662 | * @param[in] vport - pointer to bfa_fcs_vport_t. | 702 | * @param[in] vport - pointer to bfa_fcs_vport_t. |
@@ -692,6 +732,8 @@ bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport) | |||
692 | * Use this function to delete a vport object. Fabric object should | 732 | * Use this function to delete a vport object. Fabric object should |
693 | * be stopped before this function call. | 733 | * be stopped before this function call. |
694 | * | 734 | * |
735 | * Donot invoke this from within FCS | ||
736 | * | ||
695 | * param[in] vport - pointer to bfa_fcs_vport_t. | 737 | * param[in] vport - pointer to bfa_fcs_vport_t. |
696 | * | 738 | * |
697 | * return None | 739 | * return None |
@@ -699,6 +741,9 @@ bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport) | |||
699 | bfa_status_t | 741 | bfa_status_t |
700 | bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport) | 742 | bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport) |
701 | { | 743 | { |
744 | if (vport->lport.port_cfg.preboot_vp) | ||
745 | return BFA_STATUS_PBC; | ||
746 | |||
702 | bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELETE); | 747 | bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELETE); |
703 | 748 | ||
704 | return BFA_STATUS_OK; | 749 | return BFA_STATUS_OK; |