free_iob( nat->iobuf[i] );
}
/* disable interrupts */
- outl(0,nat->ioaddr +IntrEnable);
+ outl(0,nat->ioaddr + IntrMask) ;
}
/**
struct natsemi_nic *nat = netdev->priv;
unsigned int status;
unsigned int rx_status;
+ unsigned int intr_status;
unsigned int rx_len;
struct io_buffer *rx_iob;
int i;
+ outl(1,nat->ioaddr +IntrEnable);
+ /* read the interrupt register */
+ intr_status=inl(nat->ioaddr+IntrStatus);
+ if(!intr_status)
+ goto end;
+
/* check the status of packets given to card for transmission */
+ DBG("Intr status %X\n",intr_status);
+
+
i=nat->tx_dirty;
while(i!=nat->tx_cur)
{
rx_iob = alloc_iob(rx_len);
if(!rx_iob)
/* leave packet for next call to poll*/
- return;
+ goto end;
memcpy(iob_put(rx_iob,rx_len),
bus_to_virt(nat->rx[nat->rx_cur].bufptr),rx_len);
rx_status=(unsigned int)nat->rx[nat->rx_cur].cmdsts;
}
+end:
/* re-enable the potentially idle receive state machine */
- outl(RxOn, nat->ioaddr + ChipCmd);
+ outl(RxOn, nat->ioaddr + ChipCmd);
+ outl(1,nat->ioaddr +IntrEnable);
}