1 /* BEGIN INCLUDE FILE ... hasp_mpx_data.incl.pl1 */
  2 /* Created: September-October 1979 by G. Palter */
  3 /* Modified: December 1980 by G. Palter as part of "loopback bug" fix */
  4 /* Modified: 30 March 1981 by G. Palter to add last_loopback_bcb */
  5 /* Modified: 24 July 1981 by G. Palter to add hmd_signon_data, update minor states, and add metering data */
  6 
  7 
  8 /* HASP multiplexer data */
  9 
 10 dcl 1 hmd aligned based (hmd_ptr),
 11     2 name character (32) unaligned,                        /* name of major channel */
 12     2 devx fixed binary,                                    /* device (LCT) index of the channel */
 13     2 configuration_data like hasp_configuration_data,      /* data supplied by load operation that controls multiplexer
 14                                                                operation (EG: type, block size, etc.) */
 15     2 loader_process_id bit (36),                           /* process to be notified on state change for multiplexer */
 16     2 loader_event_channel fixed binary (71),               /* ... and the channel to be used */
 17     2 dialup_info like dialup_info,                         /* information saved from DIALUP interrupt */
 18     2 state fixed binary,                                   /* state of multiplexer -- down/loading/loaded/started */
 19     2 minor_state fixed binary,                             /* state when running -- normal/need sync/loopback/etc. */
 20     2 foreign_block_count fixed binary,                     /* # of last block received from foreign side */
 21     2 foreign_fcs_bytes character (2) unaligned,            /* last FCS received from foreign side */
 22     2 local_block_count fixed binary,                       /* # of last block sent by multiplexer */
 23     2 local_fcs_bytes character (2) unaligned,              /* last FCS sent by multiplexer */
 24     2 subchannels_for_output,                               /* a queue of sub-channels waiting SEND OUTPUT interrupts */
 25       3 first fixed binary,                                 /* ... index of first sub-channel to interrupt */
 26       3 last fixed binary,                                  /* ... index of last sub-channel */
 27     2 output_chain_ptr pointer,                             /* -> chain of buffers presently being sent to the FNP */
 28     2 input,                                                /* chain of input blocks waiting to be split into records */
 29       3 first_bufferp pointer,                              /* ... -> first buffer in the chain */
 30       3 last_bufferp pointer,                               /* ... -> last buffer in the chain */
 31     2 loopback,                                             /* chain of loopbacked blocks waiting to be retransmitted */
 32       3 first_bufferp pointer,
 33       3 last_bufferp pointer,
 34     2 output_block,                                         /* the output block presently being constructed */
 35       3 subchannel_idx fixed binary,                        /* ... sub-channel whose records are contained in this block,
 36                                                                    or -1 if this block contains records from several */
 37       3 tally fixed binary,                                 /* ... # of characters in the block */
 38       3 first_bufferp pointer,                              /* ... -> first buffer in the block */
 39       3 last_bufferp pointer,                               /* ... -> last buffer in the block */
 40     2 signon_data_ptr pointer,                              /* -> data needed to send a SIGNON record */
 41     2 minor_state_stack pointer,                            /* -> top of minor state stack */
 42     2 loopback_block_chain_stack pointer,                   /* -> top of loopback block chain stack */
 43     2 last_loopback_bcb character (1) unaligned,            /* BCB character of last block loopbacked from FNP */
 44     2 pad bit (27) unaligned,
 45     2 bit_arrays aligned,
 46       3 input_wabs (0:8) bit (1) unaligned,                 /* input wait-a-bits:  OFF => input device not ready; foreign
 47                                                                 side should not send further data */
 48       3 output_wabs (0:8) bit (1) unaligned,                /* output wait-a-bits:  OFF => output device not ready;
 49                                                                multiplexer should not send further data */
 50       3 send_rts (0:8) bit (1) unaligned,                   /* ON => an RTS record should be sent */
 51       3 send_rts_ack (0:8) bit (1) unaligned,               /* ON => an RTS acknowledgement record should be sent */
 52     2 flags aligned,
 53       3 suspend_all_output bit (1) unaligned,               /* ON => don't send any output at all to foreign side */
 54       3 suspend_all_input bit (1) unaligned,                /* ON => foreign side should send no input:  this flag is only
 55                                                                set while multiplexer is loaded but not started */
 56       3 send_output bit (1) unaligned,                      /* ON => have permission to send data to FNP */
 57       3 input_available bit (1) unaligned,                  /* ON => input is being held for us by our parent */
 58       3 output_in_progress bit (1) unaligned,               /* ON => a data block is being sent to the FNP */
 59       3 first_foreign_block bit (1) unaligned,              /* ON => first block yet to arrive from foreign side; when it
 60                                                                does, accept it's block count without question */
 61       3 reset_local_block_count bit (1) unaligned,          /* ON => set local block count to known value in next block */
 62       3 retry_transmit_output bit (1) unaligned,            /* ON => write to the parent failed: lack of room */
 63       3 retry_process_output bit (1) unaligned,             /* ON => call to process_output_block failed: lack of room */
 64       3 retry_process_loopback_records bit (1) unaligned,   /* ON => call to process_loopback_records failed: no room */
 65       3 retry_process_input bit (1) unaligned,              /* ON => call to process_input_block failed: lack of room */
 66       3 pad bit (25) unaligned,
 67     2 time_mpx_booted fixed binary (71),                    /* date/time when multiplexer completed loading */
 68     2 time_meters_copied fixed binary (71),                 /* date/time multiplexer meters were last saved */
 69     2 meters like hasp_mpx_meters,                          /* interesting events */
 70     2 saved_meters_ptr pointer,                             /* -> hasp_mpx_meters structure for copy_meters order */
 71     2 console_hste_idx fixed binary,                        /* index of sub-channel data for operator's console */
 72     2 n_subchannels fixed binary,                           /* # of sub-channels configured in this multiplexer */
 73     2 subchannels (hmd_n_subchannels refer (hmd.n_subchannels)) like hste;
 74 
 75 dcl  hmd_ptr pointer;
 76 dcl  hmd_n_subchannels fixed binary;                        /* to allocate hmd structure */
 77 
 78 dcl (HMD_DOWN                 initial (1),                  /* multiplexer is down */
 79      HMD_LOADING              initial (2),                  /* multiplexer is being loaded */
 80      HMD_LOADED               initial (3),                  /* multiplexer has been successfully loaded */
 81      HMD_STARTED              initial (4))                  /* multiplexer has been started (will dialup sub-channels) */
 82           fixed binary static options (constant);
 83 
 84 dcl (HMD_SEND_SIGNON          initial (1),                  /* multiplexer waiting to transmit a SIGNON record */
 85      HMD_WAIT_SIGNON_RESPONSE initial (2),                  /* multiplexer is waiting for remote system's response */
 86      HMD_NORMAL               initial (3),                  /* normal data transfer */
 87      HMD_SEND_SYNC_BLOCK      initial (4),                  /* multiplexer must send special block to FNP to cause the FNP
 88                                                                to stop loopback process */
 89      HMD_LOOPBACK             initial (5),                  /* FNP is returning previous output of multiplexer */
 90      HMD_REPROCESS            initial (6),                  /* multiplexer is making initial pass over records loopbacked
 91                                                                by FNP: records are being rewritten or saved */
 92      HMD_SEND_BAD_BCB_BLOCK   initial (7),                  /* multiplexer must send bad BCB block on next SEND OUTPUT */
 93      HMD_HANGUP_LINE          initial (8))                  /* multiplexer must hangup the line on next SEND OUTPUT */
 94           fixed binary static options (constant);
 95 
 96 
 97 /* HASP sub-channel data */
 98 
 99 dcl 1 hste aligned based (hste_ptr),
