int rio_open_inb_mbox(struct rio_mport *mport, int mbox, int entries) 
int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries) 
int rio_open_inb_mbox(struct rio_mport *mport, int mbox, int entries){	int i, rc = 0;	if ((entries < RIO_MIN_RX_RING_SIZE) ||	    (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {		rc = -EINVAL;		goto out;	}	/* Initialize client buffer ring */	msg_rx_ring.size = entries;	msg_rx_ring.rx_slot = 0;	for (i = 0; i < msg_rx_ring.size; i++)		msg_rx_ring.virt_buffer[i] = NULL;	/* Initialize inbound message ring */	if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,						    msg_rx_ring.size *						    RIO_MAX_MSG_SIZE,						    &msg_rx_ring.phys,						    GFP_KERNEL))) {		rc = -ENOMEM;		goto out;	}	/* Point dequeue/enqueue pointers at first entry in ring */	out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);	out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);	/* Clear interrupt status */	out_be32((void *)&msg_regs->isr, 0x00000091);	/* Hook up inbound message handler */	if ((rc =	     request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,			 "msg_rx", (void *)mport)) < 0) {		dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,				  msg_tx_ring.virt_buffer[i],				  msg_tx_ring.phys_buffer[i]);		goto out;	}	/*	 * Configure inbound message unit:	 *      Snooping	 *      4KB max message size	 *      Unmask all interrupt sources	 *      Disable	 */	out_be32((void *)&msg_regs->imr, 0x001b0060);	/* Set number of queue entries */	out_be32((void *)&msg_regs->imr,		 in_be32((void *)&msg_regs->imr) |		 ((get_bitmask_order(entries) - 2) << 12));	/* Now enable the unit */	out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);      out:	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/6978bbc097c2f665c336927a9d56ae39ef75fa56/ppc85xx_rio.c/buggy/arch/ppc/syslib/ppc85xx_rio.c