diff --git a/reactos/drivers/net/dd/ne2000/DIRS b/reactos/drivers/net/dd/ne2000/DIRS deleted file mode 100644 index 98e9381dc59..00000000000 --- a/reactos/drivers/net/dd/ne2000/DIRS +++ /dev/null @@ -1 +0,0 @@ -DIRS= ne2000 diff --git a/reactos/drivers/net/dd/ne2000/include/8390.h b/reactos/drivers/net/dd/ne2000/include/8390.h index f1e0f7b1dce..57b3107c03a 100644 --- a/reactos/drivers/net/dd/ne2000/include/8390.h +++ b/reactos/drivers/net/dd/ne2000/include/8390.h @@ -143,11 +143,15 @@ typedef struct _PACKET_HEADER { } PACKET_HEADER, PPACKET_HEADER; -#define NICDisableInterrupts(Adapter) \ - NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, 0x00); +#define NICDisableInterrupts(Adapter) { \ + NDIS_DbgPrint(MAX_TRACE, ("NICDisableInterrupts()\n")); \ + NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, 0x00); \ +} -#define NICEnableInterrupts(Adapter) \ - NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, (Adapter)->InterruptMask); +#define NICEnableInterrupts(Adapter) { \ + NDIS_DbgPrint(MAX_TRACE, ("NICEnableInterrupts() Mask (0x%X)\n", (Adapter)->InterruptMask)); \ + NdisRawWritePortUchar((Adapter)->IOBase + PG0_IMR, (Adapter)->InterruptMask); \ +} VOID MiniportHandleInterrupt( IN NDIS_HANDLE MiniportAdapterContext); diff --git a/reactos/drivers/net/dd/ne2000/ne2000/8390.c b/reactos/drivers/net/dd/ne2000/ne2000/8390.c index 9de55f7d930..59a69994476 100644 --- a/reactos/drivers/net/dd/ne2000/ne2000/8390.c +++ b/reactos/drivers/net/dd/ne2000/ne2000/8390.c @@ -52,9 +52,7 @@ BOOLEAN NICTestAddress( * ARGUMENTS: * Adapter = Pointer to adapter information * RETURNS: - * TRUE if the RAM size was found, FALSE if not - * NOTES: - * Starts at 1KB and tests every 1KB up to 64KB + * TRUE if the address is writable, FALSE if not */ { USHORT Data; @@ -217,7 +215,7 @@ BOOLEAN NICReadSAPROM( /* If WordLength is 2 the data read before was doubled. We must compensate for this */ if (WordLength == 2) { - NDIS_DbgPrint(MIN_TRACE, ("NE2000 found.\n")); + DbgPrint("NE2000 or compatible network adapter found.\n"); Adapter->WordMode = TRUE; @@ -236,7 +234,7 @@ BOOLEAN NICReadSAPROM( return TRUE; } else { - NDIS_DbgPrint(MIN_TRACE, ("NE1000 found.\n")); + DbgPrint("NE1000 or compatible network adapter found.\n"); Adapter->WordMode = FALSE; @@ -262,7 +260,7 @@ NDIS_STATUS NICInitialize( NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); if (!NICCheck(Adapter)) { - NDIS_DbgPrint(MIN_TRACE, ("No adapter found at (0x%X).\n", Adapter->IOBase)); + NDIS_DbgPrint(MID_TRACE, ("No adapter found at (0x%X).\n", Adapter->IOBase)); return NDIS_STATUS_ADAPTER_NOT_FOUND; } else NDIS_DbgPrint(MID_TRACE, ("Adapter found at (0x%X).\n", Adapter->IOBase)); @@ -553,13 +551,13 @@ VOID NICGetCurrentPage( UCHAR Current; /* Select page 1 */ - NdisRawWritePortUchar(Adapter->IOBase + PG0_CR, CR_STP | CR_RD2 | CR_PAGE1); + NdisRawWritePortUchar(Adapter->IOBase + PG0_CR, CR_STA | CR_RD2 | CR_PAGE1); /* Read current page */ NdisRawReadPortUchar(Adapter->IOBase + PG1_CURR, &Current); /* Select page 0 */ - NdisRawWritePortUchar(Adapter->IOBase + PG0_CR, CR_STP | CR_RD2 | CR_PAGE0); + NdisRawWritePortUchar(Adapter->IOBase + PG0_CR, CR_STA | CR_RD2 | CR_PAGE0); Adapter->CurrentPage = Current; } @@ -900,16 +898,10 @@ VOID NICReadPacket( * Adapter = Pointer to adapter information */ { - UCHAR Tmp; BOOLEAN SkipPacket = FALSE; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - /* Check if receive buffer ring is empty */ - - /* Read boundary page */ - NdisRawReadPortUchar(Adapter->IOBase + PG0_BNRY, &Tmp); - /* Get the header of the next packet in the receive ring */ Adapter->PacketOffset = Adapter->NextPacket << 8; NICReadData(Adapter, @@ -1135,6 +1127,11 @@ VOID HandleReceive( NdisStallExecution(500); } +#ifdef DBG + if (i == 4) + NDIS_DbgPrint(MIN_TRACE, ("NIC was not reset after 2ms.\n")); +#endif + if ((Adapter->InterruptStatus & (ISR_PTX | ISR_TXE)) == 0) { /* We may need to restart the transmitter */ Adapter->TransmitPending = TRUE; @@ -1164,6 +1161,10 @@ VOID HandleReceive( for (;;) { NICGetCurrentPage(Adapter); + NDIS_DbgPrint(MAX_TRACE, ("Current page (0x%X) NextPacket (0x%X).\n", + Adapter->CurrentPage, + Adapter->NextPacket)); + if (Adapter->CurrentPage == Adapter->NextPacket) { NDIS_DbgPrint(MAX_TRACE, ("No more packets.\n")); break; @@ -1257,7 +1258,7 @@ VOID MiniportHandleInterrupt( NDIS_DbgPrint(MAX_TRACE, ("ISRValue (0x%X).\n", ISRValue)); - Adapter->InterruptStatus = (ISRValue & ISRMask); + Adapter->InterruptStatus |= (ISRValue & ISRMask); if (ISRValue != 0x00) /* Acknowledge interrupts */ @@ -1266,13 +1267,15 @@ VOID MiniportHandleInterrupt( Mask = 0x01; while (Adapter->InterruptStatus != 0x00) { - NDIS_DbgPrint(MAX_TRACE, ("Adapter->InterruptStatus (0x%X).\n", Adapter->InterruptStatus)); + NDIS_DbgPrint(MAX_TRACE, ("Adapter->InterruptStatus (0x%X) Mask (0x%X).\n", + Adapter->InterruptStatus, Mask)); + /* Find next interrupt type */ while (((Adapter->InterruptStatus & Mask) == 0) && (Mask < ISRMask)) Mask = (Mask << 1); switch (Adapter->InterruptStatus & Mask) { - case ISR_OVW: + case ISR_OVW: NDIS_DbgPrint(MAX_TRACE, ("Overflow interrupt.\n")); /* Overflow. Handled almost the same way as a receive interrupt */ Adapter->BufferOverflow = TRUE; @@ -1294,7 +1297,7 @@ VOID MiniportHandleInterrupt( HandleReceive(Adapter); Adapter->InterruptStatus &= ~(ISR_PRX | ISR_RXE); - break; + break; case ISR_TXE: NDIS_DbgPrint(MAX_TRACE, ("Transmit error interrupt.\n")); @@ -1327,7 +1330,11 @@ VOID MiniportHandleInterrupt( Mask = (Mask << 1); /* Check if new interrupts are generated */ + NdisRawReadPortUchar(Adapter->IOBase + PG0_ISR, &ISRValue); + + NDIS_DbgPrint(MAX_TRACE, ("ISRValue (0x%X).\n", ISRValue)); + Adapter->InterruptStatus |= (ISRValue & ISRMask); if (ISRValue != 0x00) { diff --git a/reactos/drivers/net/dd/ne2000/ne2000/MAKEFILE b/reactos/drivers/net/dd/ne2000/ne2000/MAKEFILE deleted file mode 100644 index 6ee4f43fa46..00000000000 --- a/reactos/drivers/net/dd/ne2000/ne2000/MAKEFILE +++ /dev/null @@ -1,6 +0,0 @@ -# -# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source -# file to this component. This file merely indirects to the real make file -# that is shared by all the components of NT OS/2 -# -!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/reactos/drivers/net/dd/ne2000/ne2000/RESOURCE.RC b/reactos/drivers/net/dd/ne2000/ne2000/RESOURCE.RC deleted file mode 100644 index cc44c94142f..00000000000 --- a/reactos/drivers/net/dd/ne2000/ne2000/RESOURCE.RC +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -#define VER_FILETYPE VFT_DRV -#define VER_FILESUBTYPE VFT2_DRV_NETWORK -#define VER_FILEDESCRIPTION_STR "Novell NE2000 network driver" -#define VER_INTERNALNAME_STR "NE2000.SYS" -#define VER_ORIGINALFILENAME_STR "NE2000.SYS" - -#include "common.ver" diff --git a/reactos/drivers/net/dd/ne2000/ne2000/SOURCES b/reactos/drivers/net/dd/ne2000/ne2000/SOURCES deleted file mode 100644 index 852122d74af..00000000000 --- a/reactos/drivers/net/dd/ne2000/ne2000/SOURCES +++ /dev/null @@ -1,15 +0,0 @@ -TARGETNAME=ne2000 -TARGETPATH=..\objects -TARGETTYPE=DRIVER - -TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib - -C_DEFINES=$(C_DEFINES) -DNDIS_MINIPORT_DRIVER -DDBG - -INCLUDES=..\include;..\..\..\..\..\include\net;$(BASEDIR)\inc - -SOURCES=main.c \ - 8390.c \ - RESOURCE.RC - -MSC_WARNING_LEVEL=/W3 /WX diff --git a/reactos/drivers/net/dd/ne2000/ne2000/main.c b/reactos/drivers/net/dd/ne2000/ne2000/main.c index 7f673d79fb4..b4178a2800c 100644 --- a/reactos/drivers/net/dd/ne2000/ne2000/main.c +++ b/reactos/drivers/net/dd/ne2000/ne2000/main.c @@ -217,7 +217,10 @@ NDIS_STATUS MiniportInitialize( #ifndef NOCARD Status = NICInitialize(Adapter); if (Status != NDIS_STATUS_SUCCESS) { - NDIS_DbgPrint(MIN_TRACE, ("Cannot find NE2000 NIC. Status (0x%X).\n", Status)); + DbgPrint("No NE2000 or compatible network adapter found at address 0x%X.\n", + Adapter->IOBase); + + NDIS_DbgPrint(MID_TRACE, ("Status (0x%X).\n", Status)); MiniportHalt((NDIS_HANDLE)Adapter); return Status; } @@ -246,12 +249,12 @@ NDIS_STATUS MiniportInitialize( /* Setup the NIC */ NICSetup(Adapter); - NDIS_DbgPrint(MIN_TRACE, ("TXStart (0x%X) TXCount (0x%X) PageStart (0x%X)\n", + NDIS_DbgPrint(MAX_TRACE, ("TXStart (0x%X) TXCount (0x%X) PageStart (0x%X)\n", Adapter->TXStart, Adapter->TXCount, Adapter->PageStart)); - NDIS_DbgPrint(MIN_TRACE, ("PageStop (0x%X) CurrentPage (0x%X) NextPacket (0x%X).\n", + NDIS_DbgPrint(MAX_TRACE, ("PageStop (0x%X) CurrentPage (0x%X) NextPacket (0x%X).\n", Adapter->PageStop, Adapter->CurrentPage, Adapter->NextPacket)); diff --git a/reactos/drivers/net/dd/ne2000/readme.txt b/reactos/drivers/net/dd/ne2000/readme.txt deleted file mode 100644 index 368289c123e..00000000000 --- a/reactos/drivers/net/dd/ne2000/readme.txt +++ /dev/null @@ -1,18 +0,0 @@ -Build instructions for NE2000 driver ------------------------------------- - -Building with Visual C++ and Windows NT DDK: - -Variables: -%BASEDIR% = path to NT4 DDK (e.g. c:\ntddk) -%DDKBUILDENV% = DDK build environment (free or checked) - -DDK environment variables must be set! (run setenv.bat) - - - Create the directory objects/i386/%DDKBUILDENV% - - Run "build" to build the driver - - -Building with Mingw32 and ReactOS include files: - - - Run "make ne2000" FROM THE ReactOS ROOT DIRECTORY to build the driver