Google
 

Trailing-Edge - PDP-10 Archives - BB-M081Z-SM - monitor-sources/nipar.mac
There are 19 other files named nipar.mac in the archive. Click here to see a list.
; UPD ID= 8564, RIP:<7.MONITOR>NIPAR.MAC.3,  11-Feb-88 11:42:51 by GSCOTT
;TCO 7.1218 - Update copyright date.
; *** Edit 7454 to NIPAR.MAC by RASPUZZI on 16-Apr-87, for SPR #21586
; Prevent GLFNF BUGHLTs, SUMNR1 BUGCHKs and UNBFNF BUGCHKs.
; Add symbolics .FLPSI and .CHNFK. They are words 0 and 1 respectively in
; the LLMOP PSI queue.
; UPD ID= 2150, SNARK:<6.1.MONITOR>NIPAR.MAC.10,   5-Jun-85 10:34:52 by GROSSMAN
; TCO 6.1.1424 - Fix TABxxx macros to deal with tables with large offsets.
; UPD ID= 1806, SNARK:<6.1.MONITOR>NIPAR.MAC.8,  24-Apr-85 13:43:32 by GROSSMAN
; TCO 6.1.1342 - Add UNEXI and NU.CXI.
; UPD ID= 1423, SNARK:<6.1.MONITOR>NIPAR.MAC.7,  29-Jan-85 14:36:05 by GROSSMAN
; TCO 6.1.1162 - Add state UNS.RR - Reload Requested.  Also, ensure proper
; mapping between UNS.xx states and .EISxx states defined in MONSYM.
; UPD ID= 1185, SNARK:<6.1.MONITOR>NIPAR.MAC.6,  11-Dec-84 14:40:00 by GROSSMAN
; TCO 6.1.1080 - Define bits for send/receive failure bit masks.
; UPD ID= 1049, SNARK:<6.1.MONITOR>NIPAR.MAC.5,  13-Nov-84 00:22:18 by GROSSMAN
; TCO 6.1.1048 - Decrease all state symbols by 1 so that they match up with
;  NI% state symbols in MONSYM.  Also, make all definitions in this module
;  be global.  Redefine TABBEG,TABENT and friends so that they can accept
;  arguments that expand into multiple lines of macro.
; UPD ID= 754, SNARK:<6.1.MONITOR>NIPAR.MAC.3,  24-Aug-84 11:37:26 by GROSSMAN
; Add UNICS%.
; UPD ID= 693, SNARK:<6.1.MONITOR>NIPAR.MAC.2,  18-Jul-84 10:13:30 by GROSSMAN
; Add missing transmit error codes.
; UPD ID= 462, SNARK:<6.1.MONITOR>NIPAR.MAC.1,  27-Apr-84 13:32:50 by GROSSMAN
; Module creation by Stu Grossman 3-Mar-84

;	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984, 1988.
;	ALL RIGHTS RESERVED.
;
;	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 THAT IS NOT SUPPLIED BY DIGITAL.
	SEARCH MACSYM,MONSYM

	SALL

	UNIVERSAL NIPAR - NISRV Parameters
	Subttl	Table of Contents

;		     Table of Contents for NIPAR
;
;				  Section		      Page
;
;
;    1. UN Block - User Argument block . . . . . . . . . . . .   3
;    2. Function codes . . . . . . . . . . . . . . . . . . . .   4
;    3. Table manipulation macros  . . . . . . . . . . . . . .   5
;    4. LLMOP PSI queue  . . . . . . . . . . . . . . . . . . .   6
;    5. Error codes  . . . . . . . . . . . . . . . . . . . . .   7
;    6. Channel states and substates . . . . . . . . . . . . .   8
;    7. MD BEGSTR  . . . . . . . . . . . . . . . . . . . . . .   9
;    8. Read Channel Counters block  . . . . . . . . . . . . .  10
;    9. Read Portal Counters Block . . . . . . . . . . . . . .  11
;   10. End of NIPAR . . . . . . . . . . . . . . . . . . . . .  12
	SUBTTL UN Block - User Argument block