100     2 name character (8) unaligned,                         /* name of device excluding name of multiplexer */
101     2 subchannel_idx fixed binary,                          /* index of this entry in hmd.subchannels array */
102     2 device_type fixed binary,                             /* type of device -- console/reader/printer/punch */
103     2 direction fixed binary,                               /* direction of transfers permitted */
104     2 devx fixed binary,                                    /* channel (LCT) index of this subchannel */
105     2 rcb character (1) unaligned,                          /* the RCB for this sub-channel */
106     2 device_wab_idx fixed binary,                          /* index in wait-a-bit arrays for this device */
107     2 dialup_info aligned like dialup_info,                 /* information for DIALUP interrupt */
108     2 state fixed binary,                                   /* state of sub-channel -- hungup/listening/dialed */
109     2 minor_state fixed binary,                             /* clarification of dialed-up state --
110                                                                   normal/send-rts/wait-ack */
111     2 next_subchannel_for_output fixed binary,              /* # of next sub-channel to receive SEND OUTPUT after us */
112     2 input,                                                /* input records waiting to be supplied to user ring */
113       3 n_records fixed binary,                             /* ... # of records in the chain */
114       3 first_bufferp pointer,                              /* ... -> first buffer in chain:  individual records are
115                                                                       separated by buffer.break */
116       3 last_bufferp pointer,                               /* ... -> last buffer in chain */
117     2 loopback,                                             /* loopbacked records waiting to be transmitted */
118       3 n_records fixed binary,                             /* ... # of records (not used) */
119       3 first_bufferp pointer,
120       3 last_bufferp pointer,
121     2 output,                                               /* partial output record taken from tty_write to allow ... */
122       3 first_bufferp pointer,                              /* ... MCS to request yet more output from the user */
123       3 last_bufferp pointer,
124     2 flags aligned,
125       3 requested_input bit (1) unaligned,                  /* ON => read called with no input available:  send interrupt
126                                                                 when some becomes available */
127       3 input_available bit (1) unaligned,                  /* ON => some input is present in an as yet not completely
128                                                                processed block:  send this sub-channel an interrupt */
129       3 holding_output bit (1) unaligned,                   /* ON => write called but not all output taken:  send
130                                                                interrupt when more output may be processed */
131       3 pad bit (33) unaligned,
132     2 meters like hasp_subchannel_meters,                   /* interesting events for this subchannel */
133     2 saved_meters_ptr pointer;                             /* -> hasp_subchannel_meters structure for copy_meters call */
134 
135 dcl  hste_ptr pointer;
136 
137 dcl (HSTE_HUNGUP              initial (1),                  /* sub-channel is hungup */
138      HSTE_LISTENING           initial (2),                  /* sub-channel is waiting for a dialup from major channel */
139      HSTE_DIALED              initial (3))                  /* sub-channel is dialed-up and capable of data transfer under
140                                                                the control of the following minor states */
141           fixed binary static options (constant);
142 
143 dcl (HSTE_NORMAL              initial (1),                  /* sub-channel is in normal data transfer */
144      HSTE_SEND_RTS            initial (2),                  /* sub-channel needs to request permission from foreign side
145                                                                to transmit a file */
146      HSTE_WAIT_RTS_ACK        initial (3))                  /* sub-channel is waiting for permission from foreign side */
147           fixed binary static options (constant);
148 
149 dcl (HSTE_INPUT_OUTPUT        initial (0),                  /* device can perform input and output */
150      HSTE_INPUT_ONLY          initial (1),                  /* device can perform input only */
151      HSTE_OUTPUT_ONLY         initial (2))                  /* device can perform output only */
152           fixed binary static options (constant);
153 
154 
155 /* Data required to transmit a SIGNON record to the remote host */
156 
157 dcl 1 hmd_signon_data aligned based (hsd_ptr),
158       2 processid bit (36),                                 /* process to be informed of results */
159       2 pad bit (36),
160       2 event_channel fixed binary (71),                    /* IPC event channel on which signal is sent */
161       2 record character (80) unaligned;                    /* the actual SIGNON record */
162 
163 dcl  hsd_ptr pointer;
164 
165 
166 /* HASP minor state stack entry */
167 
168 dcl 1 msse aligned based (msse_ptr),
169     2 previous pointer,                                     /* -> prior entry on the stack */
170     2 minor_state fixed binary,                             /* minor state of multiplexer when this entry created */
171     2 subchannels (hmd.n_subchannels),
172       3 loopback,                                           /* subchannel's loopback chain when this entry created */
173         4 n_records fixed binary,
174         4 first_bufferp pointer,
175         4 last_bufferp pointer;
176 
177 dcl  msse_ptr pointer;
178 
179 
180 /* HASP loopback block chain stack entry */
181 
182 dcl 1 lbcse aligned based (lbcse_ptr),
183     2 previous pointer,                                     /* -> previous entry on the stack */
184     2 loopback,                                             /* loopback block chain when this entry was created */
185       3 first_bufferp pointer,
186       3 last_bufferp pointer;
187 
188 dcl  lbcse_ptr pointer;
189 
190 /* END INCLUDE FILE ... hasp_mpx_data.incl.pl1 */