Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/drivers/dmcdat.r16
There are no other files named dmcdat.r16 in the archive.
! [Beginning of DMCDAT]
!
!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    DIGITAL EQUIPMENT CORPORATION
!                        Maynard, Massachusetts
!
!     This software is furnished under a license and may  be  used
!     and copied only in accordance with the terms of such license
!     and with the inclusion of the above copyright notice.   This
!     software  or any other copies thereof may not be provided or
!     otherwise made available to any other person.  No  title  to
!     and ownership of the software is hereby transferred.
!
!     The information  in  this  software  is  subject  to  change
!     without  notice  and should not be construed as a commitment
!     by DIGITAL EQUIPMENT CORPORATION.
!
!     DIGITAL assumes no responsibility for the use or reliability
!     of  its  software  on  equipment  which  is  not supplied by
!     DIGITAL.
!

!++
!
! FACILITY: MCB DMC Driver
!
! ABSTRACT:
!
!	This contains the data structure definitions for the DMC DLC.
!
! ENVIRONMENT: MCB V3.0
!
! AUTHOR: Alan D. Peckham	CREATION DATE: 30-Oct-80
!
! MODIFIED BY:
!
!	Alan D. Peckham, 30-Oct-80: Version 1
! 01	- Rewrite from MACRO-11 to BLISS.
! 04	- Map the data base.
!	  Add Network management parameters and counters.
! 05	- Add interrupt vector/priority.
! 06	- Extend event logging buffer.
! 07	- Add network management constants.
! 08	- Add controller loopback flag.
! 09	- Modify DD_CLEARED to allow DD_HALTED to be zero.
! 10	- Add hardware error counters.
! 11	- Add conflicting vector counter.
! 12	- Maintain new system specific line counters (2500,2501,2502).
! 13	- Add protocol up bit.
! 14	- Add CIRCUIT COST for Transport.
! 15	- Add seconds-since-last-zeroed support.
!--

%if not %declared (XPO$K_VERSION) %then library 'XPORT'; %fi

%if not %declared (MCB$K_VERSION) %then library 'MCBLIB'; %fi

library 'NMXLIB';

$SHOW (FIELDS) $SHOW (LITERALS)

!
! Status Codes:
!

literal
    DMC$_EVT = STS$VALUE (CODE = 0, SEVERITY = STS$K_INFO),
    DMC$_PWF = STS$VALUE (CODE = 1, SEVERITY = STS$K_SEVERE),
    DMC$_MTL = STS$VALUE (CODE = 2, SEVERITY = STS$K_SEVERE),
    DMC$_QUE = STS$VALUE (CODE = 3, SEVERITY = STS$K_SEVERE),
    DMC$_LOG = STS$VALUE (CODE = 4, SEVERITY = STS$K_INFO);

!
! Parameter construction
!

macro
    PARAMETER_DEVICE = LP1000 %,
    PARAMETER_DEVICE_REGISTERS = PLL0 %,
    PARAMETER_CIRCUIT_COUNTERS = CKCTRS %,
    PARAMETER_LINE_COUNTERS = LNCTRS %;

!
!
!

literal
    DMC_K_LINE_PROVIDER = 0^1,
    DMC_K_LINE_OWNER = 1^1,
    DMC_K_CIRCUIT_PROVIDER = 2^1,
    DMC_K_NMID_HIGH = 2^1;

!
! Data base creation items
!

macro
    $ALIGN_SIGN =
	%assign ($xpo$fill_index, $xpo$fill_index + 1)
	%assign ($xpo$fill_temp, 7 - ($xpo$bit_index mod 8))
	%name (XPOfill, %number ($xpo$fill_index)) = [$BITS ($xpo$fill_temp)], %,
    $SIGN_BIT =
	$XPO$FIELD (1, 1, 0) %;

compiletime
    $xpo$fill_index = 0,
    $xpo$fill_temp = 0;

$FIELD
    !
    ! List head definition
    !
    LIST_FIRST = [$ADDRESS],
    LIST_LAST = [$ADDRESS];

compiletime
    $dmc$length = $FIELD_SET_SIZE;

macro
    $LIST_HEAD =
	$SUB_BLOCK (%expand %number ($dmc$length)) %;

$FIELD
    !
    ! Physical 18 bit address
    !
    PHYSICAL_HIGH = [$BITS (16)],
    PHYSICAL_LOW = [$BITS (16)];

%assign ($dmc$length, $FIELD_SET_SIZE)

