require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_ATA_ATASCSI_H_)) {
    eval 'sub _DEV_ATA_ATASCSI_H_ () {1;}' unless defined(&_DEV_ATA_ATASCSI_H_);
    eval 'sub ATA_C_READDMA_EXT () {0x25;}' unless defined(&ATA_C_READDMA_EXT);
    eval 'sub ATA_C_READ_LOG_EXT () {0x2f;}' unless defined(&ATA_C_READ_LOG_EXT);
    eval 'sub ATA_C_WRITEDMA_EXT () {0x35;}' unless defined(&ATA_C_WRITEDMA_EXT);
    eval 'sub ATA_C_READ_FPDMA () {0x60;}' unless defined(&ATA_C_READ_FPDMA);
    eval 'sub ATA_C_WRITE_FPDMA () {0x61;}' unless defined(&ATA_C_WRITE_FPDMA);
    eval 'sub ATA_C_PACKET () {0xa0;}' unless defined(&ATA_C_PACKET);
    eval 'sub ATA_C_IDENTIFY_PACKET () {0xa1;}' unless defined(&ATA_C_IDENTIFY_PACKET);
    eval 'sub ATA_C_READDMA () {0xc8;}' unless defined(&ATA_C_READDMA);
    eval 'sub ATA_C_WRITEDMA () {0xca;}' unless defined(&ATA_C_WRITEDMA);
    eval 'sub ATA_C_STANDBY_IMMED () {0xe0;}' unless defined(&ATA_C_STANDBY_IMMED);
    eval 'sub ATA_C_READ_PM () {0xe4;}' unless defined(&ATA_C_READ_PM);
    eval 'sub ATA_C_WRITE_PM () {0xe8;}' unless defined(&ATA_C_WRITE_PM);
    eval 'sub ATA_C_FLUSH_CACHE () {0xe7;}' unless defined(&ATA_C_FLUSH_CACHE);
    eval 'sub ATA_C_FLUSH_CACHE_EXT () {0xea;}' unless defined(&ATA_C_FLUSH_CACHE_EXT);
    eval 'sub ATA_C_IDENTIFY () {0xec;}' unless defined(&ATA_C_IDENTIFY);
    eval 'sub ATA_C_SET_FEATURES () {0xef;}' unless defined(&ATA_C_SET_FEATURES);
    eval 'sub ATA_C_SEC_FREEZE_LOCK () {0xf5;}' unless defined(&ATA_C_SEC_FREEZE_LOCK);
    eval 'sub ATA_C_DSM () {0x6;}' unless defined(&ATA_C_DSM);
    eval 'sub ATA_SF_WRITECACHE_EN () {0x2;}' unless defined(&ATA_SF_WRITECACHE_EN);
    eval 'sub ATA_SF_LOOKAHEAD_EN () {0xaa;}' unless defined(&ATA_SF_LOOKAHEAD_EN);
    eval 'sub ATA_ID_ADD_SUPPORT_DRT () {0x4000;}' unless defined(&ATA_ID_ADD_SUPPORT_DRT);
    eval 'sub ATA_QDEPTH {
        my($_q) = @_;
	    eval q(((($_q) & 0x1f) + 1));
    }' unless defined(&ATA_QDEPTH);
    eval 'sub ATA_SATACAP_GEN1 () {0x2;}' unless defined(&ATA_SATACAP_GEN1);
    eval 'sub ATA_SATACAP_GEN2 () {0x4;}' unless defined(&ATA_SATACAP_GEN2);
    eval 'sub ATA_SATACAP_NCQ () {0x100;}' unless defined(&ATA_SATACAP_NCQ);
    eval 'sub ATA_SATACAP_PWRMGMT () {0x200;}' unless defined(&ATA_SATACAP_PWRMGMT);
    eval 'sub ATA_ID_F87_WWN () {(1<<8);}' unless defined(&ATA_ID_F87_WWN);
    eval 'sub ATA_ID_P2L_SECT_MASK () {0xc000;}' unless defined(&ATA_ID_P2L_SECT_MASK);
    eval 'sub ATA_ID_P2L_SECT_VALID () {0x4000;}' unless defined(&ATA_ID_P2L_SECT_VALID);
    eval 'sub ATA_ID_P2L_SECT_SET () {0x2000;}' unless defined(&ATA_ID_P2L_SECT_SET);
    eval 'sub ATA_ID_P2L_SECT_SIZESET () {0x1000;}' unless defined(&ATA_ID_P2L_SECT_SIZESET);
    eval 'sub ATA_ID_P2L_SECT_SIZE () {0xf;}' unless defined(&ATA_ID_P2L_SECT_SIZE);
    eval 'sub ATA_ID_FORM_MASK () {0xf;}' unless defined(&ATA_ID_FORM_MASK);
    eval 'sub ATA_ID_DATA_SET_MGMT_TRIM () {0x1;}' unless defined(&ATA_ID_DATA_SET_MGMT_TRIM);
    eval 'sub ATA_ID_LALIGN_MASK () {0xc000;}' unless defined(&ATA_ID_LALIGN_MASK);
    eval 'sub ATA_ID_LALIGN_VALID () {0x4000;}' unless defined(&ATA_ID_LALIGN_VALID);
    eval 'sub ATA_ID_LALIGN () {0x3fff;}' unless defined(&ATA_ID_LALIGN);
    eval 'sub ATA_IDENTIFY_WRITECACHE () {(1<< 5);}' unless defined(&ATA_IDENTIFY_WRITECACHE);
    eval 'sub ATA_IDENTIFY_LOOKAHEAD () {(1<< 6);}' unless defined(&ATA_IDENTIFY_LOOKAHEAD);
    eval 'sub ATA_DSM_TRIM () {0x1;}' unless defined(&ATA_DSM_TRIM);
    eval 'sub ATA_DSM_TRIM_DESC {
        my($_lba, $_len) = @_;
	    eval q((($_lba) | (( &u_int64_t)($_len) << 48)));
    }' unless defined(&ATA_DSM_TRIM_DESC);
    eval 'sub ATA_DSM_TRIM_MAX_LEN () {0xffff;}' unless defined(&ATA_DSM_TRIM_MAX_LEN);
    eval 'sub ATA_FIS_LENGTH () {20;}' unless defined(&ATA_FIS_LENGTH);
    eval 'sub ATA_FIS_TYPE_H2D () {0x27;}' unless defined(&ATA_FIS_TYPE_H2D);
    eval 'sub ATA_H2D_FLAGS_CMD () {(1<<7);}' unless defined(&ATA_H2D_FLAGS_CMD);
    eval 'sub ATA_H2D_FEATURES_DMA () {(1<<0);}' unless defined(&ATA_H2D_FEATURES_DMA);
    eval 'sub ATA_H2D_FEATURES_DIR () {(1<<2);}' unless defined(&ATA_H2D_FEATURES_DIR);
    eval 'sub ATA_H2D_FEATURES_DIR_READ () {(1<<2);}' unless defined(&ATA_H2D_FEATURES_DIR_READ);
    eval 'sub ATA_H2D_FEATURES_DIR_WRITE () {(0<<2);}' unless defined(&ATA_H2D_FEATURES_DIR_WRITE);
    eval 'sub ATA_H2D_DEVICE_LBA () {0x40;}' unless defined(&ATA_H2D_DEVICE_LBA);
    eval 'sub ATA_FIS_CONTROL_SRST () {0x4;}' unless defined(&ATA_FIS_CONTROL_SRST);
    eval 'sub ATA_FIS_CONTROL_4BIT () {0x8;}' unless defined(&ATA_FIS_CONTROL_4BIT);
    eval 'sub ATA_FIS_TYPE_D2H () {0x34;}' unless defined(&ATA_FIS_TYPE_D2H);
    eval 'sub ATA_D2H_FLAGS_INTR () {(1<<6);}' unless defined(&ATA_D2H_FLAGS_INTR);
    eval 'sub ATA_LOG_10H_TYPE_NOTQUEUED () {0x80;}' unless defined(&ATA_LOG_10H_TYPE_NOTQUEUED);
    eval 'sub ATA_LOG_10H_TYPE_TAG_MASK () {0x1f;}' unless defined(&ATA_LOG_10H_TYPE_TAG_MASK);
    eval 'sub SATA_SStatus_DET () {0xf;}' unless defined(&SATA_SStatus_DET);
    eval 'sub SATA_SStatus_DET_NODEV () {0x;}' unless defined(&SATA_SStatus_DET_NODEV);
    eval 'sub SATA_SStatus_DET_NOPHY () {0x1;}' unless defined(&SATA_SStatus_DET_NOPHY);
    eval 'sub SATA_SStatus_DET_DEV () {0x3;}' unless defined(&SATA_SStatus_DET_DEV);
    eval 'sub SATA_SStatus_DET_OFFLINE () {0x8;}' unless defined(&SATA_SStatus_DET_OFFLINE);
    eval 'sub SATA_SStatus_SPD () {0xf0;}' unless defined(&SATA_SStatus_SPD);
    eval 'sub SATA_SStatus_SPD_NONE () {0x;}' unless defined(&SATA_SStatus_SPD_NONE);
    eval 'sub SATA_SStatus_SPD_1_5 () {0x10;}' unless defined(&SATA_SStatus_SPD_1_5);
    eval 'sub SATA_SStatus_SPD_3_0 () {0x20;}' unless defined(&SATA_SStatus_SPD_3_0);
    eval 'sub SATA_SStatus_IPM () {0xf00;}' unless defined(&SATA_SStatus_IPM);
    eval 'sub SATA_SStatus_IPM_NODEV () {0x;}' unless defined(&SATA_SStatus_IPM_NODEV);
    eval 'sub SATA_SStatus_IPM_ACTIVE () {0x100;}' unless defined(&SATA_SStatus_IPM_ACTIVE);
    eval 'sub SATA_SStatus_IPM_PARTIAL () {0x200;}' unless defined(&SATA_SStatus_IPM_PARTIAL);
    eval 'sub SATA_SStatus_IPM_SLUMBER () {0x600;}' unless defined(&SATA_SStatus_IPM_SLUMBER);
    eval 'sub SATA_SIGNATURE_PORT_MULTIPLIER () {0x96690101;}' unless defined(&SATA_SIGNATURE_PORT_MULTIPLIER);
    eval 'sub SATA_SIGNATURE_ATAPI () {0xeb140101;}' unless defined(&SATA_SIGNATURE_ATAPI);
    eval 'sub SATA_SIGNATURE_DISK () {0x101;}' unless defined(&SATA_SIGNATURE_DISK);
    eval 'sub ATA_F_READ () {(1<<0);}' unless defined(&ATA_F_READ);
    eval 'sub ATA_F_WRITE () {(1<<1);}' unless defined(&ATA_F_WRITE);
    eval 'sub ATA_F_NOWAIT () {(1<<2);}' unless defined(&ATA_F_NOWAIT);
    eval 'sub ATA_F_POLL () {(1<<3);}' unless defined(&ATA_F_POLL);
    eval 'sub ATA_F_PIO () {(1<<4);}' unless defined(&ATA_F_PIO);
    eval 'sub ATA_F_PACKET () {(1<<5);}' unless defined(&ATA_F_PACKET);
    eval 'sub ATA_F_NCQ () {(1<<6);}' unless defined(&ATA_F_NCQ);
    eval 'sub ATA_F_DONE () {(1<<7);}' unless defined(&ATA_F_DONE);
    eval 'sub ATA_F_GET_RFIS () {(1<<8);}' unless defined(&ATA_F_GET_RFIS);
    eval 'sub ATA_FMT_FLAGS () {"\\020" "\\011GET_RFIS" "\\010DONE" "\\007NCQ" "\\006PACKET" "\\005PIO" "\\004POLL" "\\003NOWAIT" "\\002WRITE" "\\001READ";}' unless defined(&ATA_FMT_FLAGS);
    eval 'sub ATA_S_SETUP () {0;}' unless defined(&ATA_S_SETUP);
    eval 'sub ATA_S_PENDING () {1;}' unless defined(&ATA_S_PENDING);
    eval 'sub ATA_S_COMPLETE () {2;}' unless defined(&ATA_S_COMPLETE);
    eval 'sub ATA_S_ERROR () {3;}' unless defined(&ATA_S_ERROR);
    eval 'sub ATA_S_TIMEOUT () {4;}' unless defined(&ATA_S_TIMEOUT);
    eval 'sub ATA_S_ONCHIP () {5;}' unless defined(&ATA_S_ONCHIP);
    eval 'sub ATA_S_PUT () {6;}' unless defined(&ATA_S_PUT);
    eval 'sub ATA_S_DONE () {7;}' unless defined(&ATA_S_DONE);
    eval 'sub ASAA_CAP_NCQ () {(1<< 0);}' unless defined(&ASAA_CAP_NCQ);
    eval 'sub ASAA_CAP_NEEDS_RESERVED () {(1<< 1);}' unless defined(&ASAA_CAP_NEEDS_RESERVED);
    eval 'sub ASAA_CAP_PMP_NCQ () {(1<< 2);}' unless defined(&ASAA_CAP_PMP_NCQ);
    eval 'sub ATA_PORT_T_NONE () {0;}' unless defined(&ATA_PORT_T_NONE);
    eval 'sub ATA_PORT_T_DISK () {1;}' unless defined(&ATA_PORT_T_DISK);
    eval 'sub ATA_PORT_T_ATAPI () {2;}' unless defined(&ATA_PORT_T_ATAPI);
    eval 'sub ATA_PORT_T_PM () {3;}' unless defined(&ATA_PORT_T_PM);
}
1;
