DriverType.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
HGM January 7, 1981 10:21 PM
Hal Murray, April 30, 1986 7:18:29 pm PDT
DIRECTORY
Basics USING [BITAND],
Endian USING [HWORD],
IP USING [Address],
NS USING [broadcastHost, Host],
Pup USING [allHosts, Host];
DriverType: CEDAR DEFINITIONS
IMPORTS Basics = {
BYTE: TYPE = [0..100H);
HWORD: TYPE = Endian.HWORD;
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 over them by just starting at the right place.
Encapsulation: TYPE = MACHINE DEPENDENT RECORD [
SELECT OVERLAID * FROM
ethernet => [
bits on the wire start here
ethernetDest: NS.Host,
ethernetSource: NS.Host,
ethernetType: EthernetPacketType],
ethernetOne => [
etherSpare1, etherSpare2, etherSpare3, etherSpare4, etherSpare5: HWORD,
Bits on the ether start here
ethernetOneDest, ethernetOneSource: Pup.Host,
ethernetOneType: EthernetOnePacketType],
impRelay => [
immediate: IP.Address,
spare1, spare2, spare3: HWORD,
Bits on the ether start here
impEthernetOneDest, impEthernetOneSource: Pup.Host,
impEthernetOneType: EthernetOnePacketType],
spare => [spare1, spare2, spare3, spare4, spare5, spare6, spare7: HWORD],
ENDCASE];
trap: NAT [7..7] = SIZE[Encapsulation];
EthernetOne magic host numbers
ethernetOneBroadcastHost: Pup.Host = Pup.allHosts;
ethernetOneBootLoaderHost: Pup.Host = [377B];
Ethernet magic host numbers
ethernetBroadcastHost: NS.Host = NS.broadcastHost;
offsets are in words
ethernetMinBytes: NAT = 46;
ethernetEncapsulationOffset: NAT = 0;
ethernetEncapsulationBytes: NAT = 14;
ethernetOneEncapsulationOffset: NAT = 5;
ethernetOneEncapsulationBytes: NAT = 4;
EthernetPacketType: TYPE = MACHINE DEPENDENT {
translationFailed(0B),
This is a Hack. It is only used internally to avoid multiword compares and the associated KFCB. It should never appear on the wire.
oldPup(1000B), oldPupTranslation(1001B), -- 0200H, 0201H
Beware: The IEEE idiots think the packet type field (7th word) is the length. There is a grandfather clause for all "types" 600H or above. This lets NS "coexist", but the Pup world got the short end of the stick. There is a new type assigned for Pups, but converting everybody is going to be a real drag.
ns(0600H), -- 3000B
ip(0800H), -- 4000B
arp(0806H), -- "Address Resolution Protocol"
newPup(0A00H), newPupTranslation(0A01H),
(LAST[HWORD])};
EthernetOnePacketType: TYPE = MACHINE DEPENDENT {
translationFailed(0B),
This is a Hack. It is only used to be parallel with 10MB code.
peekData(402B), breathOfLife(602B), echoMe(700B), echoed(701B), pup(1000B),
ip(1001B), arp(1002B),
toImp(1004B), fromImp(1005B), -- For Alto acting as a remote head
ns(3000B), translation(3001B),
(LAST[HWORD])};
IsMulticastHost: PROC [host: NS.Host] RETURNS[BOOL] = INLINE {
Copied from NSImpl to avoid the overhead of a procedure call.
RETURN[Basics.BITAND[host.a, 1] # 0 ];
};
}.