BEGSTR UN
	FIELD CHN,3		; Storage for the NI channel number
	FIELD PAD,1		; Use padding for this portal (NU.OPN only)
	FIELD ZRO,1		; Zero counters after reading
	FIELD ADS,2		; Address space of xmit or rcv buffer
	 UNA.EV==:0		;  Exec virtual
	 UNA.UV==:1		;  User virtual
	 UNA.PH==:2		;  Physical
	FIELD PTR,1		; UNDAD contains a byte pointer
	FIELD RSP,1		; Response desired
	HWORD PRO		; Protocol type
	HWORD TDR		; Time Domain Reflectometry value
	HWORD PMS		; PI level mask

	WORD PID		; Portal ID
	WORD UID		; User's ID for this portal
	WORD RID		; Request ID
	WORD STA		; Channel status
;	OVRLAY STA		; The following are subfields of UNSTA
	 DEFSTR (UNRUN,UN.STA,0,1) ;  Channel is running, should be 1b0
	 DEFSTR (UNSST,UN.STA,26,9) ;  Channel substate
	 DEFSTR (UNEXS,UN.STA,35,9) ;  Channel external state
	WORD CBA		; Call back address (NU.OPN only)
	WORD BFA,2		; Buffer address
	WORD BSZ		; Buffer size
	WORD SAD,2		; Source Ethernet address
	WORD DAD,2		; Destination Ethernet address
	WORD SPI		; Secondary portal ID
	 DEFSTR (UNEXI,UN.SPI,8,9) ; External portal ID
	WORD CAR,2		; Current Ethernet address
	WORD HAD,2		; Hardware address
	HWORD OXM		; # Outstanding transmits
	HWORD ORC		; # Outstanding receives
ENDSTR
	SUBTTL Function codes

	NU.OPN==:1	; Open a Portal
	NU.CLO==:2	; Close a Portal	- Close a Portal Callback
	NU.RCV==:3	; Post a Receive Buffer	- Datagram Received Callback
	NU.XMT==:4	; Send a Datagram	- Datagram Sent Callback
	NU.EMA==:5	; Enable a Multicast	- Enable Multicast Callback
	NU.DMA==:6	; Disable a Multicast	- Disable Multicast Callback
	NU.RPC==:7	; Read Portal Counters	- Read Portal Counters Callback
	NU.RCI==:10	; Read Channel Info	- Read Channel Info Callback
	NU.RPL==:11	; Read Portal List
	NU.RCL==:12	; Read Channel List
	NU.RPI==:13	; Read Portal Info
	NU.SCA==:14	; Set Channel Address	- Set Channel Address Callback
	NU.RCC==:15	; Read Channel Counters	- Read Channel Ctrs Callback
	NU.SCS==:16	; Set Channel State
	NU.CXI==:17	; Convert External Portal ID to Internal Portal ID
	NU.MAX==:17	; Maximum function
	SUBTTL Table manipulation macros

	DEFINE TABBEG (first,last,default)<
	..LOC==.
	..FRST==<first>
	..LAST==<last>
	IFL ..LAST-..FRST,<PRINTX ? TABBEG - first greater than last.>

	DEFINE ..DFLT <default>
	>

	DEFINE TABENT (offset,value),<
	.TABNT(\<offset-..FRST>)
	IFL offset-..FRST,<PRINTX ? TABENT - offset out of range.>
	IFG offset-..LAST,<PRINTX ? TABENT - offset out of range.>
	RELOC ..LOC+offset-..FRST
	value
	>

	DEFINE .TABNT (num)<
	IFDEF ..VL'num,<PRINTX ? TABENT - Duplicate table entry # num.>
	..VL'num==1>

	DEFINE TABEND <
	..X==..FRST
	   REPEAT ..LAST-..FRST+1,<
	   RELOC ..LOC+..X-..FRST
	   .TABND (\<..X-..FRST>)
	   ..X==..X+1
	   >
	RELOC ..LOC+..LAST-..FRST+1
	PURGE ..X,..FRST,..LAST,..DFLT,..LOC
	>

	DEFINE .TABND (num)<
	IFNDEF ..VL'num,..DFLT
	IFDEF ..VL'num,PURGE ..VL'num
	>
	SUBTTL LLMOP PSI queue

