X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fne2k.c;h=3f444523a798ee6dfbad8a2d60913a3d4e7e18d6;hb=5beb5755a65a75f22340e4bd6770b08018c1c636;hp=1cc54576905163e08155caacd1e7dd73bf9002af;hpb=299678c78c20fdd711785ee89f125a3819580117;p=palacios.git diff --git a/palacios/src/geekos/ne2k.c b/palacios/src/geekos/ne2k.c index 1cc5457..3f44452 100644 --- a/palacios/src/geekos/ne2k.c +++ b/palacios/src/geekos/ne2k.c @@ -101,14 +101,21 @@ static void NE2K_Interrupt_Handler(struct Interrupt_State * state) if(isr_content & 0x01) /* A packet has been received. */ { uchar_t current; - do{ + /*do{ Out_Byte(NE2K_CR, 0x4a); current = In_Byte(NE2K_CURR); Out_Byte(NE2K_CR, 0x0a); NE2K_Receive(); - Out_Byte(NE2K_ISR, 0x01); + Out_Byte(NE2K_ISR, 0x01);*/ /* If BNRY and CURR aren't equal, more than one packet has been received. */ - }while (current > In_Byte(NE2K_BNRY)); + //}while (current > In_Byte(NE2K_BNRY)); + Out_Byte(NE2K_CR, 0x4a); + current = In_Byte(NE2K_CURR); + Out_Byte(NE2K_CR, 0x0a); + NE2K_Receive(); + if(current == In_Byte(NE2K_BNRY)) + /* When CURR equals BNRY, all packets in the receive ring buffer have been read. */ + Out_Byte(NE2K_ISR, 0x01); /* Clear the packet received bit of the Interrupt Register. */ } End_IRQ(state); @@ -117,7 +124,8 @@ static void NE2K_Interrupt_Handler(struct Interrupt_State * state) send_done = 1; Out_Byte(NE2K_ISR, 0x02); } - Out_Byte(NE2K_ISR, 0xff); /* Clear all interrupts. */ + + //Out_Byte(NE2K_ISR, 0xff); /* Clear all interrupts. */ } int Init_Ne2k(int (*rcvd_fn)(struct NE2K_Packet_Info *info, uchar_t *packet))