diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_nportdisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nportdisc.c | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index c654c787c3e6..783659aa2102 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c | |||
@@ -442,7 +442,27 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
442 | spin_lock_irq(shost->host_lock); | 442 | spin_lock_irq(shost->host_lock); |
443 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 443 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; |
444 | spin_unlock_irq(shost->host_lock); | 444 | spin_unlock_irq(shost->host_lock); |
445 | if (vport->num_disc_nodes) { | 445 | |
446 | if ((ndlp->nlp_flag & NLP_ADISC_SND) && | ||
447 | (vport->num_disc_nodes)) { | ||
448 | /* Check to see if there are more | ||
449 | * ADISCs to be sent | ||
450 | */ | ||
451 | lpfc_more_adisc(vport); | ||
452 | |||
453 | if ((vport->num_disc_nodes == 0) && | ||
454 | (vport->fc_npr_cnt)) | ||
455 | lpfc_els_disc_plogi(vport); | ||
456 | |||
457 | if (vport->num_disc_nodes == 0) { | ||
458 | spin_lock_irq(shost->host_lock); | ||
459 | vport->fc_flag &= ~FC_NDISC_ACTIVE; | ||
460 | spin_unlock_irq(shost->host_lock); | ||
461 | lpfc_can_disctmo(vport); | ||
462 | lpfc_end_rscn(vport); | ||
463 | } | ||
464 | } | ||
465 | else if (vport->num_disc_nodes) { | ||
446 | /* Check to see if there are more | 466 | /* Check to see if there are more |
447 | * PLOGIs to be sent | 467 | * PLOGIs to be sent |
448 | */ | 468 | */ |
@@ -813,6 +833,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, | |||
813 | uint32_t evt) | 833 | uint32_t evt) |
814 | { | 834 | { |
815 | struct lpfc_hba *phba = vport->phba; | 835 | struct lpfc_hba *phba = vport->phba; |
836 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | ||
816 | struct lpfc_iocbq *cmdiocb, *rspiocb; | 837 | struct lpfc_iocbq *cmdiocb, *rspiocb; |
817 | struct lpfc_dmabuf *pcmd, *prsp, *mp; | 838 | struct lpfc_dmabuf *pcmd, *prsp, *mp; |
818 | uint32_t *lp; | 839 | uint32_t *lp; |
@@ -930,11 +951,27 @@ out: | |||
930 | "0261 Cannot Register NameServer login\n"); | 951 | "0261 Cannot Register NameServer login\n"); |
931 | } | 952 | } |
932 | 953 | ||
954 | spin_lock_irq(shost->host_lock); | ||
933 | ndlp->nlp_flag |= NLP_DEFER_RM; | 955 | ndlp->nlp_flag |= NLP_DEFER_RM; |
956 | spin_unlock_irq(shost->host_lock); | ||
934 | return NLP_STE_FREED_NODE; | 957 | return NLP_STE_FREED_NODE; |
935 | } | 958 | } |
936 | 959 | ||
937 | static uint32_t | 960 | static uint32_t |
961 | lpfc_cmpl_logo_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | ||
962 | void *arg, uint32_t evt) | ||
963 | { | ||
964 | return ndlp->nlp_state; | ||
965 | } | ||
966 | |||
967 | static uint32_t | ||
968 | lpfc_cmpl_reglogin_plogi_issue(struct lpfc_vport *vport, | ||
969 | struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) | ||
970 | { | ||
971 | return ndlp->nlp_state; | ||
972 | } | ||
973 | |||
974 | static uint32_t | ||
938 | lpfc_device_rm_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | 975 | lpfc_device_rm_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
939 | void *arg, uint32_t evt) | 976 | void *arg, uint32_t evt) |
940 | { | 977 | { |
@@ -2006,9 +2043,9 @@ static uint32_t (*lpfc_disc_action[NLP_STE_MAX_STATE * NLP_EVT_MAX_EVENT]) | |||
2006 | lpfc_rcv_els_plogi_issue, /* RCV_PRLO */ | 2043 | lpfc_rcv_els_plogi_issue, /* RCV_PRLO */ |
2007 | lpfc_cmpl_plogi_plogi_issue, /* CMPL_PLOGI */ | 2044 | lpfc_cmpl_plogi_plogi_issue, /* CMPL_PLOGI */ |
2008 | lpfc_disc_illegal, /* CMPL_PRLI */ | 2045 | lpfc_disc_illegal, /* CMPL_PRLI */ |
2009 | lpfc_disc_illegal, /* CMPL_LOGO */ | 2046 | lpfc_cmpl_logo_plogi_issue, /* CMPL_LOGO */ |
2010 | lpfc_disc_illegal, /* CMPL_ADISC */ | 2047 | lpfc_disc_illegal, /* CMPL_ADISC */ |
2011 | lpfc_disc_illegal, /* CMPL_REG_LOGIN */ | 2048 | lpfc_cmpl_reglogin_plogi_issue,/* CMPL_REG_LOGIN */ |
2012 | lpfc_device_rm_plogi_issue, /* DEVICE_RM */ | 2049 | lpfc_device_rm_plogi_issue, /* DEVICE_RM */ |
2013 | lpfc_device_recov_plogi_issue, /* DEVICE_RECOVERY */ | 2050 | lpfc_device_recov_plogi_issue, /* DEVICE_RECOVERY */ |
2014 | 2051 | ||