-}
-
-void
-lpfc_delink_node(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
-{
- switch (ndlp->nlp_flag & NLP_LIST_MASK) {
- case NLP_UNUSED_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_PLOGI_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_ADISC_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_REGLOGIN_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_PRLI_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_UNMAPPED_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_MAPPED_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- case NLP_NPR_LIST:
- list_del_init(&ndlp->nlp_listp);
- break;
- }
-
- ndlp->nlp_flag &= ~NLP_LIST_MASK;
-}
-
-static int
-lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
-{
- struct lpfc_sli *psli;
-
- psli = &phba->sli;
- /* Sanity check to ensure we are not moving to / from the same list */
- if ((nlp->nlp_flag & NLP_LIST_MASK) == list)
- return 0;
-
- spin_lock_irq(phba->host->host_lock);
- lpfc_delink_node(phba, nlp);
-
- /* Add NPort <did> to <num> list */
- lpfc_printf_log(phba,
- KERN_INFO,
- LOG_NODE,
- "%d:0904 Add NPort x%x to %d list Data: x%x\n",
- phba->brd_no,
- nlp->nlp_DID, list, nlp->nlp_flag);
-
- switch (list) {
- case NLP_UNUSED_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the unused list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_unused_list);
- break;
- case NLP_PLOGI_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the plogi list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_plogi_list);
- break;
- case NLP_ADISC_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the adisc list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_adisc_list);
- break;
- case NLP_REGLOGIN_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the reglogin list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_reglogin_list);
- break;
- case NLP_PRLI_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the prli list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_prli_list);
- break;
- case NLP_UNMAPPED_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the unmap list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_nlpunmap_list);
- break;
- case NLP_MAPPED_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the map list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_nlpmap_list);
- break;
- case NLP_NPR_LIST:
- nlp->nlp_flag |= list;
- /* Put it at the end of the npr list */
- list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list);
- break;
- }
-