-- File: DriverTypes.Mesa, Last Edit:
-- HGM February 23, 1980 3:38 PM
-- MAS April 17, 1980 1:15 PM

-- Copyright Xerox Corporation 1979, 1980

DriverTypes: DEFINITIONS =
BEGIN

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

DeviceType: TYPE = {
unknown, local, ethernet, sla, arpanet, packetradio, sp
are, spare1, spare2};



-- ENCAPSULATION

-- An instance of this record is the last thing in a Buffer before the real data block. The hardware transfers bits to/from it and then keeps going into the body of the packet. Note that the spare words are at the beginning of the record, not the end. That way the driver can easily skip ove
r them by just starting at the right place.


Encapsulation: TYPE = MACHINE DEPENDENT RECORD [
SELECT OVERLAID DeviceType FROM
local => [
localSpare1, localSpare2, localSpare3, localSpare4: WORD,
localHost: CARDINAL,
localType: LocalPacketType ],
ethernet => [
etherSpare1, etherSpare2, etherSpare3, etherSpare4: WORD,
-- Bits on the ether start here
etherDest, etherSource: Byte,
ethernetType: EthernetPacketType ],
sla => [
slaSpare1: WORD,
slaSpare2: [0..37777B],
slaHi: BOOLEAN,
slaBroadcast: BOOLEAN,
slaTimeQueued: CARDINAL,
slaSourceLine, slaDestHost: WORD, -- BEWARE: these don’t get sent
-- Bits on the line start here
slaType: SlaPacketType ],
arpanet => [
arpaSpare1, arpaSpare2, arpaSpare3, arpaSpare4: WORD,
arpanetControl: Byte, -- 0 for "Regular message"
arpanetHost: Byte, -- source if sending, dest if receiving
arpanetLink: ArpanetLink,
apranetZero: Byte ],
packetradio => [ -- Larry Stewart
prLength: WORD,
timer: CARDINAL,
prSequence: WORD,
prBroadcast: BOOLEAN,
numFrags, numFragsTrans, numFragsRcvd: [0..3],
first, second, third: BOOLEAN,
transCount: [0..77B],
prAddress: WORD,
prType: PRPacketType,
prSpare: Byte ],
spare => [
spare1, spare2, spare3, spare4, spare5, spare6: WORD ],
ENDCASE ];

ethernetBroadcastHost: Byte = 0;
ethernetPeekHost: Byte = 376B; -- DMT error info
ethernetBootLoaderHost: Byte = 377B;

-- offsets are in words
ethernetEncapsulationOffset: CARDINAL = 4;
ethernetEncapsulationBytes: CARDINAL = 4;
slaEncapsulationOffset: CARDINAL = 5;
slaEncapsulationBytes: CARDINAL = 2;
prEncapsulationOffset: CARDINAL = 5;
prEncapsulationBytes: CARDINAL = 2;
prEncapsulationWords: CARDINAL = prEncapsulationBytes/2;

LocalPacketType: TYPE = RECORD [WORD];
pupLocalPacket: LocalPacketType = [1000B];

EthernetPacketType: TYPE = RECORD [WORD];
peekData: EthernetPacketType = [402B];
breathOfLife: EthernetPacketType = [602B];
echoMeEthernetPacket: EthernetPacketType = [700B];
echoedEthernetPacket: EthernetPacketType = [701B];
pupEthernetPacket: EthernetPacketType = [1000B];

SlaPacketType: TYPE = RECORD [WORD];
routingSlaPacket: SlaPacketType = [1001B];
pupSlaPacket: SlaPacketType = [1000B];

ArpanetLink: TYPE = RECORD [Byte];
pupArpanetLink: ArpanetLink = [152];

PRPacketType: TYPE = RECORD [Byte];
pupPRPacketType: PRPacketType = [1B];
imAlivePRPacketType: PRPacketType = [3B];
bcastPupPRPacketType: PRPacketType = [4B];


-- DEBUGGING

Seal: TYPE = RECORD [WORD];
unsealed: Seal = [0];
queueSeal: Seal = [123001B];
bufferSeal: Seal = [123002B];
bufferPoolSeal: Seal = [123003B];

END.