struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; struct lpfc_iocbq *iocb = NULL; 
struct lpfc_iocbq *iocb; 
lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt,		 int type){	IOCB_t *icmd;	struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list;	struct lpfc_iocbq *iocb = NULL;	struct lpfc_dmabuf *mp1, *mp2;	cnt += pring->missbufcnt;	/* While there are buffers to post */	while (cnt > 0) {		/* Allocate buffer for  command iocb */		spin_lock_irq(phba->host->host_lock);		list_remove_head(lpfc_iocb_list, iocb, struct lpfc_iocbq, list);		spin_unlock_irq(phba->host->host_lock);		if (iocb == NULL) {			pring->missbufcnt = cnt;			return cnt;		}		icmd = &iocb->iocb;		/* 2 buffers can be posted per command */		/* Allocate buffer to post */		mp1 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL);		if (mp1)		    mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI,						&mp1->phys);		if (mp1 == 0 || mp1->virt == 0) {			if (mp1)				kfree(mp1);			spin_lock_irq(phba->host->host_lock);			lpfc_sli_release_iocbq(phba, iocb);			spin_unlock_irq(phba->host->host_lock);			pring->missbufcnt = cnt;			return cnt;		}		INIT_LIST_HEAD(&mp1->list);		/* Allocate buffer to post */		if (cnt > 1) {			mp2 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL);			if (mp2)				mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI,							    &mp2->phys);			if (mp2 == 0 || mp2->virt == 0) {				if (mp2)					kfree(mp2);				lpfc_mbuf_free(phba, mp1->virt, mp1->phys);				kfree(mp1);				spin_lock_irq(phba->host->host_lock);				lpfc_sli_release_iocbq(phba, iocb);				spin_unlock_irq(phba->host->host_lock);				pring->missbufcnt = cnt;				return cnt;			}			INIT_LIST_HEAD(&mp2->list);		} else {			mp2 = NULL;		}		icmd->un.cont64[0].addrHigh = putPaddrHigh(mp1->phys);		icmd->un.cont64[0].addrLow = putPaddrLow(mp1->phys);		icmd->un.cont64[0].tus.f.bdeSize = FCELSSIZE;		icmd->ulpBdeCount = 1;		cnt--;		if (mp2) {			icmd->un.cont64[1].addrHigh = putPaddrHigh(mp2->phys);			icmd->un.cont64[1].addrLow = putPaddrLow(mp2->phys);			icmd->un.cont64[1].tus.f.bdeSize = FCELSSIZE;			cnt--;			icmd->ulpBdeCount = 2;		}		icmd->ulpCommand = CMD_QUE_RING_BUF64_CN;		icmd->ulpLe = 1;		spin_lock_irq(phba->host->host_lock);		if (lpfc_sli_issue_iocb(phba, pring, iocb, 0) == IOCB_ERROR) {			lpfc_mbuf_free(phba, mp1->virt, mp1->phys);			kfree(mp1);			cnt++;			if (mp2) {				lpfc_mbuf_free(phba, mp2->virt, mp2->phys);				kfree(mp2);				cnt++;			}			lpfc_sli_release_iocbq(phba, iocb);			pring->missbufcnt = cnt;			spin_unlock_irq(phba->host->host_lock);			return cnt;		}		spin_unlock_irq(phba->host->host_lock);		lpfc_sli_ringpostbuf_put(phba, pring, mp1);		if (mp2) {			lpfc_sli_ringpostbuf_put(phba, pring, mp2);		}	}	pring->missbufcnt = 0;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0bd4ca25ad2ace4aa717c83dbd4ed21c53c953cb/lpfc_init.c/clean/drivers/scsi/lpfc/lpfc_init.c