1 /* BEGIN INCLUDE FILE ... hasp_block_record_data.incl.pl1 */
  2 /* Created:  October 1979 by G. Palter */
  3 /* Modified: July 1981 by G. Palter to add SIGNON block template request-acknowledgement block type */
  4 
  5 
  6 /* Template HASP block header */
  7 
  8 dcl 1 TEMPLATE_HASP_BLOCK_HEADER_BITS aligned static options (constant),
  9     2 dle bit (9) unaligned initial ("020"b3),              /* DLE */
 10     2 stx bit (9) unaligned initial ("002"b3),              /* STX */
 11     2 bcb bit (9) unaligned initial ("000"b3),              /* block count byte (BCB) */
 12     2 fcs bit (18) unaligned initial ("000000"b3);          /* function control sequence (FCS) */
 13 
 14 dcl 1 TEMPLATE_HASP_BLOCK_HEADER aligned based (addr (TEMPLATE_HASP_BLOCK_HEADER_BITS)),
 15     2 text1 character (2) unaligned,                        /* not referenced by the program */
 16     2 bcb character (1) unaligned,
 17     2 fcs character (2) unaligned;
 18 
 19 
 20 /* Template HASP block trailer */
 21 
 22 dcl 1 TEMPLATE_HASP_BLOCK_TRAILER_BITS aligned static options (constant),
 23     2 non_crc unaligned,                                    /* all but the CRC:  actually sent to FNP */
 24       3 eob_rcb bit (9) unaligned initial ("000"b3),        /* record control byte (RCB) indicating end of block */
 25       3 dle bit (9) unaligned initial ("020"b3),            /* DLE */
 26       3 etb bit (9) unaligned initial ("046"b3),            /* ETB */
 27     2 crc bit (18) unaligned initial ("000000"b3);          /* CRC:  added by FNP--not transmitted */
 28 
 29 dcl 1 TEMPLATE_HASP_BLOCK_TRAILER aligned based (addr (TEMPLATE_HASP_BLOCK_TRAILER_BITS)),
 30     2 non_crc character (3) unaligned,                      /* not referenced by programs */
 31     2 crc character (2) unaligned;
 32 
 33 
 34 /* Template HASP SIGNON record block */
 35 
 36 dcl 1 TEMPLATE_HASP_SIGNON_BLOCK_BITS aligned static options (constant),
 37       2 start_dle bit (9) unaligned initial ("020"b3),      /* DLE */
 38       2 stx bit (9) unaligned initial ("002"b3),            /* STX */
 39       2 bcb bit (9) unaligned initial ("240"b3),            /* BCB -- ignored */
 40       2 fcs bit (18) unaligned initial ("217317"b3),        /* FCS -- set by finish_output_block */
 41       2 rcb bit (9) unaligned initial ("360"b3),            /* RCB -- general control record */
 42       2 srcb bit (9) unaligned initial ("301"b3),           /* SRCB -- indicates SIGNON record */
 43       2 record_bits bit (720) unaligned initial (""b),      /* actual SIGNON record */
 44       2 eob_scb bit (9) unaligned initial ("000"b3),        /* SCB -- indicates end of record */
 45       2 eob_rcb bit (9) unaligned initial ("000"b3),        /* RCB -- indicates end of block */
 46       2 end_dle bit (9) unaligned initial ("020"b3),        /* DLE */
 47       2 etb bit (9) unaligned initial ("046"b3);            /* ETB */
 48 
 49 dcl 1 TEMPLATE_HASP_SIGNON_BLOCK aligned based (addr (TEMPLATE_HASP_SIGNON_BLOCK_BITS)),
 50       2 non_trailer,                                        /* all but the trailer and CRC characters */
 51         3 header character (7) unaligned,
 52         3 record character (80) unaligned,                  /* the actual text of the record */
 53         3 text1 character (1) unaligned,
 54       2 trailer character (3) unaligned;                    /* supplied by finish_output_block */
 55 
 56 
 57 /* Template HASP bad BCB block:  transmitted when one side receives a block with an invalid BCB count */
 58 
 59 dcl 1 TEMPLATE_HASP_BAD_BCB_BLOCK_BITS aligned static options (constant),
 60     2 start_dle bit (9) unaligned initial ("020"b3),        /* DLE */
 61     2 stx bit (9) unaligned initial ("002"b3),              /* STX */
 62     2 bcb bit (9) unaligned initial ("220"b3),              /* BCB -- contains the received (bad) count */
 63     2 fcs bit (18) unaligned initial ("217317"b3),          /* FCS */
 64     2 rcb bit (9) unaligned initial ("340"b3),              /* RCB -- bad BCB record */
 65     2 srcb bit (9) unaligned initial ("200"b3),             /* SRCB -- contains the expected count */
 66     2 eor_scb bit (9) unaligned initial ("000"b3),          /* SCB -- indicates end of record */
 67     2 eob_rcb bit (9) unaligned initial ("000"b3),          /* RCB -- indicates end of block */
 68     2 end_dle bit (9) unaligned initial ("020"b3),          /* DLE */
 69     2 etb bit (9) unaligned initial ("046"b3);              /* ETB */
 70 
 71 dcl 1 TEMPLATE_HASP_BAD_BCB_BLOCK aligned based (addr (TEMPLATE_HASP_BAD_BCB_BLOCK_BITS)),
 72     2 text1 character (2) unaligned,                        /* not referenced by programs */
 73     2 bcb character (1) unaligned,
 74     2 text2 character (3) unaligned,                        /* not referenced by programs */
 75     2 srcb character (1) unaligned,
 76     2 text3 character (4) unaligned;                        /* not referenced by programs */
 77 
 78 
 79 /* Template HASP synchronization block */
 80 
 81 dcl 1 TEMPLATE_HASP_SYNC_BLOCK_BITS aligned static options (constant),
 82     2 start_dle bit (9) unaligned initial ("020"b3),        /* DLE */
 83     2 stx bit (9) unaligned initial ("002"b3),              /* STX */
 84     2 bcb bit (9) unaligned initial ("000"b3),              /* BCB -- ignored */
 85     2 fcs bit (18) unaligned initial ("237377"b3),          /* FCS -- bits 2&3 (0-based) of second byte => sync block */
 86     2 eob_rcb bit (9) unaligned initial ("000"b3),          /* RCB -- indicates end of block */
 87     2 end_dle bit (9) unaligned initial ("020"b3),          /* DLE */
 88     2 etb bit (9) unaligned initial ("046"b3);              /* ETB */
 89 
 90 dcl 1 TEMPLATE_HASP_SYNC_BLOCK aligned based (addr (TEMPLATE_HASP_SYNC_BLOCK_BITS)),
 91     2 text1 character (8) unaligned;                        /* actual parts never referenced */
 92 
 93 
 94 /* HASP record types */
 95 
 96 dcl (HASP_EOB_RECORD initial (1),                           /* end of transmission block */
 97      HASP_EOF_RECORD initial (2),                           /* end of file block */
 98      HASP_SIGNON_RECORD initial (3),                        /* SIGNON card */
 99      HASP_RTS_RECORD initial (4),                           /* request-to-send file */
100      HASP_RTS_ACK_RECORD initial (5),                       /* request-to-send file granted */
101      HASP_BAD_BCB_RECORD initial (6),                       /* bad block count detected record */
102      HASP_DATA_RECORD initial (7))                          /* ordinary data record */
103           fixed binary static options (constant);
104 
105 
106 /* Constant RCB, SRCB, and SCB characters used only by the multiplexer */
107 
108 dcl (HASP_EOB_RCB_BITS        initial ("000"b3),            /* RCB -- end of transmission block */
109      HASP_GENERAL_CONTROL_RCB_BITS initial ("360"b3),       /* RCB -- generalized control record (eg: SIGNON record) */
110      HASP_CONSOLE_INPUT_RCB_BITS  initial ("222"b3),        /* RCB -- record from console to host */
111      HASP_CONSOLE_OUTPUT_RCB_BITS initial ("221"b3),        /* RCB -- record from host to console */
112      HASP_SIGNON_SRCB_BITS    initial ("301"b3),            /* SRCB -- SIGNON record */
113      HASP_EOF_SRCB_BITS       initial ("200"b3),            /* SRCB -- end of file record */
114      HASP_EOF_FIRST_SCB_BITS  initial ("000"b3))            /* SCB -- first SCB in an end of file record */
115           bit (9) aligned static options (constant);
116 
117 dcl (HASP_EOB_RCB             based (addr (HASP_EOB_RCB_BITS)),
118      HASP_GENERAL_CONTROL_RCB based (addr (HASP_GENERAL_CONTROL_RCB_BITS)),
119      HASP_CONSOLE_INPUT_RCB   based (addr (HASP_CONSOLE_INPUT_RCB_BITS)),
120      HASP_CONSOLE_OUTPUT_RCB  based (addr (HASP_CONSOLE_OUTPUT_RCB_BITS)),
121      HASP_SIGNON_SRCB         based (addr (HASP_SIGNON_SRCB_BITS)),
122      HASP_EOF_SRCB            based (addr (HASP_EOF_SRCB_BITS)),
123      HASP_EOF_FIRST_SCB       based (addr (HASP_EOF_FIRST_SCB_BITS)))
124           character (1) aligned;
125 
126 
127 /* Template HASP bad BCB record (see above) */
128 
129 dcl 1 TEMPLATE_HASP_BAD_BCB_RECORD_BITS aligned static options (constant),
130     2 rcb bit (9) unaligned initial ("340"b3),              /* RCB -- bad BCB record */
131     2 srcb bit (9) unaligned initial ("200"b3),             /* SRCB -- contains expected count */
132     2 eor_scb bit (9) unaligned initial ("000"b3);
133 
134 dcl 1 TEMPLATE_HASP_BAD_BCB_RECORD aligned based (addr (TEMPLATE_HASP_BAD_BCB_RECORD_BITS)),
135     2 rcb character (1) unaligned,
136     2 srcb character (1) unaligned,
137     2 eor_scb character (1) unaligned;
138 
139 
140 /* Template HASP request-to-send record */
141 
142 dcl 1 TEMPLATE_HASP_RTS_RECORD_BITS aligned static options (constant),
143     2 rcb bit (9) unaligned initial ("220"b3),              /* RCB -- request permission to transmit file */
144     2 srcb bit (9) unaligned initial ("000"b3),             /* SRCB -- RCB of the device requesting permission */
145     2 eor_scb bit (9) unaligned initial ("000"b3);          /* SCB --  end of record */
146 
147 dcl 1 TEMPLATE_HASP_RTS_RECORD aligned based (addr (TEMPLATE_HASP_RTS_RECORD_BITS)),
148     2 rcb character (1) unaligned,
149     2 srcb character (1) unaligned,
150     2 eor_scb character (1) unaligned;
151 
152 
153 /* Template HASP request-to-send acknowledgement record */
154 
155 dcl 1 TEMPLATE_HASP_RTS_ACK_RECORD_BITS aligned static options (constant),
156     2 rcb bit (9) unaligned initial ("240"b3),              /* RCB -- permission granted to send file */
157     2 srcb bit (9) unaligned initial ("000"b3),             /* SRCB -- RCB of the device granted permission */
158     2 eor_scb bit (9) unaligned initial ("000"b3);
159 
160 dcl 1 TEMPLATE_HASP_RTS_ACK_RECORD aligned based (addr (TEMPLATE_HASP_RTS_ACK_RECORD_BITS)),
161     2 rcb character (1) unaligned,
162     2 srcb character (1) unaligned,
163     2 eor_scb character (1) unaligned;
164 
165 
166 /* HASP Block Control Byte (BCB) */
167 
168 dcl 1 hasp_bcb_byte unaligned based (hasp_bcb_byte_ptr),
169     2 pad1 bit (1) unaligned,                               /* padding supplied by MCS */
170     2 mbo1 bit (1) unaligned,                               /* always ON */
171     2 type fixed binary (3) unaligned unsigned,             /* type of BCB -- normal/ignore/reset */
172     2 count fixed binary (4) unaligned unsigned;            /* the block count */
173 
174 dcl  hasp_bcb_byte_ptr pointer;
175 
176 dcl (HASP_BCB_NORMAL                    initial (0),        /* normal BCB */
177      HASP_BCB_IGNORE                    initial (1),        /* normal: ignore this block count;
178                                                                in bad-BCB block: expected block count */
179      HASP_BCB_RESET                     initial (2))        /* reset exepected block count to this value */
180           fixed binary (3) unsigned static options (constant);
181 
182 
183 /* HASP Function Control Sequence (FCS) */
184 
185 dcl 1 hasp_fcs_bytes unaligned based (hasp_fcs_bytes_ptr),
186     2 pad1 bit (1) unaligned,                               /* padding supplied by MCS (byte 1) */
187     2 mbo1 bit (1) unaligned,                               /* always ON */
188     2 system_wab bit (1) unaligned,                         /* ON => sending site wants all data transmissions stopped */
189     2 mcs1 unaligned,                                       /* bits used by FNP and ring-0 multiplexer */
190       3 device_not_ready bit (1) unaligned,                 /* (from FNP): ON => some individual device went not ready */
191       3 returned_data bit (1) unaligned,                    /* (from FNP): ON => this is output block returned by FNP */
192     2 wab_bits1 (4) bit (1) unaligned,                      /* OFF => suspend data transmissions for this device */
193     2 pad2 bit (1) unaligned,                               /* padding supplied by MCS (byte 2) */
194     2 mbo2 bit (1) unaligned,                               /* always ON */
195     2 console_wab bit (1) unaligned,                        /* OFF => suspend data transmissions to/from console */
196     2 mcs2 unaligned,                                       /* bits used by FNP and ring-0 multiplexer */
197       3 block_type fixed binary (2) unaligned unsigned,     /* type of block -- normal/sync */
198     2 wab_bits2 (4) bit (1) unaligned;                      /* OFF => suspend data transmissions for this device */
199 
200 dcl  hasp_fcs_bytes_ptr pointer;
201 
202 dcl (HASP_FCS_NORMAL_BLOCK              initial (0),        /* normal block */
203      HASP_FCS_ACKNOWLEDGE_BLOCK         initial (1),        /* requests FNP to acknowledge when block is sent */
204      HASP_FCS_SYNC_BLOCK                initial (3))        /* synchronization block to terminate FNP loopback mode */
205           fixed binary (2) unsigned static options (constant);
206 
207 /* END INCLUDE FILE ... hasp_block_record_data.incl.pl1 */