require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_IC_CYREG_H_)) {
    eval 'sub _DEV_IC_CYREG_H_ () {1;}' unless defined(&_DEV_IC_CYREG_H_);
    require 'sys/timeout.ph';
    eval 'sub CY8_SVCACKR () {0x100;}' unless defined(&CY8_SVCACKR);
    eval 'sub CY8_SVCACKT () {0x200;}' unless defined(&CY8_SVCACKT);
    eval 'sub CY8_SVCACKM () {0x300;}' unless defined(&CY8_SVCACKM);
    eval 'sub CY_CD1400_MEMSPACING () {0x400;}' unless defined(&CY_CD1400_MEMSPACING);
    eval 'sub CY32_ADDR_FIX () {0xe00;}' unless defined(&CY32_ADDR_FIX);
    eval 'sub CY16_RESET () {0x1400;}' unless defined(&CY16_RESET);
    eval 'sub CY_CLEAR_INTR () {0x1800;}' unless defined(&CY_CLEAR_INTR);
    eval 'sub CY_MAX_CD1400s () {8;}' unless defined(&CY_MAX_CD1400s);
    eval 'sub CY_PCI_INTENA () {0x68;}' unless defined(&CY_PCI_INTENA);
    eval 'sub CY_PCI_INTENA_9050 () {0x4c;}' unless defined(&CY_PCI_INTENA_9050);
    eval 'sub CY_PLX_VER () {0x3400;}' unless defined(&CY_PLX_VER);
    eval 'sub CY_PLX_9050 () {0xb;}' unless defined(&CY_PLX_9050);
    eval 'sub CY_PLX_9060 () {0xc;}' unless defined(&CY_PLX_9060);
    eval 'sub CY_PLX_9080 () {0xd;}' unless defined(&CY_PLX_9080);
    eval 'sub CY_CLOCK () {25000000;}' unless defined(&CY_CLOCK);
    eval 'sub CY_CLOCK_60 () {60000000;}' unless defined(&CY_CLOCK_60);
    eval 'sub CY_BUSTYPE_ISA () {0;}' unless defined(&CY_BUSTYPE_ISA);
    eval 'sub CY_BUSTYPE_PCI () {1;}' unless defined(&CY_BUSTYPE_PCI);
    eval 'sub RX_FIFO_THRESHOLD () {6;}' unless defined(&RX_FIFO_THRESHOLD);
    eval 'sub RX_DTR_THRESHOLD () {9;}' unless defined(&RX_DTR_THRESHOLD);
    eval 'sub CY_MAX_PORTS () {( &CD1400_NO_OF_CHANNELS *  &CY_MAX_CD1400s);}' unless defined(&CY_MAX_PORTS);
    eval 'sub CY_PORT {
        my($x) = @_;
	    eval q(( &minor($x) & 0xf));
    }' unless defined(&CY_PORT);
    eval 'sub CY_CARD {
        my($x) = @_;
	    eval q((( &minor($x) >> 5) & 3));
    }' unless defined(&CY_CARD);
    eval 'sub CY_DIALOUT {
        my($x) = @_;
	    eval q((( &minor($x) & 0x80) != 0));
    }' unless defined(&CY_DIALOUT);
    eval 'sub CY_DIALIN {
        my($x) = @_;
	    eval q((! &CY_DIALOUT($x)));
    }' unless defined(&CY_DIALIN);
    eval 'sub cd_read_reg {
        my($cy,$reg) = @_;
	    eval q( &bus_space_read_1( ($cy->{cy_memt}),  ($cy->{cy_memh}),  ($cy->{cy_chip_offs})+((($reg<<1))<< ($cy->{cy_bustype}))));
    }' unless defined(&cd_read_reg);
    eval 'sub cd_write_reg {
        my($cy,$reg,$val) = @_;
	    eval q( &bus_space_write_1( ($cy->{cy_memt}),  ($cy->{cy_memh}),  ($cy->{cy_chip_offs})+((($reg<<1))<< ($cy->{cy_bustype})), ($val)));
    }' unless defined(&cd_write_reg);
    eval 'sub cd_read_reg_sc {
        my($sc,$chip,$reg) = @_;
	    eval q( &bus_space_read_1( ($sc->{sc_memt}),  ($sc->{sc_memh}),  ($sc->{sc_cd1400_offs[$chip]})+ ((($reg<<1))<< ($sc->{sc_bustype}))));
    }' unless defined(&cd_read_reg_sc);
    eval 'sub cd_write_reg_sc {
        my($sc,$chip,$reg,$val) = @_;
	    eval q( &bus_space_write_1( ($sc->{sc_memt}),  ($sc->{sc_memh}),  ($sc->{sc_cd1400_offs[$chip]})+ ((($reg<<1))<< ($sc->{sc_bustype})), ($val)));
    }' unless defined(&cd_write_reg_sc);
    eval 'sub IBUF_SIZE () {(2*512);}' unless defined(&IBUF_SIZE);
    if(defined(&CY_DEBUG1)) {
    }
    eval 'sub CYF_CARRIER_CHANGED () {0x1;}' unless defined(&CYF_CARRIER_CHANGED);
    eval 'sub CYF_START_BREAK () {0x2;}' unless defined(&CYF_START_BREAK);
    eval 'sub CYF_END_BREAK () {0x4;}' unless defined(&CYF_END_BREAK);
    eval 'sub CYF_STOP () {0x8;}' unless defined(&CYF_STOP);
    eval 'sub CYF_SEND_NUL () {0x10;}' unless defined(&CYF_SEND_NUL);
    eval 'sub CYF_START () {0x20;}' unless defined(&CYF_START);
    if(defined(&CY_DEBUG1)) {
    }
}
1;
