Cedar Nucleus: interface for 10MB ethernet
EthernetFace.mesa (last edited by: HGM on: September 5, 1980 1:21 AM)
Andrew Birrell May 6, 1983 12:59 pm
Last Edited by: Willie-Sue, April 5, 1984 12:12:56 pm PST
DIRECTORY
NSPilotSystem USING [HostNumber];
NewEthernetFace: DEFINITIONS =
BEGIN
Note: This in an Ethernet 2 face. See EthernetOneFace for the interface to the old Ethernet. We may also have to do something about multicasting one of these days.
GetNextDevice: PROCEDURE [DeviceHandle] RETURNS [DeviceHandle];
Return handle of next device in physical order (starts and ends with EthernetFace.nullDeviceHandle).
AddCleanup: PROCEDURE [DeviceHandle];
RemoveCleanup: PROCEDURE [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.)
HostNumber: TYPE = MACHINE DEPENDENT RECORD [SELECT type: * FROM
physical => [a: CARDINAL[0..32768), b: CARDINAL, c: CARDINAL],
multicast => [a: CARDINAL[0..32768), b: CARDINAL, c: CARDINAL],
ENDCASE];
A physical host number is assigned to an actual system element. A multicast host number names a logical group all wishing to receive a particular class of multicast packets.
TurnOn: PROCEDURE [device: DeviceHandle, host: NSPilotSystem.HostNumber, inInterrupt, outInterrupt: WORD, globalState: GlobalStatePtr];
TurnOff: PROCEDURE [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.
QueueOutput: PROCEDURE [device: DeviceHandle, buffer: LONG POINTER, length: CARDINAL, cb: ControlBlock];
QueueInput: PROCEDURE [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 buffer must have 11 in the low 2 bits (ie it starts one word before a quad word aligned buffer) 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: PROCEDURE [cb: ControlBlock] RETURNS [status: Status];
Returns the status of the packet associated with this control block. See the comments on Status below.
GetRetries: PROCEDURE [cb: ControlBlock] RETURNS [CARDINAL];
Returns the number of times the packet was retransmitted because of collisions.
GetPacketLength: PROCEDURE [cb: ControlBlock] RETURNS [CARDINAL];
Returns the length in words of a recently arrived packet.
GetPacketsMissed: PROCEDURE [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
lateCollision, -- Somebody stepped on the packet after a round trip time
crc,
crcAndBadAlignment,
badAlignmentButOkCrc, -- aka Dribble
spare1, spare2, spare3, 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;
EXPORTED variables
globalStateSize: READONLY CARDINAL;
controlBlockSize: READONLY CARDINAL;
nullDeviceHandle: READONLY DeviceHandle;
hearSelf: READONLY BOOLEAN;
END.
LOG
Time: September 5, 1980 12:16 AM By: HGM Action: Create from EthernetOneFace
Time: May 6, 1983 1:00 pm By: ADB Action: Minor changes for Cedar nucleus conversion
Time: April 3, 1984 10:11:51 am PST By: WSO Action: Minor changes for testing