Author: cgutman
Date: Fri Jul 5 08:11:18 2013
New Revision: 59429
URL:
http://svn.reactos.org/svn/reactos?rev=59429&view=rev
Log:
[RTL8139]
- Fix receive stalling if more than 10 packets are in the receive window
- Tune configuration to use larger DMA transfers and begin DMA earlier
Modified:
trunk/reactos/drivers/network/dd/rtl8139/interrupt.c
trunk/reactos/drivers/network/dd/rtl8139/nic.h
Modified: trunk/reactos/drivers/network/dd/rtl8139/interrupt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/rtl8139…
==============================================================================
--- trunk/reactos/drivers/network/dd/rtl8139/interrupt.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/rtl8139/interrupt.c [iso-8859-1] Fri Jul 5 08:11:18
2013
@@ -78,7 +78,6 @@
)
{
PRTL_ADAPTER adapter = (PRTL_ADAPTER)MiniportAdapterContext;
- ULONG i;
ULONG txStatus;
UCHAR command;
PPACKET_HEADER nicHeader;
@@ -146,7 +145,7 @@
//
if (adapter->InterruptPending & (R_I_RXOK | R_I_RXERR))
{
- for (i = 0; i < MAX_RECEIVES_PER_INT; i++)
+ for (;;)
{
NdisRawReadPortUchar(adapter->IoBase + R_CMD, &command);
if (command & R_CMD_RXEMPTY)
@@ -200,6 +199,15 @@
adapter->ReceiveOffset += nicHeader->PacketLength +
sizeof(PACKET_HEADER);
adapter->ReceiveOffset = (adapter->ReceiveOffset + 3) & ~3;
NdisRawWritePortUshort(adapter->IoBase + R_CAPR, adapter->ReceiveOffset
- 0x10);
+
+ if (adapter->InterruptPending & (R_I_RXOVRFLW | R_I_FIFOOVR))
+ {
+ //
+ // We can only clear these interrupts once CAPR has been reset
+ //
+ NdisRawWritePortUshort(adapter->IoBase + R_IS, R_I_RXOVRFLW |
R_I_FIFOOVR);
+ adapter->InterruptPending &= ~(R_I_RXOVRFLW | R_I_FIFOOVR);
+ }
}
NdisMEthIndicateReceiveComplete(adapter->MiniportAdapterHandle);
Modified: trunk/reactos/drivers/network/dd/rtl8139/nic.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/rtl8139…
==============================================================================
--- trunk/reactos/drivers/network/dd/rtl8139/nic.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/rtl8139/nic.h [iso-8859-1] Fri Jul 5 08:11:18 2013
@@ -12,9 +12,8 @@
#define RESOURCE_LIST_TAG 'Rltr'
#define MAX_RESET_ATTEMPTS 25
-#define MAX_RECEIVES_PER_INT 10
-#define RECEIVE_BUFFER_SIZE (32768)
-#define FULL_RECEIVE_BUFFER_SIZE (32768 + 16 + 2048)
+#define RECEIVE_BUFFER_SIZE (65536)
+#define FULL_RECEIVE_BUFFER_SIZE (65536 + 16 + 2048)
#define RECV_CRC_LENGTH 4
#define MINIMUM_FRAME_SIZE 60
@@ -22,11 +21,11 @@
#define DRIVER_VERSION 1
-// 32K RX buffer, 512 byte DMA bursts
-#define RC_VAL (0x0001680)
-
-// 1024 byte DMA bursts
-#define TC_VAL (0x600)
+// 1/2 packet early RX, 512 byte FIFO threshold, 64K RX buffer, unlimited DMA bursts,
WRAP
+#define RC_VAL (0x800BF80)
+
+// 2048 byte DMA bursts
+#define TC_VAL (0x700)
typedef struct _RTL_ADAPTER {
NDIS_HANDLE MiniportAdapterHandle;