DIRECTORY StatsDefs USING [StatCounterIndex], BufferDefs USING [ Buffer, BufferAccessHandle, BufferFunction, BufferType, OisBuffer, PupBuffer, Queue, systemAccessHandle], PupTypes USING [PupHostID, PupErrorCode], DriverTypes USING [DeviceType], NSAddress USING [HostNumber, NetworkNumber]; DriverDefs: DEFINITIONS IMPORTS BufferDefs = BEGIN OPEN BufferDefs; PutOnGlobalInputQueue: PROCEDURE [Buffer]; PutOnGlobalDoneQueue: PROCEDURE [Buffer]; GetInputBuffer: PROCEDURE [tryToWaitForBuffer: BOOLEAN _ FALSE] RETURNS [Buffer]; -- b.length (words) includes encap ReturnFreeBuffer: PROCEDURE [Buffer]; MaybeGetFreePupBuffer: PROCEDURE RETURNS [PupBuffer] = INLINE { RETURN[ LOOPHOLE[MaybeGetFreeBuffer[ pup, BufferDefs.systemAccessHandle, systemUse]]]}; MaybeGetFreeOisBuffer: PROCEDURE RETURNS [OisBuffer] = INLINE { RETURN[ LOOPHOLE[MaybeGetFreeBuffer[ ois, BufferDefs.systemAccessHandle, systemUse]]]}; MaybeGetFreeBuffer: PROCEDURE [ bufType: BufferType _ raw, aH: BufferAccessHandle _ BufferDefs.systemAccessHandle, bufFunc: BufferFunction _ systemUse] RETURNS [Buffer]; Router: TYPE = LONG POINTER TO RouterObject; RouterObject: TYPE = RECORD [ input: PROCEDURE [Buffer], broadcast: PROCEDURE [Buffer], addNetwork: PROCEDURE [Network], removeNetwork: PROCEDURE [Network], stateChanged: PROCEDURE [Network]]; nilNetwork: Network = NIL; Network: TYPE = LONG POINTER TO NetworkObject; NetworkObject: TYPE = RECORD [ next: Network, decapsulateBuffer: PROCEDURE [Buffer] RETURNS [BufferDefs.BufferType], encapsulatePup: PROCEDURE [PupBuffer, PupTypes.PupHostID], encapsulateOis: PROCEDURE [OisBuffer, NSAddress.HostNumber], sendBuffer: PROCEDURE [Buffer], forwardBuffer: PROCEDURE [Buffer] RETURNS [PupTypes.PupErrorCode], activateDriver: PROCEDURE, deactivateDriver: PROCEDURE, deleteDriver: PROCEDURE, interrupt: PROCEDURE, -- to lock things in memory changeNumberOfInputBuffers: PROCEDURE [ --increaseBuffers--BOOLEAN] _ NIL, index: [0..400B), -- assigned by AddDeviceToChain (starts at 1) device: DriverTypes.DeviceType, -- 4 bits alive: BOOLEAN, speed: CARDINAL, -- KiloBits/Sec buffers: [0..256), spare: [0..256), netNumber: NSAddress.NetworkNumber, hostNumber: CARDINAL, -- This is the Pup host number pupStats: PROCEDURE [PupBuffer, Network] RETURNS [BOOLEAN], stats: LONG POINTER]; -- and debugging CommPackageGo: PROCEDURE; CommPackageOff: PROCEDURE; GetUseCount: PROCEDURE RETURNS [CARDINAL]; SetPupRouter, SetOisRouter: PROCEDURE [Router]; -- NIL to Deactivate GetPupRouter, GetOisRouter: PROCEDURE RETURNS [Router]; StateChanged: PROCEDURE [Network]; AddDeviceToChain: PROCEDURE [network: Network, iocbSize: CARDINAL]; RemoveDeviceFromChain: PROCEDURE [Network]; GetDeviceChain: PROCEDURE RETURNS [Network]; SmashDeviceChain: PROCEDURE; -- only used by LoopBackPlug (to forget Ethernet) ChangeNumberOfInputBuffers: PROCEDURE [increaseTheBuffers: BOOLEAN]; CreateDefaultEthernetOneDrivers: PROCEDURE RETURNS [BOOLEAN]; CreateDefaultEthernetDrivers: PROCEDURE RETURNS [BOOLEAN]; CreateLoopBackDriver: PROCEDURE RETURNS [BOOLEAN]; CreateEthernetDriver: PROCEDURE [netNumber: CARDINAL, deviceNumber: [0..3)] RETURNS [BOOLEAN]; CreateChainedEthernetDriver: PROCEDURE [ netNumber: CARDINAL, deviceNumber: [0..3)] RETURNS [BOOLEAN]; CreateEIADriver: PROCEDURE [host, net, lines: CARDINAL] RETURNS [BOOLEAN]; CreateCommProcDriver: PROCEDURE [host, net, lines: CARDINAL] RETURNS [BOOLEAN]; AssignPassword: PROCEDURE [line: CARDINAL, password: STRING]; CreatePacketRadioDriver: PROCEDURE [host, net: CARDINAL] RETURNS [BOOLEAN]; AdjustLengthOfEthernetInputQueue: PROCEDURE [CARDINAL]; AdjustLengthOfEthernetIIInputQueue: PROCEDURE [CARDINAL]; EthernetStats: PROCEDURE [PupBuffer, Network] RETURNS [BOOLEAN]; SlaStats: PROCEDURE [PupBuffer, Network] RETURNS [BOOLEAN]; PacketRadioStats: PROCEDURE [PupBuffer, Network] RETURNS [BOOLEAN]; DispatcherOn: PROCEDURE; DispatcherOff: PROCEDURE; DriverXmitStatus: TYPE = { pending, goodCompletion, aborted, noRouteToNetwork, hardwareProblem, invalidDestAddr, crateTooSmall, noAnswerOrBusy, -- auto-dial case only noTranslationForDestination, -- no phone number for this destination circuitInUse, -- being used to talk to another destination circuitNotReady, -- dial the phone or connect modems (non-auto-dial case) noDialingHardware, dialerHardwareProblem}; Glitch: PROCEDURE [ERROR]; GetWordsPerIocb: PROCEDURE RETURNS [CARDINAL]; SetWordsPerIocb: PROCEDURE [CARDINAL]; Boss, DispatcherImpl, BufferMgr: PROGRAM; GetGiantVector: PROCEDURE RETURNS [POINTER TO GiantVector]; GiantVector: TYPE = RECORD [ firstNetwork: Network, firstBuffer: Buffer, bufferPoolSize: CARDINAL, wordsPerBuffer: CARDINAL, pupRoutingTable: LONG DESCRIPTOR FOR ARRAY OF UNSPECIFIED, firstPupSocket: LONG POINTER, freeQueue, globalInputQueue, globalOutputQueue: Queue, firstBufferAccessHandle: BufferDefs.BufferAccessHandle, ethernetOutputQueue: Queue, currentInputBuffer, nextInputBuffer, currentOutputBuffer: POINTER TO Buffer, statCounters: LONG POINTER TO ARRAY StatsDefs.StatCounterIndex OF LONG CARDINAL, statStrings: LONG POINTER TO ARRAY StatsDefs.StatCounterIndex OF STRING, slaThings: LONG POINTER, prThings: LONG POINTER, spare: LONG POINTER]; END. LOG August 1, 1980 3:38 PM by BLyon, Action: modified netNumber in NetworkObject. August 6, 1980 10:17 AM By: Garlick Action: Added several DriverXmitStatus's for circuit-oriented network errors. August 1, 1980 3:38 PM by HGM, Action: added buffers, stateChanged, and such. Time: October 10, 1980 4:50 PM By: Garlick Action: Added DriverXmitStatus noAnswerOrBusy. Time: November 25, 1980 6:31 PM By: BLyon Action: turned off doStats $DriverDefs.Mesa Copyright c 1985 by Xerox Corporation. All rights reserved. HGM January 6, 1981 9:21 PM BLyon January 16, 1981 2:48 PM Russ Atkinson (RRA) February 2, 1985 3:03:00 pm PST Interface from device drivers to Dispatcher and QueuePackage These will return the last buffer. They never wait. Be careful. NIL if its empty. Interface to Routers Interface to Device Drivers ON/OFF Device Things affects all drivers on the chain Setting up individual device drivers Stats linkage Internal routines Larry and Yogen the following apply to circuit-like media only and mostly to the first packet sent General catchall for things that shouldn't happen interface to SystemBufferPool For getting things STARTed Beware MakeImage does not preserve debugPointer. hacks until we get more drivers Κ{˜codešœ™Kšœ Οmœ1™˜]Kšœžœ(˜HK˜—…— ³