macro
    $BIAS =
	$SHORT_INTEGER %,
    $PHYSICAL_ADDRESS =
	$SUB_BLOCK (%expand %number ($dmc$length)) %,
    $SYNCH_BLOCK =
	$SUB_BLOCK (3) %;

undeclare
    $dmc$length;
!
! DMC11 hardware register definitions
!

field
    DMC_FIELDS =
	set
	SEL0 = [0, 0, 16, 1],
	BSEL0 = [0, 0, 8, 1],
	BSEL1 = [0, 8, 8, 1],
	    TYPEI = [0, 0, 3, 0],	! Input request type
	    RQI = [0, 5, 1, 0],		! REQUEST FOR INPUT TRANSFER
	    IEI = [0, 6, 1, 0],		! RDYI INTERRUPT ENABLE
	    RDYI = [0, 7, 1, 1],	! READY FOR INPUT TRANSFER
	    LU_LOOP = [0, 11, 1, 0],	! Line unit loopback
	    MC = [0, 14, 1, 0],		! MASTER CLEAR
	    RUN = [0, 15, 1, 1],	! MICROPROCESSOR RUN BIT (KMC ONLY)
	SEL2 = [1, 0, 16, 1],
	BSEL2 = [1, 0, 8, 1],
	BSEL3 = [1, 8, 8, 1],
	    TYPEO = [0, 0, 3, 0],	! Output request type
	    IEO = [0, 6, 1, 0],		! RDYO INTERRUPT ENABLE
	    RDYO = [0, 7, 1, 1],	! READY FOR OUTPUT TRANSFER
	SEL4 = [2, 0, 16, 1],
	SEL6 = [3, 0, 16, 1],

! BA/CC

	    BA_LOW = [0, 0, 16, 0],
	    CC = [0, 0, 14, 0],
	    BA_HIGH = [0, 14, 2, 0],

! BASE I

	    B_LOW = [0, 0, 16, 0],
	    RESUME = [0, 13, 1, 0],
	    B_HIGH = [0, 14, 2, 0],
! CNTL I

	    MAINT = [0, 8, 1, 0],	! MOP MAINTAINANCE MODE BIT
	    HD = [0, 10, 1, 0],		! HALF DUPLEX FLAG
	    SEC = [0, 11, 1, 0],	! SECONDARY STATION BIT

! CNTL O

	    DATA_CK = [0, 0, 1, 0],	! Data check
	    TIME_OUT = [0, 1, 1, 0],	! Timeout
	    O_RUN = [0, 2, 1, 0],	! Overrun error
	    MNT_RCVD = [0, 3, 1, 0],	! DDCMP maintenance received
	    DATA_LOST = [0, 4, 1, 0],	! Lost data
	    DISC = [0, 6, 1, 0],	! Disconnect
	    STR_RCVD = [0, 7, 1, 1],	! DDCMP START received
	    NXM = [0, 8, 1, 0],		! Non-existent memory
	    PROC_ERR = [0, 9, 1, 0]	! Procedure error
	tes;

literal
    BA_CC_I = 0,		! Buffer Address/Character Count In
    BA_CC_O = 0,		! Buffer Address/Character Count Out
    HALT = 2,			! Halt device
    BASE_I = 3,			! Base In
    CNTL_I = 1,			! Control In
    CNTL_O = 1,			! Control Out
    RCV = 4,			! Reception I/O
    XMT = 0;			! Transmission I/O

