EthernetOneFace.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
Processor-independent interface for 3MB ethernet.
EthernetOneFace: DEFINITIONS
= BEGIN
GetNextDevice: PROC [DeviceHandle] RETURNS [DeviceHandle];
Return handle of next device in physical order (starts and ends with nullDeviceHandle).
HostAddress: TYPE = [0..256);
GetEthernet1Address: PROC [DeviceHandle] RETURNS [net: [0..256), host: HostAddress];
Returns the net+host numbers from the switches (or Prom, or ...).
AddCleanup: PROC [DeviceHandle];
RemoveCleanup: PROC [DeviceHandle];
Add/delete the device cleanup procedure which is used to turn off an Ethernet controller around world swaps (see DeviceCleanup.mesa). For now, RemoveCleanup doesn't do anything, but the (leftover) cleanup proc is careful to avoid doing anything nasty. (Extra calls to AddCleanup are currently ignored.)
TurnOn: PROC [device: DeviceHandle, host: HostAddress,
inInterrupt, outInterrupt: WORD, globalState: GlobalStatePtr];
TurnOff: PROC [device: DeviceHandle];
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.
HostArray: TYPE = PACKED ARRAY HostAddress OF BOOL;
InputHosts: PROC [device: DeviceHandle, inputHosts: LONG POINTER TO HostArray];
Specifies one or more host addresses to be recognized by the input microcode. This function is not a substitute for TurnOn[...], which must be called first to initialize the ethernet interface. Depending on how the microcode is written, up to one additional packet may be received before the hosts specified by inputHosts take effect. Note that receipt of broadcast packets will be disabled unless inputHosts[0] is TRUE Other parameters required by the Ethernet interface must be specified in TurnOn[...]
InputHost: PROC[device: DeviceHandle, host: HostAddress];
This function returns to the single host (+broadcast) case for input packets.
MulticastCapabilities: PROC[device: DeviceHandle]
RETURNS
[canDo: BOOL, multicastsEnabled: BOOL];
canDo is TRUE if the implementation supports the InputHosts operations; multicastsEnabled is TRUE if canDo is TRUE and InputHosts has been called.
QueueOutput: PROC [device: DeviceHandle,
buffer: LONG POINTER, length: CARDINAL, cb: ControlBlock];
QueueInput: PROC [device: DeviceHandle,
buffer: LONG POINTER, length: CARDINAL, cb: ControlBlock];
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.
GetStatus: PROC [cb: ControlBlock] RETURNS [status: Status];
Returns the status of the packet associated with this control block. See the comments on Status below.
GetRetries: PROC [cb: ControlBlock] RETURNS [CARDINAL];
Returns the number of times the packet was retransmitted because of collisions.
GetPacketLength: PROC [cb: ControlBlock] RETURNS [CARDINAL];
Returns the length in words of a recently arrived packet.
GetPacketsMissed: PROC [DeviceHandle] RETURNS [CARDINAL];
Returns the number of input packets missed because a buffer was not ready.
DeviceHandle: TYPE[1];
GlobalStatePtr: TYPE = LONG POINTER;
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,
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.
ControlBlock: TYPE = LONG POINTER TO ControlBlockRecord;
ControlBlockRecord: TYPE;
globalStateSize: READONLY CARDINAL;
controlBlockSize: READONLY CARDINAL;
nullDeviceHandle: READONLY DeviceHandle;
hearSelf: READONLY BOOL;
END.
LOG
Time: February 4, 1980 5:48 PM By: McJones Action: Create file
Time: February 6, 1980 12:54 PM By: Dawson Action: Add interface items
Time: April 18, 1980 5:51 PM By: Murray Action: Giant Cleanup
Time: August 20, 1980 2:05 PM By: BLyon Action: renames EthernetFace to EthernetOneFace and added hearSelf
Time: September 5, 1980 12:11 AM By: HGM Action: fix typos, add ControlBlockRecord
Time: May 6, 1983 12:56 pm By: ADB Action: Minor edits for Cedar Nucleus conversion