EthernetFace.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
HGM on: September 5, 1980 12:41 AM)
Andrew Birrell May 6, 1983 11:22 am
Russ Atkinson (RRA) January 29, 1985 0:48:30 am PST
Doug Wyatt, February 26, 1985 5:27:14 pm PST
Hal Murray, February 1, 1986 6:29:41 pm PST
Processor-independent interface for 10 MB ethernet.
EthernetFace: CEDAR DEFINITIONS = {
BYTE : TYPE = [0..100H);
GetNextDevice: PROC [Handle] RETURNS [Handle];
Return handle of next device in physical order (starts and ends with nullHandle).
AddCleanup: PROC [Handle];
Add the device cleanup procedure which is used to turn off an Ethernet controller around world swaps (see DeviceCleanup.mesa). Extra calls to AddCleanup are ignored.
TurnOn: PROC [handle: Handle, inInterrupt, outInterrupt: WORD];
TurnOff: PROC [handle: Handle];
Turn on/off the device associated with this DeviceHandle. Calling TurnOn when the device is already on may forget any operations currently in progress. Extra calls to TurnOff are harmless. All IOCBs in progress are forgotten.
SetPromiscuous: PROC [handle: Handle, promiscuous: BOOL];
TRUE => Grab every packet on the wire.
FALSE => revert to normal mode. TurnOn also sets normal mode.
SetOutputDelay: PROC [handle: Handle, microseconds: CARDINAL];
Normally, the microcode waits 1/2 ms before sending another packet to give Altos a chance to restart their hardware. This is critical when talking to an IFS. It is significant only if you are REALLY trying to go fast.
QueueOutput: PROC [handle: Handle, buffer: LONG POINTER, bytes: NAT, iocb: IOCB];
QueueInput: PROC [handle: Handle, buffer: LONG POINTER, bytes: NAT, iocb: IOCB];
Queue the buffer for transmit or receive. A (different) control block must be passed in with each call for the private use of the head. cb should be a pointer to a block of EtherNetFace.controlBlockSize words. It must be allocated within the first 64K and must be quad word aligned. The data buffer must be quad word aligned and less than 32K words long. When GetStatus[cb] returns anything other than pending, both the control block and the data buffer are available for reuse.
MarkKilled: PROC [iocb: IOCB];
Mark the status of this packet as killedByDriver. This is only valid IFF this packet is not on the either the input or output chain, for example, because TurnOff was recently called.
GetStatusAndLength: PROC [iocb: IOCB] RETURNS [status: Status, bytes: NAT];
Returns the status of the recv packet associated with this iocb. If status#pending, bytes is the number of bytes that arrived. See the comments on Status below.
GetStatusAndCollisions: PROC [iocb: IOCB] RETURNS [status: Status, collisions: NAT];
Returns the status of the transmit packet associated with this iocb. If status#pending, collisions is the number of collisions this packet encountered. See the comments on Status below.
GetPacketsMissed: PROC [Handle] RETURNS [CARDINAL];
Returns the number of input packets missed because a buffer was not ready.
Handle: TYPE [2];
Status: TYPE = {
pending,
ok,
overrun, -- Input data arrived when FIFO was full
underrun, -- Output FIFO went empty before end of packet was set
packetTooLong, -- Input packet didn't fit into buffer
tooManyCollisions, -- More than 16 attempts to transmit the same packet
crc,
crcAndBadAlignment,
badAlignmentButOkCrc,
killedByDriver,
otherError
};
Note: The error conditions are an open ended set to allow a smart driver to collect statistics. Thus new error conditions may be added to allow more sophisticated data collection, so a driver should not get upset if it encounters a strange error status that it does not understand. Dumb drivers should only check for pending or ok and consider everything else as an error.
IOCB: TYPE = LONG POINTER TO ControlBlockRecord;
ControlBlockRecord: TYPE;
controlBlockSize: READONLY CARDINAL;
nullHandle: READONLY Handle;
hearSelf: READONLY BOOL;
}.