/* Prototype: void acornscsi_intr(int irq, void *dev_id) Purpose : handle interrupts from Acorn SCSI card Params : irq - interrupt number dev_id - device specific data (AS_Host structure)  */
static irqreturn_t acornscsi_intr(int irq, void *dev_id)
/* Prototype: void acornscsi_intr(int irq, void *dev_id) Purpose : handle interrupts from Acorn SCSI card Params : irq - interrupt number dev_id - device specific data (AS_Host structure)  */
static irqreturn_t acornscsi_intr(int irq, void *dev_id)
{
    AS_Host *host = (AS_Host *)dev_id;
    intr_ret_t ret;
    int iostatus;
    int in_irq = 0;
    do {
	ret = INTR_IDLE;
	iostatus = readb(host->fast + INT_REG);
	if (iostatus & 2) {
	    acornscsi_dma_intr(host);
	    iostatus = readb(host->fast + INT_REG);
	}
	if (iostatus & 8)
	    ret = acornscsi_sbicintr(host, in_irq);
	if (host->dma.xfer_required)
	    acornscsi_dma_xfer(host);
	if (ret == INTR_NEXT_COMMAND)
	    ret = acornscsi_kick(host);
	in_irq = 1;
    } while (ret != INTR_IDLE);
    return IRQ_HANDLED;
}