
{ DECK: IOT$CCC_CARTRIDGE_TAPE_STATUS

  CONST  { in bytes }
    ioc$ccc_cart_device_status_size = 2 * 8,  { 16 }
    ioc$ccc_cart_sense_bytes_size = 5 * 8,  { 40 }
    ioc$ccc_cart_error_log_size = 6 * 8,  { 48 }
    ioc$min_ccc_cart_resp_size = ioc$min_response_length + ioc$ccc_cart_device_status_size,   { 56 }
    ioc$max_ccc_cart_resp_size = ioc$min_ccc_cart_resp_size + ioc$ccc_cart_sense_bytes_size +
          ioc$ccc_cart_error_log_size;  { 144 }

  TYPE
    iot$ccc_cart_device_status = PACKED RECORD
      fill1: 0 .. 0f(16),
      alert: boolean,
      continue: boolean,
      fill2: 0 .. 1,
      eighteen_track: boolean,
      write_enabled: boolean,
      wait_continue_status: boolean,
      char_fill: boolean,
      tape_mark: boolean,
      end_of_tape: boolean,
      beginning_of_tape: boolean,
      busy: boolean,
      ready: boolean,
      fill3: 0 .. 0f(16),
      adapter_check: boolean,
      unit_check: boolean,
      equipment_check: boolean,
      data_check: boolean,
      deferred_unit_check: boolean,
      error_code: 0 .. 7f(16),
      last_good_bid: iot$cartridge_tape_bid,
      error_id: 0 .. 0ffff(16),
      last_function: 0 .. 0ffff(16),
      last_non_status_function: 0 .. 0ffff(16),
      channel_error_register: 0 .. 0ffff(16),
    RECEND,

    iot$ccc_cart_sense_bytes = PACKED RECORD
      command_reject: boolean,                { byte 0
      intervention_required: boolean,
      bus_out_check: boolean,
      equipment_check: boolean,
      data_check: boolean,
      overrun: boolean,
      unit_check_timing: boolean,
      assigned_elsewhere: boolean,
      locate_block_failed: boolean,           { byte 1
      drive_online: boolean,
      fill1: 0 .. 1,
      out_of_sequence_record: boolean,
      beginning_of_tape: boolean,
      write_status: boolean,
      file_protect: boolean,
      not_capable: boolean,
      channel_adaptor_code: 0 .. 7,           { byte 2
      channel_adaptor_location: 0 .. 1,
      detecting_control_unit: 0 .. 1,
      cart_avail_in_loader: boolean,
      drive_in_sync_mode: boolean,
      block_id_pos_indicator: boolean,
      erpa_code: 0 .. 0ff(16),                { byte 3
      logical_error_bid: 0 .. 0ffffff(16),    { bytes 4 - 6
      format_code: 0 .. 0ff(16),              { byte 7
      eight_thru_15: integer,                 { bytes 8 - 15
      sixteen_thru_23: integer,               { bytes 16 - 23
      twenty_four_thru_31: integer,           { bytes 24 - 31
      thirty_two_thru_35: 0 .. 0ffffffff(16), { bytes 32 - 35
      fips_di_status: 0 .. 0fff(16),
      thirty_seven_thru_39: 0 .. 0fffff(16),  { bytes 37 - 39
    RECEND,

    iot$ccc_cart_error_log = PACKED RECORD
      recovered_read_errors: 0 .. 0ffff(16),
      fill1: 0 .. 0ffff(16),
      recovered_write_errors: 0 .. 0ffff(16),
      on_the_fly_read_errors: 0 .. 0ffff(16),
      on_the_fly_write_errors: 0 .. 0ffff(16),
      temp_cu_errors: 0 .. 0ffff(16),
      fill2: 0 .. 0ffffffff(16),
      fill3: array [1 .. 32] of 0 .. 0ff(16),
    RECEND;

  TYPE
    iot$ccc_cart_unit_comm_buffer = PACKED RECORD
      force_sync: 0 .. 0ffff(16),    { unconditional synchronize if non-zero
      request_pva: ^iot$io_request,
    RECEND;

  TYPE
    iot$ccc_cart_error_id = 0 .. ioc$max_ccc_cart_error_id;

  CONST {ccc cartridge tape error id
    ioc$ccc_cart_no_pp_eid = 0,
    ioc$ccc_cart_indeterminate = 1,
    ioc$ccc_cart_input_chan_parity = 2,
    ioc$ccc_cart_output_chan_par = 3,
    ioc$ccc_cart_coupler_failure = 4,
    ioc$ccc_cart_cu_failure = 5,
    ioc$ccc_cart_unit_failure = 6,
    ioc$ccc_cart_unit_not_ready = 7,
    ioc$ccc_cart_function_timeout = 8,
    ioc$ccc_cart_tape_medium = 9,
    ioc$ccc_cart_iou_parity = 10,
    ioc$ccc_cart_indeterminate_par = 11,
    ioc$ccc_cart_write_id_mark = 12,
    ioc$ccc_cart_read_id_mark = 13,
    ioc$ccc_cart_hardware_corr = 14,
    ioc$ccc_cart_microcode_load = 15,
    ioc$ccc_cart_invalid_bid = 16,
    ioc$ccc_cart_inc_trans_in = 17,
    ioc$ccc_cart_inc_trans_out = 18,
    ioc$ccc_cart_pp_chan_flag = 19,

{ The following are software errors that are returned by the PP.  The I/F Error
{ bit is set in the response.

    ioc$ccc_cart_single_pp = 20,
    ioc$ccc_cart_unit_type = 21,
    ioc$ccc_cart_ill_command = 22,
    ioc$ccc_cart_ill_comm_buf_lng = 23,
    ioc$ccc_cart_ill_write_sequence = 24,
    ioc$ccc_cart_reserved_1 = 25,  { reserved for software error

{ The following are software errors that are detected by CPU code
{ in iop$tape_status_check_ccc_cart.

    ioc$ccc_cart_ill_abn_status = 26,
    ioc$ccc_cart_no_alert = 27,
    ioc$ccc_cart_no_abn_status = 28,

    ioc$max_ccc_cart_error_id = 28;

?? PUSH (LISTEXT := ON) ??
*copyc iot$tape_block_id_area
*copyc iot$tape_collected_pp_response
?? POP ??

