require '_h2ph_pre.ph';

unless(defined(&_QIC117_H)) {
    eval 'sub _QIC117_H () {1;}' unless defined(&_QIC117_H);
    eval("sub QIC_NO_COMMAND () { 0; }") unless defined(&QIC_NO_COMMAND);
    eval("sub QIC_RESET () { 1; }") unless defined(&QIC_RESET);
    eval("sub QIC_REPORT_NEXT_BIT () { 2; }") unless defined(&QIC_REPORT_NEXT_BIT);
    eval("sub QIC_PAUSE () { 3; }") unless defined(&QIC_PAUSE);
    eval("sub QIC_MICRO_STEP_PAUSE () { 4; }") unless defined(&QIC_MICRO_STEP_PAUSE);
    eval("sub QIC_ALTERNATE_TIMEOUT () { 5; }") unless defined(&QIC_ALTERNATE_TIMEOUT);
    eval("sub QIC_REPORT_DRIVE_STATUS () { 6; }") unless defined(&QIC_REPORT_DRIVE_STATUS);
    eval("sub QIC_REPORT_ERROR_CODE () { 7; }") unless defined(&QIC_REPORT_ERROR_CODE);
    eval("sub QIC_REPORT_DRIVE_CONFIGURATION () { 8; }") unless defined(&QIC_REPORT_DRIVE_CONFIGURATION);
    eval("sub QIC_REPORT_ROM_VERSION () { 9; }") unless defined(&QIC_REPORT_ROM_VERSION);
    eval("sub QIC_LOGICAL_FORWARD () { 10; }") unless defined(&QIC_LOGICAL_FORWARD);
    eval("sub QIC_PHYSICAL_REVERSE () { 11; }") unless defined(&QIC_PHYSICAL_REVERSE);
    eval("sub QIC_PHYSICAL_FORWARD () { 12; }") unless defined(&QIC_PHYSICAL_FORWARD);
    eval("sub QIC_SEEK_HEAD_TO_TRACK () { 13; }") unless defined(&QIC_SEEK_HEAD_TO_TRACK);
    eval("sub QIC_SEEK_LOAD_POINT () { 14; }") unless defined(&QIC_SEEK_LOAD_POINT);
    eval("sub QIC_ENTER_FORMAT_MODE () { 15; }") unless defined(&QIC_ENTER_FORMAT_MODE);
    eval("sub QIC_WRITE_REFERENCE_BURST () { 16; }") unless defined(&QIC_WRITE_REFERENCE_BURST);
    eval("sub QIC_ENTER_VERIFY_MODE () { 17; }") unless defined(&QIC_ENTER_VERIFY_MODE);
    eval("sub QIC_STOP_TAPE () { 18; }") unless defined(&QIC_STOP_TAPE);
    eval("sub QIC_MICRO_STEP_HEAD_UP () { 21; }") unless defined(&QIC_MICRO_STEP_HEAD_UP);
    eval("sub QIC_MICRO_STEP_HEAD_DOWN () { 22; }") unless defined(&QIC_MICRO_STEP_HEAD_DOWN);
    eval("sub QIC_SOFT_SELECT () { 23; }") unless defined(&QIC_SOFT_SELECT);
    eval("sub QIC_SOFT_DESELECT () { 24; }") unless defined(&QIC_SOFT_DESELECT);
    eval("sub QIC_SKIP_REVERSE () { 25; }") unless defined(&QIC_SKIP_REVERSE);
    eval("sub QIC_SKIP_FORWARD () { 26; }") unless defined(&QIC_SKIP_FORWARD);
    eval("sub QIC_SELECT_RATE () { 27; }") unless defined(&QIC_SELECT_RATE);
    eval("sub QIC_ENTER_DIAGNOSTIC_1 () { 28; }") unless defined(&QIC_ENTER_DIAGNOSTIC_1);
    eval("sub QIC_ENTER_DIAGNOSTIC_2 () { 29; }") unless defined(&QIC_ENTER_DIAGNOSTIC_2);
    eval("sub QIC_ENTER_PRIMARY_MODE () { 30; }") unless defined(&QIC_ENTER_PRIMARY_MODE);
    eval("sub QIC_REPORT_VENDOR_ID () { 32; }") unless defined(&QIC_REPORT_VENDOR_ID);
    eval("sub QIC_REPORT_TAPE_STATUS () { 33; }") unless defined(&QIC_REPORT_TAPE_STATUS);
    eval("sub QIC_SKIP_EXTENDED_REVERSE () { 34; }") unless defined(&QIC_SKIP_EXTENDED_REVERSE);
    eval("sub QIC_SKIP_EXTENDED_FORWARD () { 35; }") unless defined(&QIC_SKIP_EXTENDED_FORWARD);
    eval("sub QIC_CALIBRATE_TAPE_LENGTH () { 36; }") unless defined(&QIC_CALIBRATE_TAPE_LENGTH);
    eval("sub QIC_REPORT_FORMAT_SEGMENTS () { 37; }") unless defined(&QIC_REPORT_FORMAT_SEGMENTS);
    eval("sub QIC_SET_FORMAT_SEGMENTS () { 38; }") unless defined(&QIC_SET_FORMAT_SEGMENTS);
    eval("sub QIC_PHANTOM_SELECT () { 46; }") unless defined(&QIC_PHANTOM_SELECT);
    eval("sub QIC_PHANTOM_DESELECT () { 47; }") unless defined(&QIC_PHANTOM_DESELECT);
    eval("sub discretional () { 0; }") unless defined(&discretional);
    eval("sub required () { 1; }") unless defined(&required);
    eval("sub ccs1 () { 2; }") unless defined(&ccs1);
    eval("sub ccs2 () { 3; }") unless defined(&ccs2);
    eval("sub unused () { 0; }") unless defined(&unused);
    eval("sub mode () { 1; }") unless defined(&mode);
    eval("sub motion () { 2; }") unless defined(&motion);
    eval("sub report () { 3; }") unless defined(&report);
    eval 'sub QIC117_COMMANDS () {{ { &NULL, 0x, 0x,  &mode, 0,  &discretional}, {"soft reset", 0x, 0x,  &motion, 1,  &required}, {"report next bit", 0x, 0x,  &report, 0,  &required}, {"pause", 0x36, 0x24,  &motion, 1,  &required}, {"micro step pause", 0x36, 0x24,  &motion, 1,  &required}, {"alternate command timeout", 0x, 0x,  &mode, 0,  &required}, {"report drive status", 0x, 0x,  &report, 0,  &required}, {"report error code", 0x1, 0x1,  &report, 0,  &required}, {"report drive configuration",0x, 0x,  &report, 0,  &required}, {"report rom version", 0x, 0x,  &report, 0,  &required}, {"logical forward", 0x37, 0x25,  &motion, 0,  &required}, {"physical reverse", 0x17, 0x5,  &motion, 0,  &required}, {"physical forward", 0x17, 0x5,  &motion, 0,  &required}, {"seek head to track", 0x37, 0x25,  &motion, 0,  &required}, {"seek load point", 0x17, 0x5,  &motion, 1,  &required}, {"enter format mode", 0x1f, 0x5,  &mode, 0,  &required}, {"write reference burst", 0x1f, 0x5,  &motion, 1,  &required}, {"enter verify mode", 0x37, 0x25,  &mode, 0,  &required}, {"stop tape", 0x, 0x,  &motion, 1,  &required}, {"reserved (19)", 0x, 0x,  &unused, 0,  &discretional}, {"reserved (20)", 0x, 0x,  &unused, 0,  &discretional}, {"micro step head up", 0x2, 0x,  &motion, 0,  &required}, {"micro step head down", 0x2, 0x,  &motion, 0,  &required}, {"soft select", 0x, 0x,  &mode, 0,  &discretional}, {"soft deselect", 0x, 0x,  &mode, 0,  &discretional}, {"skip segments reverse", 0x36, 0x24,  &motion, 1,  &required}, {"skip segments forward", 0x36, 0x24,  &motion, 1,  &required}, {"select rate or format", 0x3, 0x1,  &mode, 0,  &required }, {"enter diag mode 1", 0x, 0x,  &mode, 0,  &discretional}, {"enter diag mode 2", 0x, 0x,  &mode, 0,  &discretional}, {"enter primary mode", 0x, 0x,  &mode, 0,  &required}, {"vendor unique (31)", 0x, 0x,  &unused, 0,  &discretional}, {"report vendor id", 0x, 0x,  &report, 0,  &required}, {"report tape status", 0x4, 0x4,  &report, 0,  &ccs1}, {"skip extended reverse", 0x36, 0x24,  &motion, 1,  &ccs1}, {"skip extended forward", 0x36, 0x24,  &motion, 1,  &ccs1}, {"calibrate tape length", 0x17, 0x5,  &motion, 1,  &ccs2}, {"report format segments", 0x17, 0x5,  &report, 0,  &ccs2}, {"set format segments", 0x17, 0x5,  &mode, 0,  &ccs2}, {"reserved (39)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (40)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (41)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (42)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (43)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (44)", 0x, 0x,  &unused, 0,  &discretional}, {"vendor unique (45)", 0x, 0x,  &unused, 0,  &discretional}, {"phantom select", 0x, 0x,  &mode, 0,  &discretional}, {"phantom deselect", 0x, 0x,  &mode, 0,  &discretional},};}' unless defined(&QIC117_COMMANDS);
    eval 'sub QIC_STATUS_READY () {0x1;}' unless defined(&QIC_STATUS_READY);
    eval 'sub QIC_STATUS_ERROR () {0x2;}' unless defined(&QIC_STATUS_ERROR);
    eval 'sub QIC_STATUS_CARTRIDGE_PRESENT () {0x4;}' unless defined(&QIC_STATUS_CARTRIDGE_PRESENT);
    eval 'sub QIC_STATUS_WRITE_PROTECT () {0x8;}' unless defined(&QIC_STATUS_WRITE_PROTECT);
    eval 'sub QIC_STATUS_NEW_CARTRIDGE () {0x10;}' unless defined(&QIC_STATUS_NEW_CARTRIDGE);
    eval 'sub QIC_STATUS_REFERENCED () {0x20;}' unless defined(&QIC_STATUS_REFERENCED);
    eval 'sub QIC_STATUS_AT_BOT () {0x40;}' unless defined(&QIC_STATUS_AT_BOT);
    eval 'sub QIC_STATUS_AT_EOT () {0x80;}' unless defined(&QIC_STATUS_AT_EOT);
    eval 'sub QIC_CONFIG_RATE_MASK () {0x18;}' unless defined(&QIC_CONFIG_RATE_MASK);
    eval 'sub QIC_CONFIG_RATE_SHIFT () {3;}' unless defined(&QIC_CONFIG_RATE_SHIFT);
    eval 'sub QIC_CONFIG_RATE_250 () {0;}' unless defined(&QIC_CONFIG_RATE_250);
    eval 'sub QIC_CONFIG_RATE_500 () {2;}' unless defined(&QIC_CONFIG_RATE_500);
    eval 'sub QIC_CONFIG_RATE_1000 () {3;}' unless defined(&QIC_CONFIG_RATE_1000);
    eval 'sub QIC_CONFIG_RATE_2000 () {1;}' unless defined(&QIC_CONFIG_RATE_2000);
    eval 'sub QIC_CONFIG_RATE_4000 () {0;}' unless defined(&QIC_CONFIG_RATE_4000);
    eval 'sub QIC_CONFIG_LONG () {0x40;}' unless defined(&QIC_CONFIG_LONG);
    eval 'sub QIC_CONFIG_80 () {0x80;}' unless defined(&QIC_CONFIG_80);
    eval 'sub QIC_TAPE_STD_MASK () {0xf;}' unless defined(&QIC_TAPE_STD_MASK);
    eval 'sub QIC_TAPE_QIC40 () {0x1;}' unless defined(&QIC_TAPE_QIC40);
    eval 'sub QIC_TAPE_QIC80 () {0x2;}' unless defined(&QIC_TAPE_QIC80);
    eval 'sub QIC_TAPE_QIC3020 () {0x3;}' unless defined(&QIC_TAPE_QIC3020);
    eval 'sub QIC_TAPE_QIC3010 () {0x4;}' unless defined(&QIC_TAPE_QIC3010);
    eval 'sub QIC_TAPE_LEN_MASK () {0x70;}' unless defined(&QIC_TAPE_LEN_MASK);
    eval 'sub QIC_TAPE_205FT () {0x10;}' unless defined(&QIC_TAPE_205FT);
    eval 'sub QIC_TAPE_307FT () {0x20;}' unless defined(&QIC_TAPE_307FT);
    eval 'sub QIC_TAPE_VARIABLE () {0x30;}' unless defined(&QIC_TAPE_VARIABLE);
    eval 'sub QIC_TAPE_1100FT () {0x40;}' unless defined(&QIC_TAPE_1100FT);
    eval 'sub QIC_TAPE_FLEX () {0x60;}' unless defined(&QIC_TAPE_FLEX);
    eval 'sub QIC_TAPE_WIDE () {0x80;}' unless defined(&QIC_TAPE_WIDE);
    eval 'sub QIC_TOP_TAPE_LEN () {1500;}' unless defined(&QIC_TOP_TAPE_LEN);
    eval 'sub QIC117_ERRORS () {{ { "No error", 0, }, { "Command Received while Drive Not Ready", 0, }, { "Cartridge Not Present or Removed", 1, }, { "Motor Speed Error (not within 1%)", 1, }, { "Motor Speed Fault (jammed, or gross speed error", 1, }, { "Cartridge Write Protected", 1, }, { "Undefined or Reserved Command Code", 1, }, { "Illegal Track Address Specified for Seek", 1, }, { "Illegal Command in Report Subcontext", 0, }, { "Illegal Entry into a Diagnostic Mode", 1, }, { "Broken Tape Detected (based on hole sensor)", 1, }, { "Warning--Read Gain Setting Error", 1, }, { "Command Received While Error Status Pending (obs)", 1, }, { "Command Received While New Cartridge Pending", 1, }, { "Command Illegal or Undefined in Primary Mode", 1, }, { "Command Illegal or Undefined in Format Mode", 1, }, { "Command Illegal or Undefined in Verify Mode", 1, }, { "Logical Forward Not at Logical BOT or no Format Segments in Format Mode", 1, }, { "Logical EOT Before All Segments generated", 1, }, { "Command Illegal When Cartridge Not Referenced", 1, }, { "Self-Diagnostic Failed (cannot be cleared)", 1, }, { "Warning EEPROM Not Initialized, Defaults Set", 1, }, { "EEPROM Corrupted or Hardware Failure", 1, }, { "Motion Time-out Error", 1, }, { "Data Segment Too Long -- Logical Forward or Pause", 1, }, { "Transmit Overrun (obs)", 1, }, { "Power On Reset Occurred", 0, }, { "Software Reset Occurred", 0, }, { "Diagnostic Mode 1 Error", 1, }, { "Diagnostic Mode 2 Error", 1, }, { "Command Received During Non-Interruptible Process", 1, }, { "Rate or Format Selection Error", 1, }, { "Illegal Command While in High Speed Mode", 1, }, { "Illegal Seek Segment Value", 1, }, { "Invalid Media", 1, }, { "Head Positioning Failure", 1, }, { "Write Reference Burst Failure", 1, }, { "Prom Code Missing", 1, }, { "Invalid Format", 1, }, { "EOT/BOT System Failure", 1, }, { "Prom A Checksum Error", 1, }, { "Drive Wakeup Reset Occurred", 1, }, { "Prom B Checksum Error", 1, }, { "Illegal Entry into Format Mode", 1, },};}' unless defined(&QIC117_ERRORS);
}
1;
