/*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* 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. *
* www.emulex.com *
* *
/*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* 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. *
* www.emulex.com *
* Portions Copyright (C) 2004-2005 Christoph Hellwig *
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
rc = NLP_STE_FREED_NODE;
- }
- else {
+ } else {
rc = lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_PLOGI);
}
cmdsize = (sizeof (uint32_t) + sizeof (struct serv_parm));
elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp,
- ELS_CMD_PLOGI);
+ ELS_CMD_PLOGI);
if (!elsiocb)
return 1;
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
goto out;
- }
- else {
+ } else {
lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_PRLI);
}
(irsp->un.ulpWord[4] == IOERR_LINK_DOWN) ||
(irsp->un.ulpWord[4] == IOERR_SLI_DOWN))) {
goto out;
- }
- else {
+ } else {
lpfc_disc_state_machine(phba, ndlp, cmdiocb,
NLP_EVT_CMPL_LOGO);
}
phba->fc_flag &= ~FC_NLP_MORE;
spin_unlock_irq(phba->host->host_lock);
}
- return(sentadisc);
+ return sentadisc;
}
int
phba->fc_flag &= ~FC_NLP_MORE;
spin_unlock_irq(phba->host->host_lock);
}
- return(sentplogi);
+ return sentplogi;
}
int
mempool_free( mbox, phba->mbox_mem_pool);
}
return 1;
- }
- else if (rc > 0) { /* greater than */
+ } else if (rc > 0) { /* greater than */
spin_lock_irq(phba->host->host_lock);
phba->fc_flag |= FC_PT2PT_PLOGI;
spin_unlock_irq(phba->host->host_lock);
RPS *rps;
struct ls_rjt stat;
- if((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
- (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
+ if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
+ (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
stat.un.b.lsRjtRsvd0 = 0;
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA;
RPL *rpl;
struct ls_rjt stat;
- if((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
- (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
+ if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
+ (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
stat.un.b.lsRjtRsvd0 = 0;
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CANT_GIVE_DATA;
((maxsize == 0) ||
((maxsize * sizeof(uint32_t)) >= sizeof(RPL_RSP)))) {
cmdsize = sizeof(uint32_t) + sizeof(RPL_RSP);
- }
- else {
+ } else {
cmdsize = sizeof(uint32_t) + maxsize * sizeof(uint32_t);
}
lpfc_els_rsp_rpl_acc(phba, cmdsize, cmdiocb, ndlp);
* other NLP_FABRIC logins
*/
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
* device is marked for PLOGI
*/
spin_unlock_irq(phba->host->host_lock);
(piocb->iocb_cmpl) (phba, piocb, piocb);
spin_lock_irq(phba->host->host_lock);
- }
- else
+ } else
lpfc_sli_release_iocbq(phba, piocb);
}
spin_unlock_irq(phba->host->host_lock);
(piocb->iocb_cmpl) (phba, piocb, piocb);
spin_lock_irq(phba->host->host_lock);
- }
- else
+ } else
lpfc_sli_release_iocbq(phba, piocb);
}
spin_unlock_irq(phba->host->host_lock);
evt_listp);
spin_unlock_irq(phba->host->host_lock);
free_evt = 1;
- switch(evtp->evt) {
+ switch (evtp->evt) {
case LPFC_EVT_NODEV_TMO:
ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1);
lpfc_process_nodev_timeout(phba, ndlp);
work_hba_events=phba->work_hba_events;
spin_unlock_irq(phba->host->host_lock);
- if(ha_copy & HA_ERATT)
+ if (ha_copy & HA_ERATT)
lpfc_handle_eratt(phba);
- if(ha_copy & HA_MBATT)
+ if (ha_copy & HA_MBATT)
lpfc_sli_handle_mb_event(phba);
- if(ha_copy & HA_LATT)
+ if (ha_copy & HA_LATT)
lpfc_handle_latt(phba);
if (work_hba_events & WORKER_DISC_TMO)
/* Check config parameter use-adisc or FCP-2 */
if ((rc != NLP_STE_FREED_NODE) &&
(phba->cfg_use_adisc == 0) &&
- !(ndlp->nlp_fcp_info &
- NLP_FCP_2_DEVICE)) {
+ !(ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE)) {
/* We know we will have to relogin, so
* unreglogin the rpi right now to fail
* any outstanding I/Os quickly.
lpfc_can_disctmo(phba);
/* Must process IOCBs on all rings to handle ABORTed I/Os */
- return (0);
+ return 0;
}
static int
lpfc_els_disc_plogi(phba);
}
- if(!phba->num_disc_nodes) {
+ if (!phba->num_disc_nodes) {
spin_lock_irq(phba->host->host_lock);
phba->fc_flag &= ~FC_NDISC_ACTIVE;
spin_unlock_irq(phba->host->host_lock);
cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
spin_lock_irq(phba->host->host_lock);
- switch(la->UlnkSpeed) {
+ switch (la->UlnkSpeed) {
case LA_1GHZ_LINK:
phba->fc_linkspeed = LA_1GHZ_LINK;
break;
psli = &phba->sli;
/* 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)
- 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 */
break;
case NLP_UNUSED_LIST:
phba->brd_no,
nlp->nlp_DID, list, nlp->nlp_flag);
- switch(list) {
+ switch (list) {
case NLP_NO_LIST: /* No list, just remove it */
lpfc_nlp_remove(phba, nlp);
/* as node removed - stop further transport calls */
list_add_tail(&nlp->nlp_listp, &phba->fc_npr_list);
phba->fc_npr_cnt++;
- if (!(nlp->nlp_flag & NLP_NODEV_TMO)) {
+ if (!(nlp->nlp_flag & NLP_NODEV_TMO))
mod_timer(&nlp->nlp_tmofunc,
jiffies + HZ * phba->cfg_nodev_tmo);
- }
+
spin_lock_irq(phba->host->host_lock);
nlp->nlp_flag |= NLP_NODEV_TMO;
nlp->nlp_flag &= ~NLP_RCV_PLOGI;
}
}
}
- return (0);
+ return 0;
}
/*
phba->brd_no, phba->hba_state, phba->fc_flag,
phba->fc_plogi_cnt, phba->fc_adisc_cnt);
- return (0);
+ return 0;
}
/*
switch (icmd->ulpCommand) {
case CMD_GEN_REQUEST64_CR:
if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi)
- return (1);
+ return 1;
case CMD_ELS_REQUEST64_CR:
case CMD_XMIT_ELS_RSP64_CX:
if (iocb->context1 == (uint8_t *) ndlp)
- return (1);
+ return 1;
}
} else if (pring->ringno == psli->ip_ring) {
/* Skip match check if waiting to relogin to FCP target */
if ((ndlp->nlp_type & NLP_FCP_TARGET) &&
(ndlp->nlp_flag & NLP_DELAY_TMO)) {
- return (0);
+ return 0;
}
if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) {
- return (1);
+ return 1;
}
} else if (pring->ringno == psli->next_ring) {
}
- return (0);
+ return 0;
}
/*
}
}
- return (0);
+ return 0;
}
/*
lpfc_unreg_rpi(phba, ndlp);
- return (0);
+ return 0;
}
/*
spin_lock_irq(phba->host->host_lock);
ndlp->nlp_flag |= NLP_DELAY_REMOVE;
spin_unlock_irq(phba->host->host_lock);
- }
- else {
+ } else {
lpfc_freenode(phba, ndlp);
mempool_free( ndlp, phba->nlp_mem_pool);
}
- return(0);
+ return 0;
}
static int
D_ID matchdid;
if (did == Bcast_DID)
- return (0);
+ return 0;
if (ndlp->nlp_DID == 0) {
- return (0);
+ return 0;
}
/* First check for Direct match */
if (ndlp->nlp_DID == did)
- return (1);
+ return 1;
/* Next check for area/domain identically equals 0 match */
mydid.un.word = phba->fc_myDID;
if ((mydid.un.b.domain == 0) && (mydid.un.b.area == 0)) {
- return (0);
+ return 0;
}
matchdid.un.word = did;
if ((ndlpdid.un.b.domain == 0) &&
(ndlpdid.un.b.area == 0)) {
if (ndlpdid.un.b.id)
- return (1);
+ return 1;
}
- return (0);
+ return 0;
}
matchdid.un.word = ndlp->nlp_DID;
if ((matchdid.un.b.domain == 0) &&
(matchdid.un.b.area == 0)) {
if (matchdid.un.b.id)
- return (1);
+ return 1;
}
}
}
- return (0);
+ return 0;
}
/* Search for a nodelist entry on a specific list */
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
phba->brd_no,
ndlp, ndlp->nlp_DID,
ndlp->nlp_flag, data1);
- return (ndlp);
+ return ndlp;
}
}
}
del_timer_sync(&ndlp->nlp_delayfunc);
spin_lock_irq(phba->host->host_lock);
if (!list_empty(&ndlp->els_retry_evt.
- evt_listp))
+ evt_listp))
list_del_init(&ndlp->els_retry_evt.
- evt_listp);
+ evt_listp);
}
- }
- else {
+ } else {
ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
ndlp = NULL;
}
- }
- else {
+ } else {
flg = ndlp->nlp_flag & NLP_LIST_MASK;
if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST))
return NULL;
spin_lock_irq(phba->host->host_lock);
phba->fc_flag &= ~FC_RSCN_MODE;
spin_unlock_irq(phba->host->host_lock);
- }
- else
+ } else
lpfc_els_handle_rscn(phba);
}
}
if (ndlp->nlp_type & NLP_FABRIC) {
/* Clean up the ndlp on Fabric connections */
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
* is marked for PLOGI.
*/
for (i = 0; i < ARRAY_SIZE(lists); i++ )
list_for_each_entry(ndlp, lists[i], nlp_listp)
if (ndlp->nlp_rpi == rpi)
- return (ndlp);
+ return ndlp;
return NULL;
}
/*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* 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. *
* www.emulex.com *
* Portions Copyright (C) 2004-2005 Christoph Hellwig *
lp = (uint32_t *) prsp->virt;
ptr = (void *)((uint8_t *)lp + sizeof(uint32_t));
}
- }
- else {
+ } else {
/* Force ulpStatus error since we are returning NULL ptr */
if (!(irsp->ulpStatus)) {
irsp->ulpStatus = IOSTAT_LOCAL_REJECT;
/* Start discovery - this should just do
CLEAR_LA */
lpfc_disc_start(phba);
- }
- else {
+ } else {
lpfc_initial_flogi(phba);
}
- }
- else {
+ } else {
stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY;
stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE;
lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb,
((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb;
/* 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:
if (!(ndlp->nlp_flag & NLP_NPR_ADISC))
break;
(lpfc_check_adisc(phba, ndlp, pnn, ppn))) {
if (cmd == ELS_CMD_ADISC) {
lpfc_els_rsp_adisc_acc(phba, cmdiocb, ndlp);
- }
- else {
+ } else {
lpfc_els_rsp_acc(phba, ELS_CMD_PLOGI, cmdiocb, ndlp,
NULL, 0);
}
stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
stat.un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS;
lpfc_els_rsp_reject(phba, stat.un.lsRjtError, cmdiocb, ndlp);
- }
- else {
+ } else {
lpfc_rcv_plogi(phba, ndlp, cmdiocb);
} /* if our portname was less */
if (evt == NLP_EVT_RCV_LOGO) {
lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0);
- }
- else {
+ } else {
lpfc_issue_els_logo(phba, ndlp, 0);
}
* execute first, queue this command to
* be processed later.
*/
- switch(ndlp->nlp_DID) {
+ switch (ndlp->nlp_DID) {
case NameServer_DID:
mbox->mbox_cmpl =
lpfc_mbx_cmpl_ns_reg_login;