-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- PhoneFace.mesa, HGM, 31-Oct-83 12:10:12

DIRECTORY
  Device USING [Type];
  
PhoneFace: DEFINITIONS =

  BEGIN
  
  phoneLine: Device.Type = LOOPHOLE[15];  -- BootChannelSPP requires this to be an Ethernet
  krockDeivceOffsetForBooting: CARDINAL = 1000H;
  
  maxLines: CARDINAL = 16;
  Line: TYPE = [0..maxLines);
  
  GetLineCount: PROCEDURE RETURNS [lines: CARDINAL];  -- 0 if none

  TurnOn: PROCEDURE [interruptBits: WORD];
  TurnOff: PROCEDURE;

  ResetLine: PROCEDURE [line: Line];

  GetPacketsMissed: PROCEDURE [line: Line] RETURNS [CARDINAL];

  QueueOutput: PROCEDURE [
    line: Line, iocb: IOCB, buffer: LONG POINTER, bytes: CARDINAL];
  GetSendStatus: PROCEDURE [iocb: IOCB] RETURNS [status: Status];

  QueueInput: PROCEDURE [
    line: Line, iocb: IOCB, buffer: LONG POINTER, bytes: CARDINAL];
  GetRecvStatus: PROCEDURE [iocb: IOCB] RETURNS [status: Status];
  GetPacketLength: PROCEDURE [iocb: IOCB] RETURNS [bytes: CARDINAL];

  Status: TYPE = {
    pending, ok,
    underrun,  -- Output FIFO went empty before end of packet was set
    overrun,  -- Input data arrived when FIFO was full
    packetTooLong,  -- Input packet didn't fit into buffer
    crc,
    otherError};

  IOCB: TYPE = LONG POINTER TO ControlBlockRecord;
  ControlBlockRecord: TYPE;
  controlBlockSize: READONLY CARDINAL;


  END.