COMMENT $
Nota bene - Once upon a time, LLMOP did some nasty things. It called
PSIRQ at interrupt level. This caused GLFNF BUGHLTs, SUMNR1 BUGCHKs,
and UNBFNF BUGCHKs. This is not good. So now, there is a queue for
LLMOP to queue up PSI requests. It looks something like this:

LLMPSQ/  ENTRY1 ------>+
                       |
                       +----> ENTRY1+.FLPSI/ Pointer to next entry ---...
                              ENTRY1+.CHNFK/ channel,,fork

		LLMOP PSI queue entry
	+--------------------------------------------------+
.FLPSI	|  Forward pointer to the next entry in the queue  |
	+--------------------------------------------------+
.CHNFK	|  Channel number for PSI | Fork number to get PSI |
	+--------------------------------------------------+

$ ;End comment

.FLPSI==:0		;[7454] Define FLINK word
.CHNFK==:1		;[7454] Define data word
	SUBTTL Error codes

; Define macro to ensure unique names, and generate unique values.

	DEFINE UV (SYM)<IF1,<IFDEF SYM,<PRINTX ? SYM is not unique>>
			SYM==:.VAL.>

	DEFINE .VAL. <<..VAL==..VAL+1>>

	..VAL==0	; Make values start at 1

	UV UNIFC%	; Illegal Function Code
	UV UNRES%	; No Resouces
	UV UNNSC%	; No Such Channel
	UV UNICR%	; Illegal Callback Routine
	UV UNIVP%	; Illegal Protocol Type
	UV UNPIU%	; Protocol Type In Use
	UV UNPRA%	; Promiscuous Receiver Active
	UV UNICL%	; Illegal Function at Callback Level
	UV UNNSP%	; No Such Portal
	UV UNIFB%	; Improperly Formatted Buffer
	UV UNIBS%	; Illegal Buffer Size
	UV UNRDL%	; Received Datagram Too Long
	UV UNRAB%	; Receive Aborted
	UV UNLER%	; Length Error
	UV UNNPE%	; No Protocol Type Enabled For This Portal
	UV UNIBP%	; Illegal Byte Pointer
	UV UNEXC%	; Excessive Collisions
	UV UNDNS%	; Datagram Not Sent
	UV UNNRE%	; No Room For Entry
	UV UNANE%	; Address Not Enabled
	UV UNIMA%	; Illegal Multicast Address
	UV UNICA%	; Illegal Channel Address
	UV UNPWS%	; Portal in Wrong State
	UV UNIUA%	; Illegal UN block address
	UV UNCCF%	; Carrier check failed
	UV UNSHT%	; Short circuit
	UV UNOPN%	; Open circuit
	UV UNRFD%	; Remote failure to defer
	UV UNICS%	; Illegal channel state
	UV UNCAB%	; Command abort

	UV UNMAX%	; Maximum error code
	UNMAX%==UNMAX%-1
	SUBTTL Channel states and substates

	UNS.VG==:.EISVG	; Virgin - has never run before
	UNS.RE==:.EISRE	; Reload - reload requested
	UNS.CR==:.EISCR	; Can't Reload - reload request timed out
	UNS.IN==:.EISIN	; Init - waiting for response to first command
	UNS.RN==:.EISRN	; Run - channel is running and can accept commands
	UNS.DP==:.EISDP	; Dump - a dump has been requested
	UNS.DR==:.EISDR	; Dump & Reload - dump followed by a reload request
	UNS.BK==:.EISBK	; Broken - channel cannot be initialized
	UNS.OF==:.EISOF	; Off - channel is off
	UNS.RR==:.EISRR	; Request Reload - make KNILDR run

	UNS.MX==:.EISMX	; Maximum state
	SUBTTL MD BEGSTR