field
    BASE_FIELDS =
	set
	BASE_COUNTER_BEGIN = [1, 0, 0, 0],
	BASE_NAKS_RCV_NO_BUF = [1, 8, 8, 0],
	BASE_NAKS_RCV_HDR_BCC = [2, 0, 8, 0],
	BASE_NAKS_RCV_DAT_BCC = [2, 8, 8, 0],
	BASE_NAKS_SND_NO_BUF = [3, 0, 8, 0],
	BASE_NAKS_SND_HDR_BCC = [3, 8, 8, 0],
	BASE_NAKS_SND_DAT_BCC = [4, 0, 8, 0],
	BASE_REPS_SND = [4, 8, 8, 0],
	BASE_REPS_RCV = [5, 0, 8, 0],

	! DMR only

	BASE_NAKS_RCV_REP = [5, 8, 8, 0],
	BASE_NAKS_RCV_RCV_OVRN = [6, 0, 8, 0],
	BASE_NAKS_RCV_HDR_FMT = [6, 8, 8, 0],
	BASE_NAKS_RCV_TOO_LONG = [7, 0, 8, 0],
	BASE_NAKS_SND_RCV_REP = [7, 8, 8, 0],
	BASE_NAKS_SND_RCV_OVRN = [8, 0, 8, 0],
	BASE_NAKS_SND_HDR_FMT = [8, 8, 8, 0],
	BASE_XMT_UNDR = [9, 0, 8, 0],
	BASE_CALL_FAIL = [9, 8, 8, 0],
	BASE_CTS_FAIL = [10, 0, 8, 0],
	BASE_CAR_FAIL = [10, 8, 8, 0],
	BASE_RCVR_INACTIVE = [11, 0, 8, 0],
	BASE_STRM_TIMEOUT = [11, 8, 8, 0],
	BASE_BYTES_TRANSMITTED = [12, 0, 0 %(32)%, 0],
	BASE_BYTES_RECEIVED = [14, 0, 0 %(32)%, 0],
	BASE_INCOMPLETE_SEL = [16, 0, 8, 0],
	BASE_NO_REPLY_TO_SEL = [16, 8, 8, 0],
	BASE_COUNTER_END = [17, 0, 0, 0]
	tes;

literal
    BASE_COUNTER_LENGTH = 17 - 1,
    BASE_LENGTH = 128;

macro
    $DMC_BITS_CLEAR (REG, FLD) =
	begin
	bind $DMC$CSR = REG : block field (DMC_FIELDS) volatile;
	(.$DMC$CSR [FLD] and $DMC$BIT_MASK [%remaining]) eql 0
	end %,
    $DMC_CLEAR_BITS (REG, FLD) =
	begin
	bind $DMC$CSR = REG : block field (DMC_FIELDS);
	$DMC$CSR [FLD] = .$DMC$CSR [FLD] and not $DMC$BIT_MASK [%remaining]
	end %,
    $DMC_READ (REG, FLD) =
	begin
	bind $DMC$CSR = REG : block field (DMC_FIELDS);
	.$DMC$CSR [$DMC$BYTE (FLD)]
	end %,
    $DMC_SET_BITS (REG, FLD) =
	begin
	bind $DMC$CSR = REG : block field (DMC_FIELDS);
	$DMC$CSR [FLD] = .$DMC$CSR [FLD] or $DMC$BIT_MASK [%remaining]
	end %,
    $DMC_WRITE (REG, FLD, VALUE) =
	begin
	bind $DMC$CSR = REG : block field (DMC_FIELDS);
	$DMC$CSR [$DMC$BYTE (FLD)] = VALUE;
	end %,
    $DMC$BIT_MASK [FLD] =
	(1^%fieldexpand (FLD, 2) - 1)^%fieldexpand (FLD, 1) %,
    $DMC$BYTE (FLD) =
	%fieldexpand (FLD, 0), %fieldexpand (FLD, 1), %fieldexpand (FLD, 2), 0 %;
!
! DMC driver data base
!

macro
    GET_DMC_DATA_BASE (NAME) =
	%if %declared (NAME)
	%then map NAME : ref
	%else external MCB$GAW_PROCESS_DATA_BASE : vector [2];
	      bind NAME = .MCB$GAW_PROCESS_DATA_BASE [1] :
	%fi block field (D_FIELDS); %;

