Xinu7/man/man4/ether.4

.TH ETHER 4
.SH NAME
ether \- standard 10Mbps Ethernet network interface device driver (type eth)
.SH SYNOPSIS
.nf
.B #include <deqna.h>
.B #include <ether.h>
.sp
.B read(device buffer, length)
.B write(device, buffer, length)
.B init(device)
.br
.SH DESCRIPTION
.PP
The \f2eth\f1 device driver provides input and output
for a 10 Mbps Ethernet local area network.
The standard Xinu device name for Ethernet devices is \f2ETHER\f1.
.PP
Implemented on a Digital Equipment Corporation DEQNA
(Digital Equipment Q-Bus Network Adapter),
the \f2eth\f1 driver handles DMA input and output
at the physical network level, transmitting complete
frames between user processes and the device.
.PP
The driver honors the following operations:
.TP
.B read(device buffer, length)
Reads one frame into \f2buffer\f1, copying no more than
\f2length\f1 characters.
It returns the length of the frame read; the count includes
the 14-octet header.
.TP
.B write(device, buffer, length)
Writes a frame of \f2length\f1 characters found in \f2buffer\f1.
It returns \f2OK\f1 if the frame was acceptable, \f2SYSERR\f1
otherwise.
It it important to note that \f2buffer\f1 must specify the address of
a valid buffer allocated from GETBUF(2), and that the driver does not
copy the contents of the buffer.
The call to \f2write\f1 will return once output has been started,
but the buffer will be in use until the device finishes.
The driver calls FREEBUF(2) to dispose of the buffer once the device
finishes using it.
.TP
.B init(device)
Initializes the device and driver, including DEQNA setup packet
processing.
The driver sets the device to accept only those packets addressed
directly to the devices' physical address and broadcast packets
(all 1's address).
.SH NOTES
Although the DEQNA supports chaining back-to-back operations
on both input and output, the driver forces a context switch
and a new call from READ(2) or WRITE(2) to restart I/O, and
depends on the hardware to buffer packets from the Ethernet.