-- File: AltoEthernetDefs.mesa, Last Edit: HGM January 5, 1980 11:15 AM

-- Copyright Xerox Corporation 1979, 1980

DIRECTORY
Mopcodes: FROM "Mopcodes" USING [zSTARTIO, zPOP],
BcplDefs: FROM "BcplDefs" USING [BcplLongInteger];

AltoEthernetDefs: DEFINITIONS =
BEGIN

Byte: TYPE = [0..377B];

-- ETHERNET MICROCODE INTERFACE
EthernetPost: TYPE = MACHINE DEPENDENT RECORD [
microcodeStatus: EthernetMicrocodeStatus,
hardwareStatus: EthernetHardwareStatus ];
EthernetMicrocodeStatus: TYPE = RECORD [Byte];
EthernetHardwareStatus: TYPE = RECORD [Byte];

EthernetDeviceBlockHandle: TYPE = POINTER TO EthernetDeviceBlock;
EthernetDeviceBlock: TYPE = MACHINE DEPENDENT RECORD [
postData: EthernetPost,
interruptBit: WORD,
wordsLeft: CARDINAL,
retransmissionMask: WORD,
inputBuffer: WordBlockDescriptor,
outputBuffer: WordBlockDescriptor,
hostNumber: WORD,
inputControlBlock: EthernetDeviceBlockHandle ]; -- Only used by Special MicroCode

WordBlockDescriptor: TYPE =
MACHINE DEPENDENT RECORD [count: CARDINAL, pointer: POINTER];

NIL0: POINTER = LOOPHOLE[0]; -- hardware end tests


EthernetNotPosted: EthernetPost = [[0],[0]];
inputDone: EthernetMicrocodeStatus = [0];
outputDone: EthernetMicrocodeStatus = [1];
inputBufferOverflow: EthernetMicrocodeStatus = [2];
outputLoadOverflow: EthernetMicrocodeStatus = [3];
zeroLengthBuffer: EthernetMicrocodeStatus = [4];
hardwareReset: EthernetMicrocodeStatus = [5];
interfaceBroken: EthernetMicrocodeStatus = [6];

hardwareAOK: EthernetHardwareStatus = [377B];
-- from bit 200 [unused,unused,inputDataLate,Collision
-- ,CRCbad,InputIssued,OutputIssued,packetNoEndOnWord]

StartIO: PROCEDURE [SioParameter] =
MACHINE CODE BEGIN Mopcodes.zSTARTIO END;
SioParameter: TYPE = RECORD [WORD];

-- Standard Ethernet board
standardEthernet: EthernetDeviceBlockHandle = LOOPHOLE[600B];
standardReset: SioParameter = [standardInput+standardOutput];
standardInput: SioParameter = [2];
standardOutput: SioParameter = [1];

-- Second Ethernet board
secondEthernet: EthernetDeviceBlockHandle = LOOPHOLE[630B];
secondReset: SioParameter = [secondInput+secondOutput];
secondInput: SioParameter = [2*4];
secondOutput: SioParameter = [1*4];

-- Third Ethernet board
thirdEthernet: EthernetDeviceBlockHandle = LOOPHOLE[642B];
thirdReset: SioParameter = [thirdInput+thirdOutput];
thirdInput: SioParameter = [2*
4*4];
third
Output: SioParameter = [1*4*4];

ShortenIocb: PROCEDURE [LONG POINTER] RETURNS [EthernetDeviceBlockHandle] =
MACHINE CODE BEGIN
Mopcodes.zPOP;
END;

ShortenData: PROCEDURE [LONG POINTER] RETURNS [POINTER] =
MACHINE CODE BEGIN
Mopcodes.zPOP;
END;


-- Stats info for GateControl
ethernetStatsReply: WORD = 1;
EtherStatsEntry: TYPE = RECORD [
version: WORD,
packetsSent: BcplDefs.BcplLongInteger,
badSendSatus: BcplDefs.BcplLongInteger,
overruns: BcplDefs.BcplLongInteger,
packetsRecv: BcplDefs.BcplLongInteger,
badRecvStatus: BcplDefs.BcplLongInteger,
inputOff: BcplDefs.BcplLongInteger,
loadTable: ARRAY [0..16] OF BcplDefs.BcplLongInteger ];
etherVersion: WORD = 1;

-- This is the way it is stored internally
EtherStatsInfo: TYPE = RECORD [
packetsSent: LONG CARDINAL,
wordsSent: LONG CARDINAL,
badSendSatus: LONG CARDINAL,
overruns: LONG CARDINAL,
packetsRecv: LONG CARDINAL,
wordsRecv: LONG CARDINAL,
badRecvStatus: LONG CARDINAL,
inputOff: LONG CARDINAL,
loadTable: ARRAY [0..16] OF LONG CARDINAL];
END.