$FIELD
    D_FIELDS =
	set
	D_TIM = [$TINY_INTEGER],	! One second timer
	DF_NOTIFY_OFF = [$BIT],		!  Send OFF state to circuit owner
	DF_NOTIFY_STATE = [$BIT],	!  Send state to circuit owner
	DF_NXM = [$BIT],		!  NXM occurred
	DF_WAITING_FOR_RDYI = [$BIT],	!  Looking for RDI late
	DF_FLUSHING_DMC = [$BIT],	!  Halting (procedure error expected)
	DF_SYNCHRONIZING = [$BIT],	!  SYNCH is in progress.
	DF_SERVICING_DMC = [$BIT],	!  The DMC is being polled for requests
	DF_WAITING_FOR_RECEIVE = [$BIT],!  Maintenance service timer is active
	    $ALIGN (FULLWORD)
	D_REGISTER = [$ADDRESS],	! Address of DMC SEL0 register
	D_VECTOR = [$ADDRESS],		! Interrupt vector address
	D_PRIORITY = [$TINY_INTEGER],	! Interrupt priority
	D_NMX_PIX = [$BYTE],		! Process index for NMX
	D_SYNCH_BLOCK = [$ADDRESS],	! SYNCH block.
	D_INPUT_DATA = [$SUB_BLOCK (4)], ! DMC input transfer buffer.
	    $OVERLAY ($SUB_FIELD (D_INPUT_DATA, BSEL0))
	D_INPUT_COMMAND = [$BYTE],	! DMC input command buffer
	    $CONTINUE
	D_OUTPUT_DATA = [$SUB_BLOCK (4)], ! DMC output transfer buffer.
	D_CONTROL_FLAGS = [$TINY_INTEGER], ! Control flags (priority ordered):
	    $OVERLAY (D_CONTROL_FLAGS)
	DC_HALT = [$BIT],		!  Halt the protocol
	DC_MASTER_CLEAR = [$BIT],	!  Master clear the DMC
	DC_ZERO_CIRCUIT_COUNTERS = [$BIT],!Zero the circuit counters
	DC_ZERO_LINE_COUNTERS = [$BIT],	!  Zero the line counters
	DC_BASE_IN = [$BIT],		!  Assign the base table
	DC_CONTROL_IN = [$BIT],		!  Do a control in
	DC_SET_REQUESTED_STATE = [$BIT],!  Set requested state
	DC_CONTINUE_CONTROL = [$BIT],	!  Continue control function
	    $CONTINUE
	DF_HALF_DUPLEX = [$BIT],	!  Line half duplex
	DF_1_SEC = [$BIT],		!  One second retransmit timer
	DF_CONTROLLER_LOOPBACK = [$BIT],!  DMC is in controller loopback
	DF_DMR_LINE = [$BIT],		!  Line is a DMR line
	DF_DMR = [$BIT],		!  Device is a DMR
	DF_PROTOCOL_UP = [$BIT],	!  Successful transmit or receive
	DF_CTL = [$BIT],		!  Control function blocked
	    $ALIGN_SIGN
	DF_ACTIVE = [$SIGN_BIT],	!  Line is active
	D_PROTOCOL_STATE = [$TINY_INTEGER], ! Protocol state
	D_REQUESTED_STATE = [$TINY_INTEGER], ! Requested protocol state
	D_REPORTED_STATE = [$TINY_INTEGER], ! Reported circuit state
	D_LINE_STATE = [$TINY_INTEGER],	! Network Management line state
	D_DEVICE_STATE = [$TINY_INTEGER], ! DMC device state
	D_TRANSMIT_TIMEOUT = [$TINY_INTEGER], ! Transmitter timeout value
	    $ALIGN (FULLWORD)
	D_OWNER_HANDLE = [$SHORT_INTEGER],
	D_ASSIGNABLE_RECEIVE_CCBS = [$LIST_HEAD],
	D_ASSIGNED_RECEIVE_CCBS = [$LIST_HEAD],
	D_ASSIGNABLE_TRANSMIT_CCBS = [$LIST_HEAD],
	D_ASSIGNED_TRANSMIT_CCBS = [$LIST_HEAD],
	D_TRANSMIT_BUFFER_SIZE = [$SHORT_INTEGER], ! Size of transmit buffer
	D_NEXT_TRANSMIT_BUFFER = [$ADDRESS], ! Address of next transmit buffer to assign
	D_HIGHEST_TRANSMIT_BUFFER = [$ADDRESS], ! Address of end of transmit buffer area
	D_PENDING_CONTROLS = [$LIST_HEAD], ! Pending control functions
	D_SERVICE_TIMER = [$INTEGER],	! Line service timer
	D_CIRCUIT_ENTITY = [$INTEGER],	! Circuit logging entity identification
	D_LINE_ENTITY = [$INTEGER],	! Line logging entity identification
	D_TRANSIENT_ERROR = [$SHORT_INTEGER], ! Unreported transient error.
	D_PERSISTENT_ERROR = [$SHORT_INTEGER], ! Unreported persistent error.
	D_ACTIVE_BUFFERS = [$SHORT_INTEGER],	! Receive buffers at user and
						! transmit buffers from user.
	D_CIRCUIT_COST = [$SHORT_INTEGER], ! ** FOR TRANSPORT **
	D_ASSIGNABLE_RECEIVE_COUNT = [$BYTE],
	D_ASSIGNABLE_TRANSMIT_COUNT = [$BYTE],
	D_ASSIGNED_RECEIVE_COUNT = [$BYTE],
	D_ASSIGNED_TRANSMIT_COUNT = [$BYTE],
	D_MAXIMUM_RECEIVE_COUNT = [$BYTE],
	D_MAXIMUM_TRANSMIT_COUNT = [$BYTE],
	    $ALIGN (FULLWORD)
	D_BYTES_TRANSMITTED = [$COUNTER (32)],	! Number of data bytes transmitted
	D_BYTES_RECEIVED = [$COUNTER (32)],	! Number of data bytes received
	D_BLOCKS_TRANSMITTED = [$COUNTER (32)],	! Number of data blocks transmitted
	D_BLOCKS_RECEIVED = [$COUNTER (32)],	! Number of data blocks received
	DB_TIME_LINE_ZEROED = [$TIME],		! Time line counters zeroed
	    $ALIGN (FULLWORD)
	D_CONFIGURATION_ERRORS = [$COUNTER (8)],
	D_INVALID_CONTROLLER_REGISTER = [$COUNTER (1)],
	D_NXM_CONTROLLER_REGISTER = [$COUNTER (1)],
	D_INVALID_UNIT_REGISTER = [$COUNTER (1)],
	D_NXM_UNIT_REGISTER = [$COUNTER (1)],
	D_INVALID_VECTOR = [$COUNTER (1)],
	D_CONFLICTING_VECTOR = [$COUNTER (1)],
	D_INVALID_PRIORITY = [$COUNTER (1)],
	    $ALIGN (FULLWORD)
	D_DEVICE_SERVICE_ERRORS = [$COUNTER (8)],
	D_LOST_INTERRUPT = [$COUNTER (1)],
	D_LOST_RDYI = [$COUNTER (1)],
	D_LOST_HALT = [$COUNTER (1)],
	D_LOST_TRANSMIT = [$COUNTER (1)],
	D_LOST_DOORBELL = [$COUNTER (1)],
	    $ALIGN (FULLWORD)
	D_FATAL_DEVICE_ERRORS = [$COUNTER (8)],
	D_INVALID_REGISTER_CONTENTS = [$COUNTER (1)],
	D_RECEIVE_BA_MISMATCH = [$COUNTER (1)],
	D_TRANSMIT_BA_MISMATCH = [$COUNTER (1)],
	D_NXM_TO_DEVICE = [$COUNTER (1)],
	D_MICROCODE_ERROR = [$COUNTER (1)],
	D_COMPLETION_QUEUE_OVERRUN = [$COUNTER (1)],
	D_DOORBELL_STUCK = [$COUNTER (1)],
	D_PROCEDURE_ERROR = [$COUNTER (1)],
	    $ALIGN (FULLWORD)
	D_LNTB = [$SUB_BLOCK (BASE_LENGTH)], ! DMC base table.
	D_CPTB = [$SUB_BLOCK (%fieldexpand (BASE_COUNTER_END, 0))],
	D_BUF = [$SUB_BLOCK (0)],	! Transmit buffer area.

	    $OVERLAY (D_BUF)		! Initialization data.
	DI_HD = [$BIT]			!  Half duplex line
	    $CONTINUE
	tes;

