
{ DECK: IOT$TAPE_DEVICE_STATUS

  CONST   { length in PP 16 bit words }
    ioc$bid_status_response_length = 32,
    ioc$device_status_length = 16,
    ioc$extended_status_length = 20;

  CONST   { length in bytes }
    ioc$bid_area_size = ioc$bid_status_response_length * 2,   { 64 }
    ioc$device_status_size = ioc$device_status_length * 2;    { 32 }

  TYPE
    iot$tape_bid_status_response = ARRAY [1 .. ioc$bid_status_response_length] OF 0 .. 0ffff(16);

  TYPE
    iot$tape_device_status = packed record
      fillw1: 0 .. 0f(16),
      alert: boolean,
      fill: 0 .. 1,
      tu_connect: boolean,
      fill2: 0 .. 1,
      write_ring: boolean,
      nine_track: boolean,
      character_fill: boolean,
      tape_mark: boolean,
      end_of_tape: boolean,
      beginning_of_tape: boolean,
      unit_busy: boolean,
      unit_ready: boolean,

      fillw2: 0 .. 0f(16),
      block_id: 0 .. 1ff(16),
      fill3: 0 .. 1,
      odd_parity: boolean,
      fill4: 0 .. 1,

      fillw3: 0 .. 0f(16),
      lost_data: boolean,
      unit_check: boolean,
      tape_parity_error: boolean,
      channel_parity_error: boolean,
      tcu_parity_error: boolean,
      error_code: 0 .. 7f(16),

      fillw4: 0 .. 0f(16),
      pointer_error: boolean,
      dual_track_correction: boolean,
      single_track_correction: boolean,
      dead_tracks: 0 .. 1ff(16),

      fill5aa: 0 .. 3ff(16),
      false_eop: boolean,
      fill5b: 0 .. 1f(16),

      word6: 0 .. 0ffff(16),

      word7: 0 .. 0ffff(16),

      word8: 0 .. 0ffff(16),

      fill9a: 0 .. 0f(16),
      false_gap_bypassed: boolean,
      noise_bypassed: boolean,
      fill9b: 0 .. 3ff(16),

      word10: 0 .. 0ffff(16),

      fillw11a: 0 .. 7ff(16),
      density: 0 .. 3,
      fillw11b: 0 .. 7,

      fill12a: 0 .. 1fff(16),
      erase_current_failure: boolean,
      fill12b: 0 .. 3(16),

      word13: 0 .. 0ffff(16),

      fill14a: 0 .. 7ff(16),
      tape_present: boolean,
      fill14b: 0 .. 0f(16),

      word15: 0 .. 0ffff(16),

      word16: 0 .. 0ffff(16),
    recend;

  TYPE
    iot$tape_extended_status = ARRAY [1 .. ioc$extended_status_length] of 0 .. 0ffff(16);
