예제 #1
0
static int esp_dafb_dma_irq_p(struct NCR_ESP * esp)
{
	unsigned int ret;
	int sreg = esp_read(esp->eregs->esp_status);

#ifdef DEBUG_MAC_ESP
	printk("mac_esp: esp_dafb_dma_irq_p dafb %d irq %d\n", 
		readl(esp->dregs), mac_irq_pending(IRQ_MAC_SCSI));
#endif

	sreg &= ESP_STAT_INTR;

	/*
	 * maybe working; this is essentially what's used for iosb_dma_irq_p
	 */
	if (sreg)
		return 1;
	else
		return 0;

	/*
	 * didn't work ...
	 */
#if 0
	if (esp->current_SC)
		ret = readl(esp->dregs) & 0x200;
	else if (esp->disconnected_SC)
		ret = 1; /* sreg ?? */
	else
		ret = mac_irq_pending(IRQ_MAC_SCSI);

	return(ret);
#endif

}
예제 #2
0
static inline int mac_esp_wait_for_dreq(struct esp *esp)
{
	struct mac_esp_priv *mep = MAC_ESP_GET_PRIV(esp);
	int i = 500000;

	do {
		if (mep->pdma_regs == NULL) {
			if (mac_irq_pending(IRQ_MAC_SCSIDRQ))
				return 0;
		} else {
			if (nubus_readl(mep->pdma_regs) & 0x200)
				return 0;
		}

		if (esp_read8(ESP_STATUS) & ESP_STAT_INTR)
			return 1;

		udelay(2);
	} while (--i);

	printk(KERN_ERR PFX "PDMA timeout (sreg %02x)\n",
	       esp_read8(ESP_STATUS));
	mep->error = 1;
	return 1;
}
예제 #3
0
static int esp_iosb_dma_irq_p(struct NCR_ESP * esp)
{
	int ret  = mac_irq_pending(IRQ_MAC_SCSI) || mac_irq_pending(IRQ_MAC_SCSIDRQ);
	int sreg = esp_read(esp->eregs->esp_status);

#ifdef DEBUG_MAC_ESP
	printk("mac_esp: dma_irq_p drq %d irq %d sreg %x curr %p disc %p\n", 
		mac_irq_pending(IRQ_MAC_SCSIDRQ), mac_irq_pending(IRQ_MAC_SCSI), 
		sreg, esp->current_SC, esp->disconnected_SC);
#endif

	sreg &= ESP_STAT_INTR;

	if (sreg)
		return (sreg);
	else
		return 0;
}