From: Matt Wojcik Date: Tue, 5 Aug 2008 17:05:16 +0000 (+0000) Subject: Changed the section of code that handles multiple packets being received. X-Git-Tag: vmmhack1-ramdisk-boot-iso-puppy~20 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=5beb5755a65a75f22340e4bd6770b08018c1c636;p=palacios-OLD.git Changed the section of code that handles multiple packets being received. --- 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))