Commit 2fe165b6 authored by Jamie Wellnitz's avatar Jamie Wellnitz Committed by James Bottomley

[SCSI] lpfc 8.1.2: Code style changes for Discovery code

Code style changes for Discovery code
Signed-off-by: default avatarJamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 082c0266
/******************************************************************* /*******************************************************************
* This file is part of the Emulex Linux Device Driver for * * This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. * * Fibre Channel Host Bus Adapters. *
* Copyright (C) 2004-2005 Emulex. All rights reserved. * * Copyright (C) 2004-2006 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. * * EMULEX and SLI are trademarks of Emulex. *
* www.emulex.com * * www.emulex.com *
* * * *
......
/******************************************************************* /*******************************************************************
* This file is part of the Emulex Linux Device Driver for * * This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. * * Fibre Channel Host Bus Adapters. *
* Copyright (C) 2004-2005 Emulex. All rights reserved. * * Copyright (C) 2004-2006 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. * * EMULEX and SLI are trademarks of Emulex. *
* www.emulex.com * * www.emulex.com *
* Portions Copyright (C) 2004-2005 Christoph Hellwig * * Portions Copyright (C) 2004-2005 Christoph Hellwig *
...@@ -717,8 +717,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -717,8 +717,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
rc = NLP_STE_FREED_NODE; rc = NLP_STE_FREED_NODE;
} } else {
else {
rc = lpfc_disc_state_machine(phba, ndlp, cmdiocb, rc = lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_PLOGI); NLP_EVT_CMPL_PLOGI);
} }
...@@ -784,7 +783,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, ...@@ -784,7 +783,7 @@ lpfc_issue_els_plogi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp,
cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm)); cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm));
elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp,
ELS_CMD_PLOGI); ELS_CMD_PLOGI);
if (!elsiocb) if (!elsiocb)
return 1; return 1;
...@@ -861,8 +860,7 @@ lpfc_cmpl_els_prli(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -861,8 +860,7 @@ lpfc_cmpl_els_prli(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
goto out; goto out;
} } else {
else {
lpfc_disc_state_machine(phba, ndlp, cmdiocb, lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_PRLI); NLP_EVT_CMPL_PRLI);
} }
...@@ -1195,8 +1193,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -1195,8 +1193,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) || (irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) { (irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
goto out; goto out;
} } else {
else {
lpfc_disc_state_machine(phba, ndlp, cmdiocb, lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_LOGO); NLP_EVT_CMPL_LOGO);
} }
...@@ -2201,7 +2198,7 @@ lpfc_els_disc_adisc(struct lpfc_hba * phba) ...@@ -2201,7 +2198,7 @@ lpfc_els_disc_adisc(struct lpfc_hba * phba)
phba->fc_flag &= ~FC_NLP_MORE; phba->fc_flag &= ~FC_NLP_MORE;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
} }
return(sentadisc); return sentadisc;
} }
int int
...@@ -2238,7 +2235,7 @@ lpfc_els_disc_plogi(struct lpfc_hba * phba) ...@@ -2238,7 +2235,7 @@ lpfc_els_disc_plogi(struct lpfc_hba * phba)
phba->fc_flag &= ~FC_NLP_MORE; phba->fc_flag &= ~FC_NLP_MORE;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
} }
return(sentplogi); return sentplogi;
} }
int int
...@@ -2591,8 +2588,7 @@ lpfc_els_rcv_flogi(struct lpfc_hba * phba, ...@@ -2591,8 +2588,7 @@ lpfc_els_rcv_flogi(struct lpfc_hba * phba,
mempool_free( mbox, phba->mbox_mem_pool); mempool_free( mbox, phba->mbox_mem_pool);
} }
return 1; return 1;
} } else if (rc > 0) { /* greater than */
else if (rc > 0) { /* greater than */
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
phba->fc_flag |= FC_PT2PT_PLOGI; phba->fc_flag |= FC_PT2PT_PLOGI;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
...@@ -2755,8 +2751,8 @@ lpfc_els_rcv_rps(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -2755,8 +2751,8 @@ lpfc_els_rcv_rps(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
RPS *rps; RPS *rps;
struct ls_rjt stat; struct ls_rjt stat;
if((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
(ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
stat.un.b.lsRjtRsvd0 = 0; stat.un.b.lsRjtRsvd0 = 0;
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA; stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA;
...@@ -2866,8 +2862,8 @@ lpfc_els_rcv_rpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -2866,8 +2862,8 @@ lpfc_els_rcv_rpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
RPL *rpl; RPL *rpl;
struct ls_rjt stat; struct ls_rjt stat;
if((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
(ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
stat.un.b.lsRjtRsvd0 = 0; stat.un.b.lsRjtRsvd0 = 0;
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA; stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA;
...@@ -2886,8 +2882,7 @@ lpfc_els_rcv_rpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -2886,8 +2882,7 @@ lpfc_els_rcv_rpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
((maxsize == 0) || ((maxsize == 0) ||
((maxsize * sizeof(uint32_t)) >= sizeof(RPL_RSP)))) { ((maxsize * sizeof(uint32_t)) >= sizeof(RPL_RSP)))) {
cmdsize = sizeof(uint32_t) + sizeof(RPL_RSP); cmdsize = sizeof(uint32_t) + sizeof(RPL_RSP);
} } else {
else {
cmdsize = sizeof(uint32_t) + maxsize * sizeof(uint32_t); cmdsize = sizeof(uint32_t) + maxsize * sizeof(uint32_t);
} }
lpfc_els_rsp_rpl_acc(phba, cmdsize, cmdiocb, ndlp); lpfc_els_rsp_rpl_acc(phba, cmdsize, cmdiocb, ndlp);
...@@ -3032,8 +3027,7 @@ lpfc_els_rcv_fan(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, ...@@ -3032,8 +3027,7 @@ lpfc_els_rcv_fan(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
* other NLP_FABRIC logins * other NLP_FABRIC logins
*/ */
lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
} } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
/* Fail outstanding I/O now since this /* Fail outstanding I/O now since this
* device is marked for PLOGI * device is marked for PLOGI
*/ */
...@@ -3228,8 +3222,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba) ...@@ -3228,8 +3222,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba)
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
(piocb->iocb_cmpl) (phba, piocb, piocb); (piocb->iocb_cmpl) (phba, piocb, piocb);
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
} } else
else
lpfc_sli_release_iocbq(phba, piocb); lpfc_sli_release_iocbq(phba, piocb);
} }
...@@ -3253,8 +3246,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba) ...@@ -3253,8 +3246,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba)
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
(piocb->iocb_cmpl) (phba, piocb, piocb); (piocb->iocb_cmpl) (phba, piocb, piocb);
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
} } else
else
lpfc_sli_release_iocbq(phba, piocb); lpfc_sli_release_iocbq(phba, piocb);
} }
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
......
...@@ -108,7 +108,7 @@ lpfc_work_list_done(struct lpfc_hba * phba) ...@@ -108,7 +108,7 @@ lpfc_work_list_done(struct lpfc_hba * phba)
evt_listp); evt_listp);
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
free_evt = 1; free_evt = 1;
switch(evtp->evt) { switch (evtp->evt) {
case LPFC_EVT_NODEV_TMO: case LPFC_EVT_NODEV_TMO:
ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1); ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1);
lpfc_process_nodev_timeout(phba, ndlp); lpfc_process_nodev_timeout(phba, ndlp);
...@@ -173,13 +173,13 @@ lpfc_work_done(struct lpfc_hba * phba) ...@@ -173,13 +173,13 @@ lpfc_work_done(struct lpfc_hba * phba)
work_hba_events=phba->work_hba_events; work_hba_events=phba->work_hba_events;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
if(ha_copy & HA_ERATT) if (ha_copy & HA_ERATT)
lpfc_handle_eratt(phba); lpfc_handle_eratt(phba);
if(ha_copy & HA_MBATT) if (ha_copy & HA_MBATT)
lpfc_sli_handle_mb_event(phba); lpfc_sli_handle_mb_event(phba);
if(ha_copy & HA_LATT) if (ha_copy & HA_LATT)
lpfc_handle_latt(phba); lpfc_handle_latt(phba);
if (work_hba_events & WORKER_DISC_TMO) if (work_hba_events & WORKER_DISC_TMO)
...@@ -357,8 +357,7 @@ lpfc_linkdown(struct lpfc_hba * phba) ...@@ -357,8 +357,7 @@ lpfc_linkdown(struct lpfc_hba * phba)
/* Check config parameter use-adisc or FCP-2 */ /* Check config parameter use-adisc or FCP-2 */
if ((rc != NLP_STE_FREED_NODE) && if ((rc != NLP_STE_FREED_NODE) &&
(phba->cfg_use_adisc == 0) && (phba->cfg_use_adisc == 0) &&
!(ndlp->nlp_fcp_info & !(ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE)) {
NLP_FCP_2_DEVICE)) {
/* We know we will have to relogin, so /* We know we will have to relogin, so
* unreglogin the rpi right now to fail * unreglogin the rpi right now to fail
* any outstanding I/Os quickly. * any outstanding I/Os quickly.
...@@ -398,7 +397,7 @@ lpfc_linkdown(struct lpfc_hba * phba) ...@@ -398,7 +397,7 @@ lpfc_linkdown(struct lpfc_hba * phba)
lpfc_can_disctmo(phba); lpfc_can_disctmo(phba);
/* Must process IOCBs on all rings to handle ABORTed I/Os */ /* Must process IOCBs on all rings to handle ABORTed I/Os */
return (0); return 0;
} }
static int static int
...@@ -497,7 +496,7 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) ...@@ -497,7 +496,7 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
lpfc_els_disc_plogi(phba); lpfc_els_disc_plogi(phba);
} }
if(!phba->num_disc_nodes) { if (!phba->num_disc_nodes) {
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
phba->fc_flag &= ~FC_NDISC_ACTIVE; phba->fc_flag &= ~FC_NDISC_ACTIVE;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
...@@ -685,7 +684,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) ...@@ -685,7 +684,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
switch(la->UlnkSpeed) { switch (la->UlnkSpeed) {
case LA_1GHZ_LINK: case LA_1GHZ_LINK:
phba->fc_linkspeed = LA_1GHZ_LINK; phba->fc_linkspeed = LA_1GHZ_LINK;
break; break;
...@@ -1115,12 +1114,11 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) ...@@ -1115,12 +1114,11 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
psli = &phba->sli; psli = &phba->sli;
/* Sanity check to ensure we are not moving to / from the same list */ /* Sanity check to ensure we are not moving to / from the same list */
if ((nlp->nlp_flag & NLP_LIST_MASK) == list) { if ((nlp->nlp_flag & NLP_LIST_MASK) == list)
if (list != NLP_NO_LIST) if (list != NLP_NO_LIST)
return(0); return 0;
}
switch(nlp->nlp_flag & NLP_LIST_MASK) { switch (nlp->nlp_flag & NLP_LIST_MASK) {
case NLP_NO_LIST: /* Not on any list */ case NLP_NO_LIST: /* Not on any list */
break; break;
case NLP_UNUSED_LIST: case NLP_UNUSED_LIST:
...@@ -1190,7 +1188,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) ...@@ -1190,7 +1188,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
phba->brd_no, phba->brd_no,
nlp->nlp_DID, list, nlp->nlp_flag); nlp->nlp_DID, list, nlp->nlp_flag);
switch(list) { switch (list) {
case NLP_NO_LIST: /* No list, just remove it */ case NLP_NO_LIST: /* No list, just remove it */
lpfc_nlp_remove(phba, nlp); lpfc_nlp_remove(phba, nlp);
/* as node removed - stop further transport calls */ /* as node removed - stop further transport calls */
...@@ -1287,10 +1285,10 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) ...@@ -1287,10 +1285,10 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list); list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list);
phba->fc_npr_cnt++; phba->fc_npr_cnt++;
if (!(nlp->nlp_flag & NLP_NODEV_TMO)) { if (!(nlp->nlp_flag & NLP_NODEV_TMO))
mod_timer(&nlp->nlp_tmofunc, mod_timer(&nlp->nlp_tmofunc,
jiffies + HZ * phba->cfg_nodev_tmo); jiffies + HZ * phba->cfg_nodev_tmo);
}
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
nlp->nlp_flag |= NLP_NODEV_TMO; nlp->nlp_flag |= NLP_NODEV_TMO;
nlp->nlp_flag &= ~NLP_RCV_PLOGI; nlp->nlp_flag &= ~NLP_RCV_PLOGI;
...@@ -1342,7 +1340,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) ...@@ -1342,7 +1340,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list)
} }
} }
} }
return (0); return 0;
} }
/* /*
...@@ -1401,7 +1399,7 @@ lpfc_can_disctmo(struct lpfc_hba * phba) ...@@ -1401,7 +1399,7 @@ lpfc_can_disctmo(struct lpfc_hba * phba)
phba->brd_no, phba->hba_state, phba->fc_flag, phba->brd_no, phba->hba_state, phba->fc_flag,
phba->fc_plogi_cnt, phba->fc_adisc_cnt); phba->fc_plogi_cnt, phba->fc_adisc_cnt);
return (0); return 0;
} }
/* /*
...@@ -1422,11 +1420,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba, ...@@ -1422,11 +1420,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba,
switch (icmd->ulpCommand) { switch (icmd->ulpCommand) {
case CMD_GEN_REQUEST64_CR: case CMD_GEN_REQUEST64_CR:
if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi)
return (1); return 1;
case CMD_ELS_REQUEST64_CR: case CMD_ELS_REQUEST64_CR:
case CMD_XMIT_ELS_RSP64_CX: case CMD_XMIT_ELS_RSP64_CX:
if (iocb->context1 == (uint8_t *) ndlp) if (iocb->context1 == (uint8_t *) ndlp)
return (1); return 1;
} }
} else if (pring->ringno == psli->ip_ring) { } else if (pring->ringno == psli->ip_ring) {
...@@ -1434,15 +1432,15 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba, ...@@ -1434,15 +1432,15 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba,
/* Skip match check if waiting to relogin to FCP target */ /* Skip match check if waiting to relogin to FCP target */
if ((ndlp->nlp_type & NLP_FCP_TARGET) && if ((ndlp->nlp_type & NLP_FCP_TARGET) &&
(ndlp->nlp_flag & NLP_DELAY_TMO)) { (ndlp->nlp_flag & NLP_DELAY_TMO)) {
return (0); return 0;
} }
if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) { if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) {
return (1); return 1;
} }
} else if (pring->ringno == psli->next_ring) { } else if (pring->ringno == psli->next_ring) {
} }
return (0); return 0;
} }
/* /*
...@@ -1503,7 +1501,7 @@ lpfc_no_rpi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp) ...@@ -1503,7 +1501,7 @@ lpfc_no_rpi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
} }
} }
return (0); return 0;
} }
/* /*
...@@ -1604,7 +1602,7 @@ lpfc_freenode(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp) ...@@ -1604,7 +1602,7 @@ lpfc_freenode(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
lpfc_unreg_rpi(phba, ndlp); lpfc_unreg_rpi(phba, ndlp);
return (0); return 0;
} }
/* /*
...@@ -1640,12 +1638,11 @@ lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp) ...@@ -1640,12 +1638,11 @@ lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
ndlp->nlp_flag |= NLP_DELAY_REMOVE; ndlp->nlp_flag |= NLP_DELAY_REMOVE;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
} } else {
else {
lpfc_freenode(phba, ndlp); lpfc_freenode(phba, ndlp);
mempool_free( ndlp, phba->nlp_mem_pool); mempool_free( ndlp, phba->nlp_mem_pool);
} }
return(0); return 0;
} }
static int static int
...@@ -1656,20 +1653,20 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did) ...@@ -1656,20 +1653,20 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
D_ID matchdid; D_ID matchdid;
if (did == Bcast_DID) if (did == Bcast_DID)
return (0); return 0;
if (ndlp->nlp_DID == 0) { if (ndlp->nlp_DID == 0) {
return (0); return 0;
} }
/* First check for Direct match */ /* First check for Direct match */
if (ndlp->nlp_DID == did) if (ndlp->nlp_DID == did)
return (1); return 1;
/* Next check for area/domain identically equals 0 match */ /* Next check for area/domain identically equals 0 match */
mydid.un.word = phba->fc_myDID; mydid.un.word = phba->fc_myDID;
if ((mydid.un.b.domain == 0) && (mydid.un.b.area == 0)) { if ((mydid.un.b.domain == 0) && (mydid.un.b.area == 0)) {
return (0); return 0;
} }
matchdid.un.word = did; matchdid.un.word = did;
...@@ -1680,9 +1677,9 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did) ...@@ -1680,9 +1677,9 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
if ((ndlpdid.un.b.domain == 0) && if ((ndlpdid.un.b.domain == 0) &&
(ndlpdid.un.b.area == 0)) { (ndlpdid.un.b.area == 0)) {
if (ndlpdid.un.b.id) if (ndlpdid.un.b.id)
return (1); return 1;
} }
return (0); return 0;
} }
matchdid.un.word = ndlp->nlp_DID; matchdid.un.word = ndlp->nlp_DID;
...@@ -1691,11 +1688,11 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did) ...@@ -1691,11 +1688,11 @@ lpfc_matchdid(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, uint32_t did)
if ((matchdid.un.b.domain == 0) && if ((matchdid.un.b.domain == 0) &&
(matchdid.un.b.area == 0)) { (matchdid.un.b.area == 0)) {
if (matchdid.un.b.id) if (matchdid.un.b.id)
return (1); return 1;
} }
} }
} }
return (0); return 0;
} }
/* Search for a nodelist entry on a specific list */ /* Search for a nodelist entry on a specific list */
...@@ -1720,7 +1717,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1720,7 +1717,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1741,7 +1738,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1741,7 +1738,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1763,7 +1760,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1763,7 +1760,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1785,7 +1782,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1785,7 +1782,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1807,7 +1804,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1807,7 +1804,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1829,7 +1826,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1829,7 +1826,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1851,7 +1848,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1851,7 +1848,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1873,7 +1870,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did) ...@@ -1873,7 +1870,7 @@ lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
phba->brd_no, phba->brd_no,
ndlp, ndlp->nlp_DID, ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1); ndlp->nlp_flag, data1);
return (ndlp); return ndlp;
} }
} }
} }
...@@ -1923,17 +1920,15 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did) ...@@ -1923,17 +1920,15 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did)
del_timer_sync(&ndlp->nlp_delayfunc); del_timer_sync(&ndlp->nlp_delayfunc);
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
if (!list_empty(&ndlp->els_retry_evt. if (!list_empty(&ndlp->els_retry_evt.
evt_listp)) evt_listp))
list_del_init(&ndlp->els_retry_evt. list_del_init(&ndlp->els_retry_evt.
evt_listp); evt_listp);
} }
} } else {
else {
ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
ndlp = NULL; ndlp = NULL;
} }
} } else {
else {
flg = ndlp->nlp_flag & NLP_LIST_MASK; flg = ndlp->nlp_flag & NLP_LIST_MASK;
if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST))
return NULL; return NULL;
...@@ -2084,8 +2079,7 @@ lpfc_disc_start(struct lpfc_hba * phba) ...@@ -2084,8 +2079,7 @@ lpfc_disc_start(struct lpfc_hba * phba)
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
phba->fc_flag &= ~FC_RSCN_MODE; phba->fc_flag &= ~FC_RSCN_MODE;
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
} } else
else
lpfc_els_handle_rscn(phba); lpfc_els_handle_rscn(phba);
} }
} }
...@@ -2268,8 +2262,7 @@ lpfc_disc_timeout_handler(struct lpfc_hba *phba) ...@@ -2268,8 +2262,7 @@ lpfc_disc_timeout_handler(struct lpfc_hba *phba)
if (ndlp->nlp_type & NLP_FABRIC) { if (ndlp->nlp_type & NLP_FABRIC) {
/* Clean up the ndlp on Fabric connections */ /* Clean up the ndlp on Fabric connections */
lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); lpfc_nlp_list(phba, ndlp, NLP_NO_LIST);
} } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
/* Fail outstanding IO now since device /* Fail outstanding IO now since device
* is marked for PLOGI. * is marked for PLOGI.
*/ */
...@@ -2544,7 +2537,7 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi) ...@@ -2544,7 +2537,7 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi)
for (i = 0; i < ARRAY_SIZE(lists); i++ ) for (i = 0; i < ARRAY_SIZE(lists); i++ )
list_for_each_entry(ndlp, lists[i], nlp_listp) list_for_each_entry(ndlp, lists[i], nlp_listp)
if (ndlp->nlp_rpi == rpi) if (ndlp->nlp_rpi == rpi)
return (ndlp); return ndlp;
return NULL; return NULL;
} }
......
/******************************************************************* /*******************************************************************
* This file is part of the Emulex Linux Device Driver for * * This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. * * Fibre Channel Host Bus Adapters. *
* Copyright (C) 2004-2005 Emulex. All rights reserved. * * Copyright (C) 2004-2006 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. * * EMULEX and SLI are trademarks of Emulex. *
* www.emulex.com * * www.emulex.com *
* Portions Copyright (C) 2004-2005 Christoph Hellwig * * Portions Copyright (C) 2004-2005 Christoph Hellwig *
...@@ -150,8 +150,7 @@ lpfc_check_elscmpl_iocb(struct lpfc_hba * phba, ...@@ -150,8 +150,7 @@ lpfc_check_elscmpl_iocb(struct lpfc_hba * phba,
lp = (uint32_t *) prsp->virt; lp = (uint32_t *) prsp->virt;
ptr = (void *)((uint8_t *)lp + sizeof(uint32_t)); ptr = (void *)((uint8_t *)lp + sizeof(uint32_t));
} }
} } else {
else {
/* Force ulpStatus error since we are returning NULL ptr */ /* Force ulpStatus error since we are returning NULL ptr */
if (!(irsp->ulpStatus)) { if (!(irsp->ulpStatus)) {
irsp->ulpStatus = IOSTAT_LOCAL_REJECT; irsp->ulpStatus = IOSTAT_LOCAL_REJECT;
...@@ -301,12 +300,10 @@ lpfc_rcv_plogi(struct lpfc_hba * phba, ...@@ -301,12 +300,10 @@ lpfc_rcv_plogi(struct lpfc_hba * phba,
/* Start discovery - this should just do /* Start discovery - this should just do
CLEAR_LA */ CLEAR_LA */
lpfc_disc_start(phba); lpfc_disc_start(phba);
} } else {
else {
lpfc_initial_flogi(phba); lpfc_initial_flogi(phba);
} }
} } else {
else {
stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY; stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY;
stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE;
lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb, lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb,
...@@ -354,7 +351,7 @@ lpfc_rcv_plogi(struct lpfc_hba * phba, ...@@ -354,7 +351,7 @@ lpfc_rcv_plogi(struct lpfc_hba * phba,
((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb;
/* no need to reg_login if we are already in one of these states */ /* no need to reg_login if we are already in one of these states */
switch(ndlp->nlp_state) { switch (ndlp->nlp_state) {
case NLP_STE_NPR_NODE: case NLP_STE_NPR_NODE:
if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) if (!(ndlp->nlp_flag & NLP_NPR_ADISC))
break; break;
...@@ -444,8 +441,7 @@ lpfc_rcv_padisc(struct lpfc_hba * phba, ...@@ -444,8 +441,7 @@ lpfc_rcv_padisc(struct lpfc_hba * phba,
(lpfc_check_adisc(phba, ndlp, pnn, ppn))) { (lpfc_check_adisc(phba, ndlp, pnn, ppn))) {
if (cmd == ELS_CMD_ADISC) { if (cmd == ELS_CMD_ADISC) {
lpfc_els_rsp_adisc_acc(phba, cmdiocb, ndlp); lpfc_els_rsp_adisc_acc(phba, cmdiocb, ndlp);
} } else {
else {
lpfc_els_rsp_acc(phba, ELS_CMD_PLOGI, cmdiocb, ndlp, lpfc_els_rsp_acc(phba, ELS_CMD_PLOGI, cmdiocb, ndlp,
NULL, 0); NULL, 0);
} }
...@@ -672,8 +668,7 @@ lpfc_rcv_plogi_plogi_issue(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, ...@@ -672,8 +668,7 @@ lpfc_rcv_plogi_plogi_issue(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp,
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS; stat.un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS;
lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb, ndlp); lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb, ndlp);
} } else {
else {
lpfc_rcv_plogi(phba, ndlp, cmdiocb); lpfc_rcv_plogi(phba, ndlp, cmdiocb);
} /* if our portname was less */ } /* if our portname was less */
...@@ -708,8 +703,7 @@ lpfc_rcv_els_plogi_issue(struct lpfc_hba * phba, ...@@ -708,8 +703,7 @@ lpfc_rcv_els_plogi_issue(struct lpfc_hba * phba,
if (evt == NLP_EVT_RCV_LOGO) { if (evt == NLP_EVT_RCV_LOGO) {
lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0);
} } else {
else {
lpfc_issue_els_logo(phba, ndlp, 0); lpfc_issue_els_logo(phba, ndlp, 0);
} }
...@@ -803,7 +797,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_hba * phba, ...@@ -803,7 +797,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_hba * phba,
* execute first, queue this command to * execute first, queue this command to
* be processed later. * be processed later.
*/ */
switch(ndlp->nlp_DID) { switch (ndlp->nlp_DID) {
case NameServer_DID: case NameServer_DID:
mbox->mbox_cmpl = mbox->mbox_cmpl =
lpfc_mbx_cmpl_ns_reg_login; lpfc_mbx_cmpl_ns_reg_login;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment