*DECK CSSANS
USETEXT TEXTSS
USETEXT TXTSUSS
USETEXT TEXTCS
USETEXT TXTAPSS
USETEXT TXTSMCS
PROC CSSANS;
# TITLE CSSANS - ACQUIRE NPU SUPERVISION. #
BEGIN # CSSANS #
#
** CSSANS - ACQUIRE NPU SUPERVISION.
*
* C.BRION 82/02/13.
* C.BRION 82/04/28.
*
* THIS PROCEDURE PROCESSES THE SUPERVISION REQUEST SMS FROM NPUS.
*
* PROC CSSANS
*
* ENTRY:
* WCBUF = WORD COUNT WORD FOR ENTRY.
* ABHBUF = APPLICATION BLOCK HEADER WORD.
* MSGBUF = ENTRY BODY OF SUP/IN/R SM.
*
* EXIT:
* THE NPU SUPERVISION REQUEST IS PROCESSED AND THE NPU
* IS EITHER GRANTED OR DENIED SUPERVISION PRIVILEDGES.
*
#
#
**** PROC CSSANS XREF LIST
#
XREF
BEGIN
PROC MESSAGE;
PROC ABORT;
PROC SSBCBW; # CLEAR BIT IN WORD #
PROC SSBSBW; # STORE BIT IN WORD #
PROC SSBTBW; # TEST BIT IN WORD #
PROC SSCCTR; # CANCEL TIMER REQUEST #
PROC SSTAQE; # ACCEPT QUEUE ENTRY #
FUNC XCHD U;
END
#
****
#
#
* PROC CSSANS DEFS
#
DEF LDMSGL$ # 50 #; # LOST DATA MSG CHARLENGTH #
DEF MISSNPUL$ # 20 #; # MISSING NPU MSG CHAR LEN #
DEF SUPMSGL$ # 40 #; # SUPERVISION LOST/GAINED #
# MESSAGE CHAR LENGTHS #
DEF MATCHID$ # 99 #; # MATCH IDENTIFIER FOR END #
# OF LIST MATCH #
#
* ITEM DEFINITIONS
#
ITEM DCDNPUNID C(3); # DCD NPU NODE ID #
ITEM CCPLEVEL C(1); # CHARACTER FORM OF CCP LVL #
ITEM LEVMATCH B; # FLAG MATCH OF NCF/CCP LVL #
ITEM NPUINDX U; # NPU INDEX VAR #
ITEM INTNPUNID I; # INTEGER NPU NODE ID #
ITEM OCBORD I; # OCB ORDINAL VALUE #
ITEM PENDING B; # PENDING COMMAND FLAG #
ITEM I I; # LOOP VARIABLE #
ITEM J I; # LOOP VARIABLE #
ITEM TNAME C(10); # OPERATOR TERMINAL NAME #
ITEM SUCCESS B; # FLAG SET AFTER TIMER CANCEL#
#
* FLG$WORD - BASED ARRAY USED TO POINT TO THE REPORT BIT MAPS IN
* THE NPUCB-S.
#
BASED ARRAY FLG$WORD [00:00] S(NPCBSZ$);
BEGIN
ITEM FW$WORD I(00,00,60);
END
#
* SUPMSG - SUPERVISION GAINED MESSAGE ARRAY.
*
* THIS MESSAGE IS ISSUED WHEN SUPERVISION PRIVILEDGE ALLOWED.
#
ARRAY SUPMSG [00:00] S(4);
BEGIN
ITEM SUP$TXT1 C(00,00,05) = ["NPU: "];
ITEM SUP$NAME C(00,30,07); # NPU NAME #
ITEM SUP$TXT2 C(01,12,01) = [","];
ITEM SUP$NID C(01,18,03); # NPU NODE NUMBER #
ITEM SUP$TXT3 C(01,36,20) = [",SUPERVISION GAINED."];
ITEM SUP$ZERO U(03,36,24) = [0];
END
#
* SRJMSG - SUPERVISION REJECTED MESSAGE ARRAY.
*
* THIS MESSAGE IS ISSUED WHEN AN NPU IS REFUSED SUPERVISION.
#
ARRAY SRJMSG [00:00] S(4);
BEGIN
ITEM SRJ$TXT1 C(00,00,05) = ["NPU: "];
ITEM SRJ$NAME C(00,30,07); # NPU NAME #
ITEM SRJ$TXT2 C(01,12,01) = [","];
ITEM SRJ$NID C(01,18,03); # NPU NODE ID #
ITEM SRJ$TXT3 C(01,36,21) = [",NCF VERSION MISMATCH"];
ITEM SRJ$ZERO U(03,42,18) = [0];
END
#
* LDAMSG - LOST DATA MESSAGE.
*
* THIS MESSAGE IS ISSUED TO INFORM THE OPERATOR OF POSSIBLE DATA
* LOSS OCCURRED.
#
ARRAY LDAMSG [00:00] S(5);
BEGIN
ITEM LDA$TXT1 C(00,00,05) = ["NPU: "];
ITEM LDA$NAME C(00,30,07); # NPU NAME #
ITEM LDA$TXT2 C(01,12,01) = [","];
ITEM LDA$NODE C(01,18,03); # NPU NODE NUMBER#
ITEM LDA$TXT3 C(01,36,27) = [",MESSAGE MAY HAVE BEEN LOST"];
ITEM LDA$ZERO U(04,18,42) = [0];
END
#
* DUPSUP - MSG ARRAY FOR DUPLICATE SUP/IN FROM SAME NPU ON SAME
* LOGICAL LINK AS PREVIOUS SUP/IN.
#
ARRAY DUPSUP [00:00] S(4);
BEGIN
ITEM DUP$TXT1 C(00,00,20) = ["CSSANS-DUPLICATE SUP"];
ITEM DUP$TXT2 C(02,00,10) = ["/IN FROM "];
ITEM DUP$NAME C(03,00,07);
ITEM DUP$ZERO U(03,42,18) = [0];
END
#
* MAIN PROC START
#
NPUINDX = 0; # INITIALIZE NPU INDEX #
#
* LOCATE THE NPUCB WITH SAME NODE NUMBER AS THE INCOMING SM SOURCE
* NODE NUMBER. NOTICE THAT A SEARCH MATCH IS ALWAYS SECURED BY
* PLACING THE SEARCH NODE NUMBER AT THE END OF THE NPUCB ARRAY.
#
NPU$NID[CSNPCNT] = ABHSN[0];
NPU$STAT[CSNPCNT] = MATCHID$;
FOR I = 0 STEP 1 WHILE
NPU$NID[I] NQ ABHSN[0]
DO
BEGIN
END
IF NPU$STAT[I] EQ MATCHID$
THEN
BEGIN
WCB$SMID[0] = SMID"SUPINUN";
SSTAQE(P<EVQ>,WCBUF[0],ABH[0],CSSM[0]);
GOTO ENDEXIT;
END
#
* IF SUP/IN RECEIVED FROM NPU ON SAME LOGICAL LINK AS IS CURRENTLY
* SUPERVISED, SEND MSG TO DAYFILE AND DISCARD SUP/IN SM.
#
IF (NPU$HID[I] EQ ABHDN[0] AND
NPU$STAT[I] EQ SUPSTAT"SUP")
THEN
BEGIN
DUP$NAME[0] = NPU$NAME[I];
MESSAGE(DUPSUP[0],0);
GOTO ENDEXIT;
END
ABHWORD[1] = 0; # CLEAR OUTGOING ABH WORD #
#
* A MATCHING NPUCB HAS BEEN FOUND.
* CHECK FOR AN ACTIVE SEND COMMAND ON THE NPUCB. IF SEND ACTIVE,
* INFORM THE SEND OPERATOR OF A POSSIBLE LOST MESSAGE AND CLEAR
* THE SEND OPERATOR ORDINAL OF THE NPUCB.
#
IF NPU$OPSD[I] NQ 0
AND NPU$OPSD[I] LQ MAXACN$
THEN
BEGIN
FOR OCBORD=HOPORD$ STEP 1 UNTIL MAXACN$
DO
BEGIN
P<FLG$WORD> = LOC(NPU$SDFLGS[I]);
SSBTBW(FLG$WORD,OCBORD,PENDING);
IF PENDING
THEN
BEGIN
SSBCBW(FLG$WORD,OCBORD);
OC$CNPU[OCBORD] = 0; # CLEAR NPU ORDINAL #
LDA$NAME[0] = NPU$NAME[I];
LDA$NODE[0] = NPU$DNID[I];
ABHADR[1] = OCBORD;
ABHTLC[1] = LDMSGL$ ;
WCB$SMID[1] = SMID"TTEXT";
WCB$IAF[1] = TRUE;
WCB$WC[1] = 2 + (ABHTLC[1] / 10) + 1;
OC$NCNT[OCBORD] = OC$NCNT[OCBORD] - 1;
IF OC$NCNT[OCBORD] NQ 0
THEN
WCB$IAF[1] = FALSE;
ELSE
OC$UVERB[OCBORD] = 0;
SSTAQE(P<CNQ>,WCBUF[1],ABH[1],LDAMSG[0]);
END
END
END
NPU$OPSD[I] = 0;
#
* CHECK FOR ACTIVE STATUS COMMAND ON NPUCB. IF ACTIVE, PREMATURELY
* END THE STATUS AND INFORM THE STATUS OPERATOR VIA THE STATUS
* FINISHED EVENT TO THE EVENT QUEUE.
#
IF NPU$OPST[I] NQ 0
AND NPU$OPST[I] LQ MAXACN$
THEN
BEGIN
FOR OCBORD=HOPORD$ STEP 1 UNTIL MAXACN$
DO
BEGIN
P<FLG$WORD> = LOC(NPU$STFLGS[I]);
SSBTBW(FLG$WORD,OCBORD,PENDING);
IF PENDING
THEN
BEGIN
SSBCBW(FLG$WORD,OCBORD);
IF OC$CNPU[OCBORD] EQ I
THEN
OC$CNPU[OCBORD] = 0;
OC$NCNT[OCBORD] = OC$NCNT[OCBORD] - 1;
IF OC$NCNT[OCBORD] EQ 0
THEN
BEGIN
ABHADR[1] = OCBORD;
WCB$SMID[1] = SMID"STUFIN";
WCB$WC[1] = 2;
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[1]);
OC$VERB[OCBORD] = " ";
END
END # IF PENDING #
END # FOR OCBORD #
END # IF NPU$OPST #
NPU$OPST[I] = 0;
#
*
* CLEAR CURRENT OVERLAY OPERATOR FOR NPUCB.
#
NPU$OVFLGS[I] = 0;
#
* CLEAR GO RECEIVED FLAG.
#
NPU$GFLAG[I] = FALSE;
#
* THIS NPUCB MAY ALREADY BE SUPERVISED. IF SO, THEN THE SUPERVISION
* REQUEST SM PRECEEDED THE SUPERVISION BROKEN SM (PROBABLY ON A
* DIFFERENT LOGICAL LINK). SIMULATE A SUPERVISION LOST EVENT TO
* THE EVENT QUEUE. WHEN A SUPERVISION BROKEN SM DOES GET PROCESSED
* THE CHECK TO BE SURE THAT THE SM CAME ON THE PROPER LOGICAL
* LINK IS PERFORMED (IN PROC CSSTNS).
#
IF NPU$STAT[I] EQ SUPSTAT"SUP"
THEN
BEGIN
ABHWORD[1] = ABHWORD[0];
WCB$SMID[1] = SMID"SUPCB";
WCB$WC[1] = 2;
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[1]);
END
#
* INITIAILIZE THE NPUCB FROM THE SUPERVISION REQUEST SM.
#
NPU$HID[I] = ABHDN[0]; # SET HOST NODE OF NPUCB #
IF SUPRI[0] EQ 0 # SET REMOTE INDICATOR #
THEN
NPU$RIND[I] = FALSE;
ELSE
NPU$RIND[I] = TRUE;
ABHWORD[1] = ABHWORD[0];
ABHDN[1] = ABHSN[0]; # SET UP OUTGOING DESTINATION#
ABHSN[1] = ABHDN[0]; # SET UP OUTGOING SOURCE #
# SET UP NCF/CCP LEVEL NUMBER COMPARISON #
CCPLEVEL = XCHD(SUPVCVE[0]);
LEVMATCH = (B<12,6>CSNCFLEV EQ CCPLEVEL);
#
* THE REPORTED NCF CHECKSUM VALUE NEEDS TO BE COMPARED WITH THE
* CHECKSUM OF THE CORRESPONDING NPUCB. IF THE SELF-LOADING FLAG
* (THE HI-ORDER BIT OF THE CHECKSUM FIELD) IS NOT SET THEN
* THERE IS NO NEED TO DO THE COMPARE. OTHERWISE, THE FIELDS
* MUST MATCH IN ORDER FOR SUPERVISION TO BE GRANTED.
#
IF ( ( ( SUPVN[0] EQ NPU$CSUM[I] )
AND LEVMATCH )
OR NOT SUPSLF[0] )
THEN
#
* OK TO GRANT SUPERVISION. SET THE NPUCB STATE TO SUPERVISED,
* SET UP THE SUPERVISION REQUEST NORMAL RESPONSE SM FOR OUTPUT.
#
BEGIN
NPU$STAT[I] = SUPSTAT"SUP";
CSNPSUP = CSNPSUP + 1; # INCREMENT SUPER NPUS #
PFCSFC[1] = SUPINN;
WCB$SMID[1] = SMID"SUPINN";
WCB$WC[1] = LSUPINN + 2;
ABHTLC[1] = NSUPINN;
END
ELSE
#
* A NCF CHECKSUM MISMATCH HAS OCCURRED. SET THE STATE OF THE NPUCB
* TO NCF MISMATCH. SET UP THE SUPERVISION REQUEST ABNORMAL RESPONSE
* SM FOR OUTPUT.
#
BEGIN
IF LEVMATCH THEN
NPU$STAT[I] = SUPSTAT"NCFMIS";
ELSE
NPU$STAT[I] = SUPSTAT"LEVMIS";
PFCSFC[1] = SUPINA;
IF NPU$LRF[I] # SET LOAD REQ FLAG #
THEN
SUPLR[1] = 1;
ELSE
SUPLR[1] = 0;
IF NPU$DMPF[I]
THEN
SUPDP[1] = O"131"; # SET ASCII Y FOR DUMP FLAG #
ELSE
SUPDP[1] = O"116"; # SET ASCII N FOR DUMP FLAG #
ABHTLC[1] = NSUPINA;
WCB$SMID[1] = SMID"SUPINA";
WCB$WC[1] = LSUPINA + 2;
END
#
* SEND THE GENERATED SM FOR OUTPUT AND THE CORRESPONDING EVENT TO
* THE EVENT PROCESSOR QUEUE.
#
SSTAQE(P<OTQ>,WCBUF[1],ABH[1],CSSM[1]);
#
* SET UP FOR SUP/IN EVENT TO EVENT PROCESSOR.
#
WCB$WC[1] = WCB$WC[1] + 1;
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[0]);
#
* CLEAR THE NPUCB LOAD REQUEST FLAG AND DUMP FLAG.
#
NPU$LRF[I] = FALSE;
NPU$DMPF[I] = FALSE;
#
* IF THERE IS AN OPERATOR WITH AUTO CONTROL STATUS, THEN SET
* THAT OPERATOR TO BE THE CONTROLLING NOP AND SEND AN EVENT
* INDICATING THAT CONTROL IS GAINED.
#
IF CSACNOP NQ 0
THEN
BEGIN
NPU$CNOP[I] = CSACNOP;
WCB$WORD[1] = 3;
WCB$SMID[1] = SMID"CTRLON";
ABHSN[1] = I;
TNAME = OC$TNAM[CSACNOP];
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],TNAME);
P<FLG$WORD> = LOC(NPU$RFLGS[I]);
SSBSBW( FLG$WORD , CSACNOP );
END
#
* IF THERE IS AN OUTSTANDING GO REQUEST FOR THIS NPU, THEN CANCEL IT
* AND CLEAR THE GO FLAG.
#
IF NPU$GFLAG[I]
THEN
BEGIN
SSCCTR(NPU$CNUM[I],SUCCESS);
NPU$GFLAG[I] = FALSE;
END
ENDEXIT:
END # CSSANS #
TERM