

KSZ8841/2 Windows NDIS Drivers Build Instructions


Overview

This KSZ8841/2 PCI Ethernet controller driver code is built using Windows 2000
DDK.  It also can be built under WinCE 5.0 DDK if the files makefile.wce and
sources.wce are used.  Rename them to makefile and sources.  The WinCE driver
has been tested.  For Windows 2000 DDK the files can be put anywhere; for
WinCE they need to be located under a certain directory:
        WINCE\public\common\oak\drivers\netcard

The KSZ8841 PCI driver is built if DEF_KS8841 is defined in sources, and the
driver name is ksz8841_pci.sys; the KSZ8842 PCI driver is built if DEF_KS8842
is defined, and the driver name is ksz8842_pci.sys.  For your convenience,
there are two files called sources.41 and sources.42 that can be copied to
sources to build either driver.

The catalog file ksz884x.cat is a dummy one.  The real one needs to be obtained
from Microsoft by submitting the driver for verification.  For this reason the
driver may not be installed under Windows XP or above.


Windows 2000 Driver Installation

The subdirectory driver contains the KSZ8841/2 PCI Ethernet controller
drivers.  Upon detection of new PCI hardware Windows will prompt to install a
driver.  Point to this location to indicate the KS884X.inf installation file.
Confirm everything to install the driver.


Windows 2000 Driver Build

The subdirectory PCI contains the KSZ8841/2 PCI driver source code.  The file
sources contains all the definitions to build the KSZ8841 or KSZ8842 driver.
The only thing to change is to define either DEF_KS8841 or DEF_KS8842, or copy
the file sources.41 or sources.42 to sources.

The source files can be put anywhere in the hard drive.  Open either a Windows
2000 DDK Checked Build Environment or Free Build Environment command line
window and type "build -c" to generate the driver ksz8841_pci.sys or
ksz8842_pci.sys in objchk\i386 or objfre\i386 subdirectory.

The subdirectory ISA contains the KSZ8841/2 ISA driver source code.  The
driver has not been tested because there are no KSZ8841/2 ISA boards.  The file
sources contains all the definitions to build the KSZ8841 or KSZ8842 driver.
The only thing to change is to define either DEF_KS8841 or DEF_KS8842, or copy
the file sources.41 or sources.42 to sources.

The source files can be put anywhere in the hard drive.  Open either a Windows
2000 DDK Checked Build Environment or Free Build Environment command line
window and type "build -c" to generate the driver ksz8841_isa.sys or
ksz8842_isa.sys in objchk\i386 or objfre\i386 subdirectory.


Windows XP Driver Build

Follow the instructions above for Windows 2000 Driver Build but the sources
file needs to be modified first to build Windows XP driver as Windows XP uses
NDIS 5.1.  In the sources file search for NDIS50_MINIPORT and change it to
NDIS51_MINIPORT.


Windows CE Driver Build

The subdirectory PCI contains the KSZ8841/2 PCI driver source code.  The
source files need to be copied to a directory under
\WINCE\PUBLIC\COMMON\OAK\DRIVERS\NETCARD.  Rename sources.wce to sources and
makefile.wce to makefile.  The file sources contains all the definitions to
build the KSZ8841 or KSZ8842 driver.  Open the Windows CE Command Prompt with
all the Windows CE definitions set properly.  Type "build -c" to generate the
driver ksz8841.lib or ksz8842.lib located in
\WINCE\PUBLIC\COMMON\OAK\LIB\X86\RETAIL.

The subdirectory ISA contains the KSZ8841/2 PCI driver source code.  The
source files need to be copied to a directory under
\WINCE\PUBLIC\COMMON\OAK\DRIVERS\NETCARD.  Rename sources.wce to sources and
makefile.wce to makefile.  The file sources contains all the definitions to
build the KSZ8841 or KSZ8842 driver.  Open the Windows CE Command Prompt with
all the Windows CE definitions set properly.  Type "build -c" to generate the
driver ksz8841.lib or ksz8842.lib located in
\WINCE\PUBLIC\COMMON\OAK\LIB\X86\RETAIL.

There is another sources file named sources.wce.platform that is used to
build driver in DLL format to run under a platform.  The files project.bib,
project.reg, KSZ8841.reg, and KSZ8842.reg show the settings that need to be put
in the system build image to load the driver.


Driver Modifications

The KSZ8841/2 drivers are Windows NDIS drivers so they follow the NDIS model,
making it easier to update.  The drivers are separated into two parts, one
platform independent and the other platform specific.  In this case the
platform specific part is the NDIS driver code.  All NDIS related functions
are prefixed with Miniport.  They are grouped in the following files:

NdisDriver.c is the main driver entry point.  It initializes the NDIS
wrapper code and makes sure the driver is started and stopped properly.  For
Windows CE it may be required to modify this file to start the driver
properly.

NdisDevice.c contains basic functions to handle the NDIS calls.  It may also
be required to modify this file to obtain the correct resources under Windows
CE.

NdisISR.c contains the interrupt handler.  It has other functions to handle
receiving.  The NDIS functions are MiniportHandleInterrupt, MiniportISR, and
MiniportReturnPacket.

NdisSend.c contains functions to handle transmitting.  The NDIS functions are
MiniportSend and MiniportSendPackets.

NdisOid.c contains functions to handle OID requests.  The NDIS functions are
MiniportQueryInformation and MiniportSetInformation.

The rest of the code are platform independent.  It is not necessary to modify
them for use in Windows environment.  However the code in the files target.c
and target.h may be tweaked to perform better in different environments.
