Itsy Pocket Computer

Ethernet/USB Host Driver for Win98/Win2k Platform

Summary

The host driver is loosly based on the NT2000 DDK sample driver for the Intel EtherExpressTM. The driver is an NDIS 5 deserialized miniport driver, and depending on who you talk to may or may not be an intermeddiate driver. Some people believe an intermediate driver must export an NDIS upper layer and a protocol lower layer, where we like a NIC driver have just and NDIS upper layer the difference being that this driver talks WDM to the USB subsystem rather than directly to hardware. Microsoft are not clear on this and I have come across conflicting views in their DDK documentation.

Build Environment

 

Building The Sample

Run the build -cZ command from this directory to build the sample. That creates the binary itsyeth.sys

TOOLS

The NDISTEST tool can be used to test some of the features of this driver. Note that this is not a production driver, and is not intended to replace the driver in the Windows® 2000 build. I am yet to use this against Itsy.

CODE TOUR

Due to the MS header file implementation which

Files

Description

itsyeth.htm

The documentation for this sample (this file)

Sources

The generic file for building the code sample

NetItsy.inf

The .inf file for installing the code sample

itsyeth.rc

The code's resource file.

itsyethdbg.h

Debug code definitions and macros

itsyethpr.h

Function prototypes

itsyethsw.h

Internal data structures and macros

precomp.h

Precompile header

equates.h

 

itsywdm.h

 

parse.c

Registry access routines

itsyeth.c

DriverEntry, Initialization, Reset and Halt routines

request.c

Routines to handle NDIS Requests

itsyethwdm.c

 

itsyethpnp.c

 

itsyethpwr.c

 

itsyethdbg.c

 

Send.c

Send side processing

Programming Tour

Some of the features illustrated in this driver are listed below, along with the files that contain the feature.

  1. NDIS 4: NdisSendPackets(); multiple packets per send request are handled (see Send.c).
  2. NDIS 4: NdisMIndicateReceivePacket(); multiple packets per receive indication (see Interrup.c).
  3. NDIS 4: When the adapter driver begins to run out of receive memory, NdisMAllocateSharedMemory() is called to allocate more shared memory for receive buffers (see Interrup.c and others).
  4. NDIS 4: NdisMRegisterAdapterShutdownHandler() is called at initialization time to make sure the adapter has a function that stops generating interrupts and receiving packets into main memory (see D100.c).
  5. NDIS 4: Media disconnect/connect indications are supported. This allows the driver to tell NDIS when the adapter has lost or regained link (see Request.c and D100.c).
  6. NDIS 4: Packet priority support is stubbed in comments in this driver (see Send.c).
  7. NDIS 5: This driver is a deserialized miniport, meaning it handles all its own spinlocks. This driver only implements a simple method of using spinlocks: it has a NdisAcquireSpinlock() at every entry point and a NdisReleaseSpinlock() at the return from those entry points. The locks could be done more efficiently in a production driver by moving the locking closer to the resources in the driver that need to be accessed with atomic operations.
  8. NDIS 5: WMI: There are several examples of using GUIDs to advertise custom driver SETs and QUERIES. The E100b.mof and Request.c files implement the functionality, the Makefile.inc file compiles the .mof file, and the D100.rc file includes the .mof data into the driver resource area.
  9. NDIS 5: TCP Checksum Offload is stubbed in comments (see Send.c and Request.c).
  10. NDIS 5: Power Management for ACPI adapters is stubbed and commented (see Request.c).

Top of page