literal
    D_LEN = $FIELD_SET_SIZE,
    DD_MASTER_CLEARED = 0,		! Device is master cleared
    DD_HALTED = 1,			! Device is halted
    DD_BASE_TABLE_ASSIGNED = 2,		! Device has base table assigned
    DD_RUNNING = 3,			! Device is running
    DD_SHUT_DOWN = 4,			! Device has shut down
    DD_CLEARED = 5,			! Device is not defined
    DD_LOW = min (DD_CLEARED, DD_MASTER_CLEARED, DD_HALTED, DD_BASE_TABLE_ASSIGNED, DD_RUNNING, DD_SHUT_DOWN),
    DD_HIGH = max (DD_CLEARED, DD_MASTER_CLEARED, DD_HALTED, DD_BASE_TABLE_ASSIGNED, DD_RUNNING, DD_SHUT_DOWN),
    DL_ON = 0,				! Line is ON
    DL_OFF = 1,				! Line is OFF
    DS_HALTED = 0,			! Protocol is in HALTED state
    DS_ISTRT = 1,			! Protocol is in ISTRT state
    DS_ASTRT = 2,			! Protocol is in ASTRT state
    DS_RUNNING = 3,			! Protocol is in RUNNING state
    DS_MAINTENANCE = 4;			! Protocol is in MAINTENANCE state

!
! [End of DMCDAT]