--- hw/rtl8139-20060709-with-working-tso-2.c 2006-07-09 12:41:47.000000000 +0400 +++ hw/rtl8139.c 2006-07-11 01:15:27.000000000 +0400 @@ -40,6 +40,7 @@ * 2006-Jul-09 Igor Kovalenko : Fixed TCP header length calculation while processing * segmentation offloading * Removed slirp.h dependency + * Added rx/tx buffer reset when enabling rx/tx operation */ #include "vl.h" @@ -1368,10 +1369,14 @@ if (val & CmdRxEnb) { DEBUG_PRINT(("RTL8139: ChipCmd enable receiver\n")); + + s->currCPlusRxDesc = 0; } if (val & CmdTxEnb) { DEBUG_PRINT(("RTL8139: ChipCmd enable transmitter\n")); + + s->currCPlusTxDesc = 0; } /* mask unwriteable bits */ @@ -2078,8 +2083,8 @@ /* ip packet header */ ip_header *ip = 0; int hlen = 0; - u_int8_t ip_protocol = 0; - u_int16_t ip_data_len = 0; + uint8_t ip_protocol = 0; + uint16_t ip_data_len = 0; uint8_t *eth_payload_data = 0; size_t eth_payload_len = 0; @@ -2450,8 +2455,6 @@ DEBUG_PRINT(("RTL8139: TxAddr write offset=0x%x val=0x%08x\n", txAddrOffset, val)); s->TxAddr[txAddrOffset/4] = le32_to_cpu(val); - - s->currCPlusTxDesc = 0; } static uint32_t rtl8139_TxAddr_read(RTL8139State *s, uint32_t txAddrOffset)