1 /* Begin include file ..... ibm3270_attach_data.incl.pl1 */
  2 
  3 /* Attach data block for the ibm3270_ I/O module */
  4 /* Written October 1977 by Larry Johnson */
  5 
  6 dcl  adp ptr;
  7 
  8 dcl 1 ad aligned based (adp),
  9     2 work_areap ptr,                                       /* Pointer to work area containing this structure */
 10     2 device char (6),                                      /* Name of channel attached */
 11     2 tty_index fixed bin,                                  /* Ring0 name for channel */
 12     2 attach_description char (256) var,
 13     2 open_description char (24) var,
 14     2 wait_list aligned,
 15       3 nchan fixed bin,                                    /* Number of channels to block on */
 16       3 user_channel fixed bin (71),                        /* The channel */
 17     2 attach_channel fixed bin (71),                        /* For talking to ansering service */
 18     2 io_channel fixed bin (71),                            /* Channel used by ring 0 */
 19     2 timer_channel fixed bin (71),                         /* Channel for error recovery timer */
 20     2 controller fixed bin,                                 /* Address of controller, usually 0 */
 21     2 open_in_progress bit (1),                             /* Indicates we are blockig during open */
 22     2 close_in_progress bit (1),                            /* In process of closing switch, be careful of wakeups */
 23     2 open_wakeup_occured bit (1),                          /* Got answering service wakeup at open */
 24     2 open_event_message fixed bin (71),                    /* Temp copy of open event message */
 25     2 ascii bit (1),                                        /* Set if running in ascii mode */
 26     2 async bit (1),                                        /* Indicates the I/O module must not block ever */
 27     2 eot char (1),                                         /* Some char codes */
 28     2 stx char (1),
 29     2 etx char (1),
 30     2 etb char (1),
 31     2 soh char (1),
 32     2 esc char (1),
 33     2 sf char (1),                                          /* Start field */
 34     2 sba char (1),                                         /* Set buffer address */
 35     2 ic char (1),                                          /* Insert cursor */
 36     2 pt char (1),                                          /* Program tab */
 37     2 ra char (1),                                          /* Repeat to address */
 38     2 eua char (1),                                         /* Erase unprotected to address */
 39     2 bit6_char (0:63) char (1) unal,                       /* Maps 6 bit codes into ebcdic characters */
 40     2 first_read_infop ptr,                                 /* First input block */
 41     2 last_read_infop ptr,                                  /* Last input block */
 42     2 header_data,                                          /* Header is build here */
 43       3 header_buf_ptr ptr,                                 /* Addr of start of header */
 44       3 header_buf_len fixed bin,                           /* Lemgth of header buffer */
 45       3 header_len fixed bin,                               /* Length of data */
 46     2 text_data,                                            /* Text is built here */
 47       3 text_buf_ptr ptr,                                   /* Addr of start of text */
 48       3 text_buf_len fixed bin,                             /* Length of text_buffer */
 49       3 text_len fixed bin,                                 /* Length of real data */
 50     2 input_buf_ptr ptr,                                    /* Address of input buffer */
 51     2 input_buf_len fixed bin,                              /* Its length */
 52     2 unscanned_data_ptr ptr,                               /* Addr of next char in inpput buffer to scan */
 53     2 unscanned_data_len fixed bin,                         /* Number of chars remaining */
 54     2 input_state fixed bin,                                /* Current state of text scan */
 55     2 output_buf_ptr ptr,                                   /* Buffer for building output messages */
 56     2 output_buf_len fixed bin,                             /* Its length */
 57     2 polling_in_progress bit (1),                          /* Set during polling operation */
 58     2 device_responded bit (1),                             /* Set if polling resulted in real data coming back */
 59     2 general_poll bit (1),                                 /* User is doing general_poll */
 60     2 first_poll_reqp ptr,                                  /* Pointer to first queued poll request */
 61     2 last_poll_reqp ptr,                                   /* Pointer to last polled request */
 62     2 wakeup_needed bit (1),                                /* Set if caller needes wakeup when data available */
 63     2 last_device_polled fixed bin,                         /* Last poll address sent to fnp */
 64     2 last_device_selected fixed bin,                       /* Last select address sent to fnp */
 65     2 cur_out_reqp ptr,                                     /* Current output request */
 66     2 output_in_progress bit (1),                           /* Set while doing output */
 67     2 per_dev (0:31),                                       /* Data on output to each device */
 68       3 first_out_reqp ptr,                                 /* Addr of first request in its queue */
 69       3 last_out_reqp ptr,                                  /* Addr of last request in its queue */
 70       3 pend_time fixed bin (71),                           /* Time at which output should be retryed */
 71     2 min_dev fixed bin,                                    /* Index of lowest device which currently has output pended */
 72     2 max_dev fixed bin,                                    /* Index of highest device */
 73     2 pend_interval fixed bin (71),                         /* Time interval for retrying otput */
 74     2 retry_limit fixed bin,                                /* Times to retry output to non-ready devices */
 75     2 input_line_status fixed bin,                          /* Input error code */
 76     2 output_line_status fixed bin,                         /* Output error code */
 77     2 processid bit (36);
 78 
 79 dcl  work_area area based (ad.work_areap);
 80 dcl  header_buf char (ad.header_buf_len) based (ad.header_buf_ptr); /* Header built here */
 81 dcl  header_data char (ad.header_len) based (ad.header_buf_ptr);
 82 dcl  text_buf char (ad.text_buf_len) based (ad.text_buf_ptr); /* Text built here */
 83 dcl  text_data char (ad.text_len) based (ad.text_buf_ptr);
 84 dcl  input_buf char (ad.input_buf_len) based (ad.input_buf_ptr); /* Raw data read here */
 85 dcl  unscanned_data char (ad.unscanned_data_len) based (ad.unscanned_data_ptr); /* Unprocessed part of input_buf */
 86 dcl  output_buf char (ad.output_buf_len) based (ad.output_buf_ptr);
 87 
 88 /* The following array maps any 6-bit code into the ebcdic character needed to transmit it */
 89 /* The first 32 elements are used for device addresses (poll and select) and controller address (poll only) */
 90 /* The second 32 elements are used for controller addresses (select only) */
 91 /* A more useable character form of this array is kept in ad.bit6_char */
 92 
 93 dcl  address_mapping (0:63) bit (8) unal int static options (constant) init (
 94      "40"b4, "c1"b4, "c2"b4, "c3"b4, "c4"b4, "c5"b4, "c6"b4, "c7"b4,
 95      "c8"b4, "c9"b4, "4a"b4, "4b"b4, "4c"b4, "4d"b4, "4e"b4, "4f"b4,
 96      "50"b4, "d1"b4, "d2"b4, "d3"b4, "d4"b4, "d5"b4, "d6"b4, "d7"b4,
 97      "d8"b4, "d9"b4, "5a"b4, "5b"b4, "5c"b4, "5d"b4, "5e"b4, "5f"b4,
 98      "60"b4, "61"b4, "e2"b4, "e3"b4, "e4"b4, "e5"b4, "e6"b4, "e7"b4,
 99      "e8"b4, "e9"b4, "6a"b4, "6b"b4, "6c"b4, "6d"b4, "6e"b4, "6f"b4,
100      "f0"b4, "f1"b4, "f2"b4, "f3"b4, "f4"b4, "f5"b4, "f6"b4, "f7"b4,
101      "f8"b4, "f9"b4, "7a"b4, "7b"b4, "7c"b4, "7d"b4, "7e"b4, "7f"b4);
102 
103 /* End include file ..... ibm3270_attach_data.incl.pl1 */