Commit graph

242 commits

Author SHA1 Message Date
Casper Hornstrup 59f81f9539 2004-11-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/lib/ip/network/arp.c: Assert certain conditions.
	* drivers/lib/ip/network/loopback.c: Ditto.
	* drivers/lib/ip/network/neighbor.c: Ditto.
	* drivers/lib/ip/transport/tcp/tcp.c: Ditto.
	* drivers/net/tcpip/datalink/lan.c: Ditto.
	* drivers/net/tcpip/datalink/loopback.c: Ditto.
	* drivers/net/tcpip/include/debug.h (ASSERT_KM_POINTER): Define.
	* drivers/lib/ip/transport/tcp/if.c: Remove disabled code.
	* drivers/net/afd/afd/main.c (AfdDispatch): Print known unimplemented
	IOCTLs.
	* drivers/net/tcpip/include/precomp.h: Include roscfg.h.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Pass the right
	connection object to TCPListen.
	* drivers/net/tcpip/tcpip/mocklock.c: Fix some assertions.

svn path=/trunk/; revision=11680
2004-11-16 18:07:58 +00:00
Eric Kohl 43d65f019d - Make WrapperConfigurationContext a pointer to a WRAPPER_CONTEXT structure.
- Use correct bus number in NtImmediateReadPciSlotInformation, NdisImmediateWritePciSlotInformation, NdisReadPciSlotInformation and NdisWritePciSlotInformation.

svn path=/trunk/; revision=11676
2004-11-16 16:21:09 +00:00
Art Yerkes 28bfa5fcdd Implemented non-blocking recv and recvfrom.
Fixed address pass-through in afd.
Fixed some address cruft in udp and datagram regarding incoming
datagrams.

svn path=/trunk/; revision=11671
2004-11-15 18:24:57 +00:00
Art Yerkes 323b7c4460 UDP working.
svn path=/trunk/; revision=11657
2004-11-14 19:45:16 +00:00
Art Yerkes 11070b8093 Fixed bug in ne2000 driver, re: copying ethernet frame header when only
payload should be copied in MiniportTransferData.

Changed tcpip to not consider the ethernet header anywhere above
ProtocolReceive.

