stat.un.b.lsRjtRsnCodeExp = rjt_err; 
stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; 
lpfc_els_unsol_event(struct lpfc_hba * phba,		     struct lpfc_sli_ring * pring, struct lpfc_iocbq * elsiocb){	struct lpfc_sli *psli;	struct lpfc_nodelist *ndlp;	struct lpfc_dmabuf *mp;	uint32_t *lp;	IOCB_t *icmd;	struct ls_rjt stat;	uint32_t cmd;	uint32_t did;	uint32_t newnode;	uint32_t drop_cmd = 0;	/* by default do NOT drop received cmd */	uint32_t rjt_err = 0;	psli = &phba->sli;	icmd = &elsiocb->iocb;	if ((icmd->ulpStatus == IOSTAT_LOCAL_REJECT) &&		((icmd->un.ulpWord[4] & 0xff) == IOERR_RCV_BUFFER_WAITING)) {		/* Not enough posted buffers; Try posting more buffers */		phba->fc_stat.NoRcvBuf++;		lpfc_post_buffer(phba, pring, 0, 1);		return;	}	/* If there are no BDEs associated with this IOCB,	 * there is nothing to do.	 */	if (icmd->ulpBdeCount == 0)		return;	/* type of ELS cmd is first 32bit word in packet */	mp = lpfc_sli_ringpostbuf_get(phba, pring, getPaddr(icmd->un.							    cont64[0].							    addrHigh,							    icmd->un.							    cont64[0].addrLow));	if (mp == 0) {		drop_cmd = 1;		goto dropit;	}	newnode = 0;	lp = (uint32_t *) mp->virt;	cmd = *lp++;	lpfc_post_buffer(phba, &psli->ring[LPFC_ELS_RING], 1, 1);	if (icmd->ulpStatus) {		lpfc_mbuf_free(phba, mp->virt, mp->phys);		kfree(mp);		drop_cmd = 1;		goto dropit;	}	/* Check to see if link went down during discovery */	if (lpfc_els_chk_latt(phba)) {		lpfc_mbuf_free(phba, mp->virt, mp->phys);		kfree(mp);		drop_cmd = 1;		goto dropit;	}	did = icmd->un.rcvels.remoteID;	if ((ndlp = lpfc_findnode_did(phba, NLP_SEARCH_ALL, did)) == 0) {		/* Cannot find existing Fabric ndlp, so allocate a new one */		if ((ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL))		    == 0) {			lpfc_mbuf_free(phba, mp->virt, mp->phys);			kfree(mp);			drop_cmd = 1;			goto dropit;		}		lpfc_nlp_init(phba, ndlp, did);		newnode = 1;		if ((did & Fabric_DID_MASK) == Fabric_DID_MASK) {			ndlp->nlp_type |= NLP_FABRIC;		}	}	phba->fc_stat.elsRcvFrame++;	elsiocb->context1 = ndlp;	elsiocb->context2 = mp;	if ((cmd & ELS_CMD_MASK) == ELS_CMD_RSCN) {		cmd &= ELS_CMD_MASK;	}	/* ELS command <elsCmd> received from NPORT <did> */	lpfc_printf_log(phba, KERN_INFO, LOG_ELS,			"%d:0112 ELS command x%x received from NPORT x%x "			"Data: x%x\n", phba->brd_no, cmd, did, phba->hba_state);	switch (cmd) {	case ELS_CMD_PLOGI:		phba->fc_stat.elsRcvPLOGI++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PLOGI);		break;	case ELS_CMD_FLOGI:		phba->fc_stat.elsRcvFLOGI++;		lpfc_els_rcv_flogi(phba, elsiocb, ndlp, newnode);		if (newnode) {			mempool_free( ndlp, phba->nlp_mem_pool);		}		break;	case ELS_CMD_LOGO:		phba->fc_stat.elsRcvLOGO++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_LOGO);		break;	case ELS_CMD_PRLO:		phba->fc_stat.elsRcvPRLO++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PRLO);		break;	case ELS_CMD_RSCN:		phba->fc_stat.elsRcvRSCN++;		lpfc_els_rcv_rscn(phba, elsiocb, ndlp, newnode);		if (newnode) {			mempool_free( ndlp, phba->nlp_mem_pool);		}		break;	case ELS_CMD_ADISC:		phba->fc_stat.elsRcvADISC++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_ADISC);		break;	case ELS_CMD_PDISC:		phba->fc_stat.elsRcvPDISC++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PDISC);		break;	case ELS_CMD_FARPR:		phba->fc_stat.elsRcvFARPR++;		lpfc_els_rcv_farpr(phba, elsiocb, ndlp);		break;	case ELS_CMD_FARP:		phba->fc_stat.elsRcvFARP++;		lpfc_els_rcv_farp(phba, elsiocb, ndlp);		break;	case ELS_CMD_FAN:		phba->fc_stat.elsRcvFAN++;		lpfc_els_rcv_fan(phba, elsiocb, ndlp);		break;	case ELS_CMD_RRQ:		phba->fc_stat.elsRcvRRQ++;		lpfc_els_rcv_rrq(phba, elsiocb, ndlp);		break;	case ELS_CMD_PRLI:		phba->fc_stat.elsRcvPRLI++;		if (phba->hba_state < LPFC_DISC_AUTH) {			rjt_err = LSEXP_NOTHING_MORE;			break;		}		lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PRLI);		break;	case ELS_CMD_RNID:		phba->fc_stat.elsRcvRNID++;		lpfc_els_rcv_rnid(phba, elsiocb, ndlp);		break;	default:		/* Unsupported ELS command, reject */		rjt_err = LSEXP_NOTHING_MORE;		/* Unknown ELS command <elsCmd> received from NPORT <did> */		lpfc_printf_log(phba, KERN_ERR, LOG_ELS,				"%d:0115 Unknown ELS command x%x received from "				"NPORT x%x\n", phba->brd_no, cmd, did);		if (newnode) {			mempool_free( ndlp, phba->nlp_mem_pool);		}		break;	}	/* check if need to LS_RJT received ELS cmd */	if (rjt_err) {		stat.un.b.lsRjtRsvd0 = 0;		stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;		stat.un.b.lsRjtRsnCodeExp = rjt_err;		stat.un.b.vendorUnique = 0;		lpfc_els_rsp_reject(phba, stat.un.lsRjtError, elsiocb, ndlp);	}	if (elsiocb->context2) {		lpfc_mbuf_free(phba, mp->virt, mp->phys);		kfree(mp);	}dropit:	/* check if need to drop received ELS cmd */	if (drop_cmd == 1) {		lpfc_printf_log(phba, KERN_ERR, LOG_ELS,				"%d:0111 Dropping received ELS cmd "				"Data: x%x x%x\n", phba->brd_no,				icmd->ulpStatus, icmd->un.ulpWord[4]);		phba->fc_stat.elsRcvDrop++;	}	return;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1f679cafd2d02b7076e9045d9c4fb77ef8d059f2/lpfc_els.c/buggy/drivers/scsi/lpfc/lpfc_els.c