Add configurable option to never completely fill the buffer rings.

It's not clear what the correct behavior is in that case, (we
clearly don't currently handle it correctly) so
simply avoiding it is the easiest thing to do.  As such, this
option is ON by default.
This commit is contained in:
Gregory Alexander 2003-05-20 15:01:34 +00:00
parent 04ebd29f92
commit a510ce56ee

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ne2k.cc,v 1.49 2003-04-26 14:07:58 cbothamy Exp $
// $Id: ne2k.cc,v 1.50 2003-05-20 15:01:34 yakovlev Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -35,6 +35,10 @@
#include "bochs.h"
#if BX_NE2K_SUPPORT
//Never completely fill the ne2k ring so that we never
// hit the unclear completely full buffer condition.
#define BX_NE2K_NEVER_FULL_RING (1)
#define LOG_THIS theNE2kDevice->
bx_ne2k_c *theNE2kDevice = NULL;
@ -1177,7 +1181,11 @@ bx_ne2k_c::rx_frame(const void *buf, unsigned io_len)
// Avoid getting into a buffer overflow condition by not attempting
// to do partial receives. The emulation to handle this condition
// seems particularly painful.
if (avail < pages) {
if ((avail < pages)
#if BX_NE2K_NEVER_FULL_RING
|| (avail == pages)
#endif
) {
return;
}
@ -1264,7 +1272,7 @@ bx_ne2k_c::rx_frame(const void *buf, unsigned io_len)
void
bx_ne2k_c::init(void)
{
BX_DEBUG(("Init $Id: ne2k.cc,v 1.49 2003-04-26 14:07:58 cbothamy Exp $"));
BX_DEBUG(("Init $Id: ne2k.cc,v 1.50 2003-05-20 15:01:34 yakovlev Exp $"));
// Bring the register state into power-up state