svn path=/trunk/; revision=11650
2004-11-14 10:13:17 +00:00
Art Yerkes 9a7c38e472 lib/ip:
transport/tcp/* remove some spew, eliminate deadlock condition (calling afd
  with socket locked).
 network/router.c -- GvG noticed a wrong condition at line 153:
  This code used to stop when finding a matching bit, not a non-matching one.
net/tcpip:
 makefile: change order of .a files.  Could break compilation before under
  the right circumstances.
 turn off some spew
 datalink/lan.c:
  NdisTransferData does not count header size when figuring out how many bytes
  to copy.  Most of the tcpip code does, so we do something wierd here.  We
  must fix this later in a better way.

svn path=/trunk/; revision=11636
2004-11-13 00:06:33 +00:00
Art Yerkes 1eb22067d1 Small DBG related patches.
svn path=/trunk/; revision=11626
2004-11-12 09:27:02 +00:00
Art Yerkes dea7f87980 Prevent some deadlock scenarios by unlocking the FCB while calling into
tcpip.sys.

svn path=/trunk/; revision=11625
2004-11-12 07:34:56 +00:00
Art Yerkes 60a319ecaa Cleaing in receive: fixed one bugcheck.
Removed much small allocation cruft (20 byte or less objects)

svn path=/trunk/; revision=11602
2004-11-09 09:39:38 +00:00
Art Yerkes 8a640a70d2 Removed remaining kernel imports from ip lib.
Removed unneeded precomp.h from drivers/lib/ip.
Removed some memtrack and other spew.
Removed datagram send pipe part, and accompanying address file queue.
Simplified send pipe (major changes):
- Neighbor is solely responsible for firing normal ip datagrams to the peer.
- Transmit is the only place normal ip datagrams are passed to neighbor from.
- Simplified fragmentation code.
- Made callbacks explicit and always called in neighbor and transmit.
- Clarified ownership of transmitted NdisPacket.
- Ditto IPPackets here and in icmp.
- PC(Packet)->DLComplete is *only* used by lan.c and loopback.c
- Simplified loopback send mechanism
Added the beginnings of a test suite

svn path=/trunk/; revision=11582
2004-11-07 20:37:21 +00:00
Casper Hornstrup e89808b094 2004-10-28 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tests/setup.c: Include windows.h.
	* lib/gdiplus/tests/setup.c: Ditto.
	* lib/kernel32/tests/setup.c: Ditto.
	* lib/ws2_32/tests/setup.c: Ditto.
	* subsys/win32k/tests/setup.c: Ditto.
	* ntoskrnl/tests/setup.c: Ditto.
	* ntoskrnl/include/ntoskrnl.h: Include test.h.
	* ntoskrnl/mm/virtual.c (NtLockVirtualMemoryInternal): New function.
	(NtLockVirtualMemory): Use NtLockVirtualMemoryInternal.
	* ntoskrnl/tests/Makefile (TARGET_CFLAGS): Add -I../include.
	* ntoskrnl/tests/stubs.tst: Remove stubs for functions in libgcc.
	* regtests/shared/regtests.h: Make independent of windows.h.
	* tools/helper.mk (run): Link with libgcc.
	* tools/regtests.c (EXESTUB): Include windows.h.
	* ntoskrnl/include/internal/test.h: New file.
	* ntoskrnl/tests/tests/VirtualMemory.c: Ditto.

svn path=/trunk/; revision=11466
2004-10-28 19:01:59 +00:00
Casper Hornstrup 6003c5cb06 2004-10-24 Casper S. Hornstrup <chorns@users.sourceforge.net>
* config (REGRESSIONTESTS): Remove.
	* tools/config.mk: Update.
	* lib/kernel32/misc/dllmain.c: Update.
	* drivers/net/tcpip/tests/Makefile (TARGET_OBJECTS): Add setup.o.
	* lib/gdiplus/tests/Makefile (TARGET_OBJECTS): Ditto.
	* lib/kernel32/tests/Makefile (TARGET_OBJECTS): Ditto.
	* lib/ws2_32/tests/Makefile (TARGET_OBJECTS): Ditto.
	* subsys/win32k/tests/makefile (TARGET_OBJECTS): Ditto.
	* regtests/shared/regtests.h (SetupOnce, _SetupOnce): Declare.
	(DISPATCHER): Rename to _Dispatcher.
	* lib/gdiplus/tests/tests/test-1.c: Update.
	* lib/kernel32/tests/tests/CreateFile.c: Ditto.
	* lib/ws2_32/tests/tests/WinsockEvent.c: Ditto.
	* subsys/win32k/tests/tests/eng-mem-1.c: Ditto.
	* tools/helper.mk: Be quiet when building tests.
	* tools/regtests.c: Remove unused code.
	* drivers/net/tcpip/tests/setup.c: New file.
	* lib/gdiplus/tests/setup.c: Ditto.
	* lib/kernel32/tests/setup.c: Ditto.
	* lib/ws2_32/tests/setup.c: Ditto.
	* subsys/win32k/tests/setup.c: Ditto.

svn path=/trunk/; revision=11414
2004-10-24 12:39:54 +00:00
Casper Hornstrup eae828b789 2004-10-23 Casper S. Hornstrup <chorns@users.sourceforge.net>
* Makefile: Support regtests_implib.
	* rules.mak (REGTESTS_PATH): Define.
	* drivers/net/tcpip/makefile (TARGET_BUILDENV_TEST): Remove.
	* drivers/net/tcpip/tests/Makefile: Update.
	* lib/gdiplus/tests/.cvsignore: Ditto.
	* lib/gdiplus/tests/Makefile: Ditto.
	* lib/kernel32/tests/Makefile: Ditto.
	* lib/kernel32/tests/stubs.tst (HeapAlloc, HeapFree): Add.
	* lib/ws2_32/makefile (TARGET_REGTESTS): Define to yes.
	* regtests/Makefile: Update.
 	* regtests/shared/regtests.c (_alloca): Define.
	(FrameworkGetHook): Move to here.
 	* regtests/shared/regtests.h (_AssertTrue, _AssertFalse): Define.
 	(_GetModuleHandleA, _GetProcAddress, _LoadLibraryA): Define.
 	(FrameworkGetExportedFunctionNameInternal): Define.
 	* subsys/win32k/tests/makefile: Update.
 	* tools/helper.mk: Create dependencies.
 	* tools/regtests.c: Move FrameworkGetHook; Support forwarded exports.
	* lib/ws2_32/tests: New directory.
	* lib/ws2_32/tests/.cvsignore: New file.
	* lib/ws2_32/tests/Makefile: Ditto.
	* lib/ws2_32/tests/stubs.tst: Ditto.
	* lib/ws2_32/tests/tests: New directory.
	* lib/ws2_32/tests/tests/.cvsignore: New file.
	* lib/ws2_32/tests/tests/WinsockEvent.c: New file.
	* regtests/regtests: New directory.
	* regtests/regtests/.cvsignore: New file.
	* regtests/regtests/Makefile: Ditto.
	* regtests/regtests/regtests.c: Ditto.
	* regtests/regtests/regtests.def: Ditto.

svn path=/trunk/; revision=11406
2004-10-23 21:05:12 +00:00
Filip Navara 985184b134 - Add _hooks.c and _stubs.S to list of ignore files.
svn path=/trunk/; revision=11404
2004-10-23 17:39:51 +00:00
Casper Hornstrup 9af4f499f3 2004-10-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
* lib/kernel32/makefile (TARGET_BUILDENV_TEST): Set to yes.
	* lib/kernel32/tests/Makefile: New target run.
	* lib/kernel32/tests/tests/file-1.c: Remove.
	* lib/kernel32/tests/tests/CreateFile.c: New file.
	* lib/kernel32/tests/stubs.tst: New file.
	* lib/gdiplus/tests/tests/test-1.c: Update.
	* lib/gdiplus/tests/stubs.tst: Update.
	* lib/gdiplus/tests/Makefile: Update.
	* lib/tools/helper.mk: Better support for TARGET_BUILDENV_TEST.
	* tools/regtests.c: Terminate process after running tests.
	* regtests/shared/regtests.c (PerformTest): Increase buffer sizes.
	* regtests/Makefile: Update.
	* regtests/kmregtests/*: Remove.
	* regtests/kmrtint/*: Remove.
	* regtests/regtests/*: Remove.
	* regtests/win32base/*: Remove.
	* subsys/win32k/tests/tests/eng-mem-1.c: Update.
	* subsys/win32k/tests/stubs.tst: New file.
	* drivers/net/tcpip/tests/Makefile: Update.
	* drivers/net/tcpip/makefile: Update.
	* drivers/net/tcpip/stubs.tst: New file.
	* drivers/net/tcpip/tests/Makefile: Update.

svn path=/trunk/; revision=11321
2004-10-18 19:11:09 +00:00
Filip Navara fdfdfbe2d2 - Fix NdisMSynchronizeWithInterrupt.
svn path=/trunk/; revision=11310
2004-10-17 10:15:07 +00:00
Filip Navara 6815a62066 - Fix cut & paste mistake (s/NdisDprAcquireSpinLock/NdisDprReleaseSpinLock/).
- Fix values passed to NdisMRegisterInterrupt.

svn path=/trunk/; revision=11309
2004-10-17 10:15:02 +00:00
Filip Navara 33a12b714a - Fix IRQL restrictions.
svn path=/trunk/; revision=11303
2004-10-17 01:59:36 +00:00
Filip Navara 921ff5c94d - Add comment to NdisMRegisterIoPortRange about the meaning of InitialPort parameter and pass the bus number to HalTranslateBusAddress.
svn path=/trunk/; revision=11302
2004-10-17 01:59:18 +00:00
Filip Navara d788739c0e - Compile with W32API headers.
- Add multicast support.
- Add media state detection support.
- Protect the adapter context with spinlock and move code talking to card to inside NdisMSynchronizeWithInterrupt calls where necessary.

svn path=/trunk/; revision=11301
2004-10-17 01:55:54 +00:00
Gé van Geldorp 4221b60000 - Centralize definition of version resource
- Give DLLs a high version number, so installers won't overwrite them

svn path=/trunk/; revision=11297
2004-10-16 20:27:43 +00:00
Filip Navara 2cc81267e3 - Handle all required OID requests.
- Fix handling of OID_GEN_MAXIMUM_FRAME_SIZE and OID_GEN_DRIVER_VERSION.
- Generate error statistics.

svn path=/trunk/; revision=11288
2004-10-13 18:50:09 +00:00
Filip Navara f321359e16 - Fix receive to work on VMware emulated adapters. We need to set busmaster bit on PCI command register in order to get packets. Otherwise we just get "missing frame" error and the ring buffer remains empty.
- Indicate receive completition.
- Implement basic packet transmitting.
- Don't read slot number from registry and report itself as NDIS 5.0 miniport.
- Fix nasty bugs in halt code path (incorrect assignment and wrong parameters to NdisMFreeSharedMemory calls).

svn path=/trunk/; revision=11270
2004-10-11 15:03:13 +00:00
Filip Navara 0f86ec1497 Don't use NdisTransferData if the whole packet is contained in the header+lookup buffer.
svn path=/trunk/; revision=11266
2004-10-10 22:38:22 +00:00
Filip Navara 02b3928237 Fix printing of packet contents to really print the contents instead of destroying them.
svn path=/trunk/; revision=11265
2004-10-10 21:06:13 +00:00
Filip Navara 1d16f49bbf - Fix debug message.
svn path=/trunk/; revision=11259
2004-10-10 17:23:13 +00:00
Filip Navara 33b2ec789a - Fix the NdisMEthIndicateReceive macro and ETH_RCV_INDICATE_HANDLER prototype to be binary compatible with Windows (R).
- Modify NDIS accordingly.

svn path=/trunk/; revision=11258
2004-10-10 17:16:42 +00:00
Filip Navara 0a6aa71bb4 - Attach NDIS miniport devices to the device stack.
- Gain the bus type and slot number using IoGetDeviceProperty from the PnP stack.
- Read the registry values for NDIS miniports from the correct place. See www.plasmic.com/~vizzini/ntnetarch.html for details.
- Update NdisReadPciSlotInformation/NdisWritePciSlotInformation to use the adapter slot information.

svn path=/trunk/; revision=11251
2004-10-09 18:17:08 +00:00
Art Yerkes 068cb50dec Added makefile dependency in both dirs, and proper relinking rule for
oskittcp and ip.

svn path=/trunk/; revision=11222
2004-10-08 01:28:32 +00:00
Art Yerkes 5be7877f22 some formatting and prototype changes
memtrack on
moved timer dpc out of libip
added work item for ip timer callback to work at passive level

svn path=/trunk/; revision=11216
2004-10-07 15:04:45 +00:00
Art Yerkes 7c750ecdd6 Sorry jimtabor and rcampbell, it turns out that ip.a was not getting cleaned
and you guys were using an old one.  sedwards helped me figure that out.
I've been cleaning these dirs explicitly since i'm working in them.

This should fix the clean for those.

svn path=/trunk/; revision=11212
2004-10-07 04:47:42 +00:00
Art Yerkes 706ff78e48 Removed unneeded DriverObject parameter to IPStartup.
svn path=/trunk/; revision=11183
2004-10-04 18:31:40 +00:00
Art Yerkes 8eb5ca6ffa Final propogation of TDI_CONNECTION_INFORMATION/TRANSPORT_ADDRESS changes.
svn path=/trunk/; revision=11175
2004-10-03 21:44:43 +00:00
Art Yerkes bab3b21d32 Propogating TDI address changes.
svn path=/trunk/; revision=11174
2004-10-03 21:16:31 +00:00
Art Yerkes fc4b179d93 New file buffer.c which contains NDIS_BUFFER and NDIS_PACKET routines.
svn path=/trunk/; revision=11172
2004-10-03 20:39:19 +00:00
Art Yerkes 5394560307 Fixed UDP protocol.
Leaned interface between tcpip and ip lib to not include ndis buffers and
such, as well as datagram request structs.  This both eliminates code
setting up these structs as well as making use of ip lib easier from userland.
Moved ndis buffer routines to tcpip/buffer.c.  They are a bit separate from
the neutral routines functions.

svn path=/trunk/; revision=11171
2004-10-03 20:38:48 +00:00
Art Yerkes a52618ca99 Fixed use of TA_ADDRESS in favor of TRANSPORT_ADDRESS. This still confuses
me.
write, read: Handle errors correctly.

svn path=/trunk/; revision=11170
2004-10-03 20:36:46 +00:00
Art Yerkes 7b91f0c3fb Fixed makefile. Wrong name for ip.a
svn path=/trunk/; revision=11132
2004-09-30 16:30:43 +00:00
Art Yerkes 0bccb9dbb0 Most files moved to linkable library drivers/lib/ip, which can be linked
from kernel land, or from userland with the help of drivers/lib/undis.
Hopefully, I'll be able to simulate a sufficient environment with undis
that we'll be able to test most problems with the ip system in userland.
This follows my general priniciple of getting most interesting code into
a place where we can really examine it and work with it.  The interface
to the ip library is still a bit raw.  I was hoping to do a better job
of isolating it and especially digging nt kernel dependencies out into
the remaining framework files (tcpip/dispatch.c, tcpip/fileobjs.c), but
it was taking too long.  Hopefully I can return to that later.

svn path=/trunk/; revision=11127
2004-09-30 06:00:42 +00:00
Art Yerkes 4ec1a851b9 Changes to the interface to componentized ip library. This commit is where
the ambiguously linked library starts being used in km.  There are further
cleanups i need to do, but hopefully having this checked in will help others
who are eager to help work on it.

svn path=/trunk/; revision=11126
2004-09-30 05:44:10 +00:00
Art Yerkes e1741d6626 Use the recursive mutex to lock the TCP.
svn path=/trunk/; revision=11057
2004-09-25 21:32:56 +00:00
Art Yerkes 3a4c09d746 More experimental detritus. Sorry about that.
svn path=/trunk/; revision=11055
2004-09-25 21:08:53 +00:00
Art Yerkes 91fea9194d Previously checked in with some detritus from some experimental rtl stuff.
Fixed.

svn path=/trunk/; revision=11052
2004-09-25 20:38:46 +00:00
Art Yerkes 3725308f3e Fixed connection locking in tcp.c
Added a work item in lan.c re: dpc callback from the adapter.  This keeps
us from needing mdl functions at dpc level.
Track IRPs to be completed with memtrack.

svn path=/trunk/; revision=11051
2004-09-25 20:24:00 +00:00
Art Yerkes d7a6bf353f Also wait in the success, no data case in socket state change.
svn path=/trunk/; revision=11022
2004-09-24 00:56:39 +00:00
Art Yerkes 2c75d67c33 Fix send function as well to properly deallocate the irp on failure on
MmProbeAndLockPages.

svn path=/trunk/; revision=11021
2004-09-24 00:51:31 +00:00
Art Yerkes b0f758cf33 tcp: print error when we can't allocate a bucket.
event: Don't report eof if we have bytes to deliver still.
       Made a mistake moving statuses around.  Requeue the request on
       STATUS_PENDING.

svn path=/trunk/; revision=11016
2004-09-23 20:51:46 +00:00
Art Yerkes e91d1416ab Write: print bytes returned so we can see it.
Read : notify ourselves that the buffer is empty and reset the pointers.
Tdi  : since the handler part is an inner function, don't return from it
       but instead set Status and return afterward.

svn path=/trunk/; revision=11015
2004-09-23 20:48:40 +00:00
Art Yerkes d774499bf8 event.c: Don't infinite loop while completing a zero-length read.
tcp.c: Correctly pass on length in recv.

svn path=/trunk/; revision=10999
2004-09-23 14:16:27 +00:00
Art Yerkes 51580f3182 Fixes: Lock does not need to acquire a spinlock in the non-passive-level
case because we can't contend with outselves in passive level.
Realized subtle bug in select.

Select needs a referenced file object rather than a handle.  Will change
this when i get time.

svn path=/trunk/; revision=10993
2004-09-23 06:42:16 +00:00