*DECK CSSTCM
USETEXT TEXTSS;
USETEXT TEXTCS;
USETEXT TXTSMCS;
USETEXT TXCMDCS;
USETEXT TXTAPSS;
USETEXT TXTSUSS;
PROC CSSTCM;
# TITLE CSSTCM - TERMINATE A COMMAND #
BEGIN
#
** CSSTCM - TERMINATE A COMMAND.
*
* C. BRION 82/05/06.
*
* THIS PROCEDURE PROCESSES THE BREAK AS A COMMAND TO TERMINATE THE
* CURRENT COMMAND.
*
* PROC CSSTCM
*
* ENTRY:
*
* HDRCMD = THE COMMAND HEADER WORD.
* ABH = THE ROUTED COMMAND HEADER WORD THAT CONTAINS THE ORDINAL
* OF THE OPERATOR THAT ENTERED THE BREAK.
*
* EXIT:
*
* THE OCB AND AFFECTED NPUCBS WILL BE CLEARED AND AN EVENT MAY BE
* BE SENT TO THE EVENT QUEUE OR A NULL TERMINAL TEXT ENTRY MAY BE
* SENT TO THE CONNECTION TRAFFIC QUEUE.
*
#
#
**** PROC CSSTCM XREF LIST
#
XREF
BEGIN
PROC SSBCBW; # SS-CLEAR BIT IN WORD #
PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
END
#
****
#
ITEM OORD U; # OCB ORDINAL VAR #
ITEM I;
ITEM DVAR;
#
* FLG$WORD - THIS BASED ARRAY IS USED TO POINT TO THE PENDING
* COMMAND REQUEST WORDS IN THE NPUCB-S.
#
BASED ARRAY FLG$WORD [00:00] S(NPCBSZ$);
BEGIN
ITEM FW$WORD I(00,00,60);
END
WCB$WORD[1] = 0;
ABHWORD[1] = 0;
OORD = HDR$OPORD[0];
ABHADR[1] = OORD; # SET OCB ORDINAL #
WCB$WC[1] = 2;
WCB$IAF[1] = TRUE;
#
* IF THE CURRENT COMMAND IN PROGRESS IS A STATUS COMMAND, CLEAR
* THE NPUCB(S) AFFECTED, CLEAR THE OCB AND SEND A STATUS DONE
* EVENT TO THE EVENT QUEUE.
* THE NPUCB IS SET SO THAT AFTER THE STATUS IS FINISHED, THE
* PROC CSSCSR (COMPLETE STATUS REQUEST) WILL SEE A OCB OUT
* OF RANGE AND THEN KNOW THAT THE OPERATOR TERMINATED THE COM-
* MAND.
#
IF OC$VERB[OORD] EQ "ST0"
THEN
BEGIN
P<FLG$WORD> = LOC(NPU$STFLGS[0]);
FOR I=0 STEP 1 WHILE I LS CSNPCNT
DO
BEGIN
SSBCBW(FLG$WORD[I],OORD);
END
IF OC$CNPU[OORD] NQ 0
THEN
BEGIN
NPU$OPST[OC$CNPU[OORD]] = MAXACN$ + 1;
END
OC$NCNT[OORD] = 0; #CLEAR AFFECTED NPU COUNT #
OC$UVERB[OORD] = 0;
WCB$SMID[1] = SMID"STUFIN";
SSTAQE(P<EVQ>,WCBUF[1],ABH[1],CSSM[1]);
END
#
* IF THE CURRENT COMMAND IS A SEND COMMAND, LOCATE ALL NPUCBS
* THAT MAY BE INVOLVED AND MARK THE SEND OPERATOR ORDINAL OUT
* OF RANGE SO AS TO CAUSE THE NPU RESPONSE TO BE DISCARDED BY
* THE CSSCHB ROUTINE WHEN IT ARRIVES. ISSUE A NULL TERMINAL TEXT
* IN ORDER TO CAUSE THE READY.. MESSAGE TO BE ISSUED. CLEAR THE
* SEND NPU COUNT OF THE OCB.
#
IF (OC$VERB[OORD] EQ "SE0" OR
OC$VERB[OORD] EQ "SE1")
THEN
BEGIN
P<FLG$WORD> = LOC(NPU$SDFLGS[0]);
FOR I = 0 STEP 1 UNTIL (CSNPCNT - 1)
DO
BEGIN
SSBCBW(FLG$WORD[I],OORD);
IF NPU$OPSD[I] EQ OORD
THEN
BEGIN
NPU$OPSD[I] = MAXACN$ + 1;
END
END
OC$NCNT[OORD] = 0;
OC$CNPU[OORD] = 0;
OC$UVERB[OORD] = 0;
SSTAQE(P<CNQ>,WCBUF[1],ABH[1],CSSM[1]);
END
#
* IF THE CURRENT CMD IS A TEST,REQUEST, THEN CLEAR THE NPUCB AND THE
* OCB OF THE REQUEST IN A MANNER THAT WILL ACCOUNT FOR THE RESPONSE
* BACK FROM THE NPU.
#
IF OC$VERB[OORD] EQ "TS0"
THEN
BEGIN
P<FLG$WORD> = LOC(NPU$OVFLGS[OC$CNPU[OORD]]);
SSBCBW(FLG$WORD,OORD);
OC$CNPU[OORD] = 0;
OC$UVERB[OORD] = 0;
END
DVAR = 1;
END # CSSTCM #
TERM