home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
pcc
/
v08n03
/
netwrk.exe
/
WDPOST.ZIP
/
WDPOST.TAR
/
wdpost.dir
/
sample.drv
/
readme.doc
< prev
next >
Wrap
Text File
|
1988-06-21
|
10KB
|
283 lines
WESTERN DIGITAL
WD8003-DRV
Sample Software Driver For
WD8003-Family LAN Adapter Boards
Version 3.0
6 April 1988
This driver shows examples of programming the Western Digital
WD8003 family of LAN adapter boards:
Ethernet WD8003E EtherCard PLUS
WD8003EBT EtherCard PLUS With Boot ROM Socket
WD8003ET/A EtherCard PLUS For Micro Channel (*)
StarLAN WD8003S StarCard PLUS
WD8003SH StarLink PLUS
WD8003ST/A StarCard PLUS For Micro Channel
This sample driver is part of an actual operating software
system. You may use it as is, modify it to suit your particular
environment, or simply use it as an example.
This driver also applies to new boards being developed in the
WD8003 family, such as 10 Mbps/Twisted Pair products, because
these all have the same software interface.
DISK CONTENTS
There is 1 .C file and 1 .ASM file in the MAC layer, with 2 .EQU
files and 5 .H files for definitions of variables, constants and
stucture:
MACMOD.C
WD8STAR2.ASM
FRAMEBLK.EQU
WD8STAR2.EQU
MAC.H
LANCONS.H
MACDEFS.H
MACCONS.H
VERSION.H
Files @6FC0.ADF (for WD8003ET/A) and @6FC1.ADF (for WD8003ST/A)
are sample .ADF files for use with Micro Channel adapter boards.
This document is contained in the file named README.DOC.
The MACMOD.C file contains routines written for the Microsoft
C compiler, Version 4.0.
DESCRIPTION OF FILES
MACMOD.C
This file contains the interface routines to the LLC
sublayer and to the LAN adapter board.
There are six routines in this C file:
1. init_lanc One time LAN controller set up routine
2. stop_mac Reset 8390, take it off line
3a. init_mac MAC sublayer initialization routine
3b. start_mac MAC sublayer start routine
4. M_DATArequest Handle a msdu from LLC layer
5. do_mac_queue Process rx_queue until it is empty
WD8STAR2.ASM
This asm file and the MACMOD.C file will handle the interface
between upper layer modules and the Western Digital WD8003
family adapter boards.
Since the Microsoft compiler is used, the public varibles
and routines must be named with a leading underscore.
There are six routines in this asm file:
1. _starlan_wait Initiate transmit wait loop count for
StarLAN to avoid transmitting back-to-
back packets from AT-class machines to
slower machines
2. _init_8390 Initiate 8390 Network Interface Controller
Initiate the LAN controller registers
3. _hdw_isr Services all LAN hardware interrupts
4. _cp_frm Copy a frame in system memory to tx buff
of shared memory
(argument: ptr to the frame buffheader)
5. _xmt_frm Initiate a tx of frame in shared memory
6. _rcv_frm Copy a rx frame from rx buff ring of
shared memory to system memory and put
it into rx_queue
(argument: ptr to the frame in ring)
FRAMEBLK.EQU
Defines the structure that is used to pass arguments to
public routines.
WD8STAR2.EQU
Provides constants and data definitions for WD8STAR2.ASM file
for WD8003 family adapter boards.
Contents: external definition
I/O port offset definition
I/O register mask definition
miscellaneous constants definition
structure definition
MAC.H
General header file for Media Access Control module for the
WD8003 family of adapter boards.
LANCONS.H
Machine-specific MAC module constants for the 8390-based
WD8003 adapter board family:
These constants are for a generic IBM PC (*).
MACDEFS.H
Media Access Control Sublayer module data structure
definitions for 8390-based WD8003 adapter board family.
MACCONS.H
MAC module constants for the 8390-based WD8003
adapter board family.
VERSION.H
Contains version level definitions.
MICRO CHANNEL ADAPTER INFORMATION
Earlier versions of the Sample Driver, up through Version 2.1,
did not provide for Micro Channel access. The following changes
were made for Micro Channel access; the same changes must be
made in any driver written for Western Digital WD8003-family LAN
adapter boards to ensure proper operation with Micro Channel
adapters:
1) Even Boundary Word Mode Access To Shared Memory
Western Digital Micro Channel boards support only word mode
access to their shared buffer memory, and the word access
must be on even boundaries. Routines using byte-mode access
to shared memory must be changed. Furthermore, the memory
enable bit pattern for the Micro Channel boards is
different (refer to the init_lanc routine in the MACMOD.C
module).
2) NIC 8390 Programming
Since the Micro Channel boards support only word-mode access,
the 8390 has to be programmed for word-wide DMA transfer.
This can be done by programming a "1" to the D0 bit of the
8390 Data Configuration Register (DCR).
3) Size Of Shared Memory
Instead of 8 Kbytes, the size of the shared memory on
Micro Channel adapter boards is 16 Kbytes. Therefore, the
size of the receive ring buffer must be adjusted.
4) Level-Sensitive Interrupt
To support the level-sensitive interrupt mechanism used
on all Micro Channel machines, the interrupt service routine
must not attempt to end the interrupt sequence (EOI command)
until it has reset the interrupt line of the 8390. The
8390 interrupt line can be reset by writing 0xFF to its
Interrupt Status Register (ISR).
Note also that WD8003-family adapter boards for conventional
PC busses support interrupt levels 2-7; Micro Channel
adapter boards support interrupt levels 3, 4, 10 and 15.
5) Machine Identification
The BIOS call
INT 15H, (AH) = C0H
can be used at a higher level to decide if the machine on
which the driver is running has a Micro Channel
implementation or not. The programmer must make this call
and set the _m_channel flag in WD8STAR2.ASM:
Micro Channel _m_channel = 1
PC/XT/AT _m_channel = 0
The Sample Driver tests this flag and adjusts its operation
accordingly.
To help programmers make the above changes (1-5) in other
drivers, each change has been marked in this Sample Driver as
follows:
/* %%1%%+ */ Beginning of change 1
- - -
/* %%1%%- */ End of change 1
Changes 2, 3, 4 and 5 are marked in a similar way. These
markings begin in column 1 of each line to make them easy to
find with a text editor.
To read the configuation of the Micro Channel adapter board
from the POS registers, please refer to the following two
documents:
"POS Implementation Procedure" on page 2-33
of the IBM Personal System/2 Model 50 And 60
Technical Reference (*)
Western Digital WD8003ET/A High Performance
Ethernet Adapter Board For Micro Channel
(Engineering Specification)
Western Digital supplies an ADF file with each Micro Channel
adapter board. Sample ADF files are located on the Sample
Driver disk:
@6FC0.ADF For WD8003ET/A (Ethernet)
@6FC1.ADF For WD8003ST/A (StarLAN)
WD8003 DIAGNOSTIC PROGRAM
The Western Digital WD8003 Diagnostic Program is available to
verify correct operation of WD8003-family adapter boards in a
network and to serve as a tool for testing software. It can be
used to generate test data as well as to echo data sent to it.
VERSION HISTORY
Following is information about changes that have been made
in this Sample Driver:
Version 3.0 (6 April 1988)
a) The compiler was changed from LATTICE C (Version 3.0)
to Microsoft C (Version 4.0). The major change was
the use of register variables for higher-speed
execution.
b) The _starlan_wait routine was added.
c) The provisions described above for Micro Channel
adapters were added.
NOTE
This Sample Driver Version 3.0 only addresses 8 Kbtye
shared RAM buffers on PC/XT/AT adapter boards. The
WD8003EBT Ethernet adapter contains 32 Kbytes of
buffer RAM, and can operate in either 8K or 32K mode.
The next version of this Sample Driver (Version 3.1,
approximately 1 May 1988) will adapt to both
sizes of RAM buffers automatically.
Version 2.1 (6 October 1987)
Widely distributed version that supported adapter boards
for conventional PC bus machines.
FACTORY TECHNICAL SUPPORT
For technical support on Western Digital LAN products, call:
(800) 638-5323 or
(714) 474-2033 ext. 4900
Fax: (714) 660-4909
TRADEMARKS
EtherCard PLUS, StarCard PLUS and StarLink PLUS are trademarks
of Western Digital Corporation.
(*) IBM and PC AT are registered trademarks, and PC XT, Micro
Channel and Personal System/2 are trademarks of International
Business Machines Corporation.