BEGSTR MD		;Input Meaning,      ;Output Meaning
	WORD NXT,1	;MUST BE ZERO        ;PTR TO NEXT MSD
	WORD PTR	;ILDB PTR INTO MSG   ;IDPB PTR INTO MSG
	WORD AUX	;NOT USED            ;ILDB PTR TO BEG OF MSG
	WORD BYT	;BYTES LEFT TO READ  ;BYTES WRITTEN SO FAR
	FIELD VMC,3	;VIRTUAL MAP CONTEXT
		VMC.XC==:0	;EXEC Context (Map through EPT)
		VMC.US==:1	;USER Context (Map through UPT)
		VMC.NO==:2	;DO NOT Map (Physical Address)
	HWORD ALL	;ALLOCATED LENGTH IN BYTES
	WORD ALA	;ALLOCATED ADDRESS OF SEGMENT'S DATA
ENDSTR
	SUBTTL Read Channel Counters block

BEGSTR CC
	FILLER 36		; Network management data
	WORD SLZ		; Seconds since last zeroed
	FILLER 36		; Network management data
	WORD BYR		; Bytes received
	FILLER 36		; Network management data
	WORD BYS		; Bytes sent
	FILLER 36		; Network management data
	WORD DGR		; Datagrams received
	FILLER 36		; Network management data
	WORD DGS		; Datagrams sent
	FILLER 36		; Network management data
	WORD MBR		; Multicast bytes received
	FILLER 36		; Network management data
	WORD MDR		; Multicast datagrams received
	FILLER 36		; Network management data
	WORD DSD		; Datagrams sent, initially deferred
	FILLER 36		; Network management data
	WORD DS1		; Datagrams sent, single collision
	FILLER 36		; Network management data
	WORD DSM		; Datagrams sent multiple collisions
	FILLER 36		; Network management data
	WORD SF			; Send failures
	WORD SFM		; Send failure bit mask
	 DEFSTR CCLOC,CC.SFM,24,1 ; Loss of carrier
	 DEFSTR CCXBP,CC.SFM,25,1 ; Xmit buffer parity error
	 DEFSTR CCRFD,CC.SFM,26,1 ; Remote failure to defer
	 DEFSTR CCXFL,CC.SFM,27,1 ; Xmitted frame too long
	 DEFSTR CCOC,CC.SFM,28,1  ; Open circuit
	 DEFSTR CCSC,CC.SFM,29,1  ; Short circuit
	 DEFSTR CCCCF,CC.SFM,30,1 ; Collision detect check failed
	 DEFSTR CCEXC,CC.SFM,31,1 ; Excessive collisions
	FILLER 36		; Network management data
	WORD RF			; Receive failure
	WORD RFM		; Receive failure bit mask
	 DEFSTR CCFLE,CC.RFM,27,1 ; Free list parity error
	 DEFSTR CCNFB,CC.RFM,28,1 ; No free buffers
	 DEFSTR CCFTL,CC.RFM,29,1 ; Frame too long
	 DEFSTR CCFER,CC.RFM,30,1 ; Framing error
	 DEFSTR CCBCE,CC.RFM,31,1 ; Block check error
	FILLER 36		; Network management data
	WORD UFD		; Unrecognized frame destination
	FILLER 36		; Network management data
	WORD DOV		; Data overrun
	FILLER 36		; Network management data
	WORD SBU		; System buffer unavailable
	FILLER 36		; Network management data
	WORD UBU		; User buffer unavailable
ENDSTR
	SUBTTL Read Portal Counters Block

BEGSTR PC
	FILLER 36		; Network management data
	WORD SLZ		; Seconds since last zeroed
	FILLER 36		; Network management data
	WORD BYR		; Bytes received
	FILLER 36		; Network management data
	WORD DGR		; Datagrams received
	FILLER 36		; Network management data
	WORD BYS		; Bytes sent
	FILLER 36		; Network management data
	WORD DGS		; Datagrams sent
	FILLER 36		; Network management data
	WORD UBU		; User buffer unavailable
ENDSTR
	SUBTTL End of NIPAR
	END