lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp)); 
 for (i=0; i < phba->sli.num_rings; i++) { lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp)); to_slim += sizeof (struct lpfc_hgp); } 
lpfc_config_port(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb){	MAILBOX_t *mb = &pmb->mb;	dma_addr_t pdma_addr;	uint32_t bar_low, bar_high;	size_t offset;	struct lpfc_hgp hgp;	void __iomem *to_slim;	memset(pmb, 0, sizeof(LPFC_MBOXQ_t));	mb->mbxCommand = MBX_CONFIG_PORT;	mb->mbxOwner = OWN_HOST;	mb->un.varCfgPort.pcbLen = sizeof(PCB_t);	offset = (uint8_t *)&phba->slim2p->pcb - (uint8_t *)phba->slim2p;	pdma_addr = phba->slim2p_mapping + offset;	mb->un.varCfgPort.pcbLow = putPaddrLow(pdma_addr);	mb->un.varCfgPort.pcbHigh = putPaddrHigh(pdma_addr);	/* Now setup pcb */	phba->slim2p->pcb.type = TYPE_NATIVE_SLI2;	phba->slim2p->pcb.feature = FEATURE_INITIAL_SLI2;	/* Setup Mailbox pointers */	phba->slim2p->pcb.mailBoxSize = sizeof(MAILBOX_t);	offset = (uint8_t *)&phba->slim2p->mbx - (uint8_t *)phba->slim2p;	pdma_addr = phba->slim2p_mapping + offset;	phba->slim2p->pcb.mbAddrHigh = putPaddrHigh(pdma_addr);	phba->slim2p->pcb.mbAddrLow = putPaddrLow(pdma_addr);	/*	 * Setup Host Group ring pointer.	 *	 * For efficiency reasons, the ring get/put pointers can be	 * placed in adapter memory (SLIM) rather than in host memory.	 * This allows firmware to avoid PCI reads/writes when updating	 * and checking pointers.	 *	 * The firmware recognizes the use of SLIM memory by comparing	 * the address of the get/put pointers structure with that of	 * the SLIM BAR (BAR0).	 *	 * Caution: be sure to use the PCI config space value of BAR0/BAR1	 * (the hardware's view of the base address), not the OS's	 * value of pci_resource_start() as the OS value may be a cookie	 * for ioremap/iomap.	 */	pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_0, &bar_low);	pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_1, &bar_high);	/* mask off BAR0's flag bits 0 - 3 */	phba->slim2p->pcb.hgpAddrLow = (bar_low & PCI_BASE_ADDRESS_MEM_MASK) +					(SLIMOFF*sizeof(uint32_t));	if (bar_low & PCI_BASE_ADDRESS_MEM_TYPE_64)		phba->slim2p->pcb.hgpAddrHigh = bar_high;	else		phba->slim2p->pcb.hgpAddrHigh = 0;	/* write HGP data to SLIM at the required longword offset */	memset(&hgp, 0, sizeof(struct lpfc_hgp));	to_slim = phba->MBslimaddr + (SLIMOFF*sizeof (uint32_t));	lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp));	/* Setup Port Group ring pointer */	offset = (uint8_t *)&phba->slim2p->mbx.us.s2.port -		 (uint8_t *)phba->slim2p;	pdma_addr = phba->slim2p_mapping + offset;	phba->slim2p->pcb.pgpAddrHigh = putPaddrHigh(pdma_addr);	phba->slim2p->pcb.pgpAddrLow = putPaddrLow(pdma_addr);	/* Use callback routine to setp rings in the pcb */	lpfc_config_pcb_setup(phba);	/* special handling for LC HBAs */	if (lpfc_is_LC_HBA(phba->pcidev->device)) {		uint32_t hbainit[5];		lpfc_hba_init(phba, hbainit);		memcpy(&mb->un.varCfgPort.hbainit, hbainit, 20);	}	/* Swap PCB if needed */	lpfc_sli_pcimem_bcopy(&phba->slim2p->pcb, &phba->slim2p->pcb,								sizeof (PCB_t));	lpfc_printf_log(phba, KERN_INFO, LOG_INIT,		        "%d:0405 Service Level Interface (SLI) 2 selected\n",		        phba->brd_no);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f91b392c4d20fcd2684587c0a091123c0409959c/lpfc_mbox.c/clean/drivers/scsi/lpfc/lpfc_mbox.c