Posted: Wed Apr 18, 2007 12:54 am
Is this better?
Edit: the above doesn't work...
Code: Select all
struct ne2000_t* ne = neDevs[0];
uint8_t status;
packet_t *p;
// main loop
while( 1 )
{
// check ISR bit
unsigned char isr = inportb( ne->ioAddress + INTERRUPTSTATUS );
// is it set for receive?
if( status & 0x01 )
{
// clear the bit
outportb( ne->ioAddress + INTERRUPTSTATUS, isr & 0xFE );
// received
p = readPacket( ne );
handleEthernet( ne->eth, p );
}
else
{
// nope
break;
}
}