require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_CARDBUS_CARDBUSVAR_H_)) {
    eval 'sub _DEV_CARDBUS_CARDBUSVAR_H_ () {1;}' unless defined(&_DEV_CARDBUS_CARDBUSVAR_H_);
    require 'dev/pci/pcivar.ph';
    require 'dev/cardbus/rbus.ph';
    eval 'sub CARDBUS_BASE0_REG () {0x10;}' unless defined(&CARDBUS_BASE0_REG);
    eval 'sub CARDBUS_BASE1_REG () {0x14;}' unless defined(&CARDBUS_BASE1_REG);
    eval 'sub CARDBUS_BASE2_REG () {0x18;}' unless defined(&CARDBUS_BASE2_REG);
    eval 'sub CARDBUS_BASE3_REG () {0x1c;}' unless defined(&CARDBUS_BASE3_REG);
    eval 'sub CARDBUS_BASE4_REG () {0x20;}' unless defined(&CARDBUS_BASE4_REG);
    eval 'sub CARDBUS_BASE5_REG () {0x24;}' unless defined(&CARDBUS_BASE5_REG);
    eval 'sub CARDBUS_CIS_REG () {0x28;}' unless defined(&CARDBUS_CIS_REG);
    eval 'sub CARDBUS_ROM_REG () {0x30;}' unless defined(&CARDBUS_ROM_REG);
    eval 'sub CARDBUS_CIS_ASIMASK () {0x7;}' unless defined(&CARDBUS_CIS_ASIMASK);
    eval 'sub CARDBUS_CIS_ASI {
        my($x) = @_;
	    eval q(( &CARDBUS_CIS_ASIMASK & ($x)));
    }' unless defined(&CARDBUS_CIS_ASI);
    eval 'sub CARDBUS_CIS_ASI_TUPLE () {0x;}' unless defined(&CARDBUS_CIS_ASI_TUPLE);
    eval 'sub CARDBUS_CIS_ASI_BAR0 () {0x1;}' unless defined(&CARDBUS_CIS_ASI_BAR0);
    eval 'sub CARDBUS_CIS_ASI_BAR1 () {0x2;}' unless defined(&CARDBUS_CIS_ASI_BAR1);
    eval 'sub CARDBUS_CIS_ASI_BAR2 () {0x3;}' unless defined(&CARDBUS_CIS_ASI_BAR2);
    eval 'sub CARDBUS_CIS_ASI_BAR3 () {0x4;}' unless defined(&CARDBUS_CIS_ASI_BAR3);
    eval 'sub CARDBUS_CIS_ASI_BAR4 () {0x5;}' unless defined(&CARDBUS_CIS_ASI_BAR4);
    eval 'sub CARDBUS_CIS_ASI_BAR5 () {0x6;}' unless defined(&CARDBUS_CIS_ASI_BAR5);
    eval 'sub CARDBUS_CIS_ASI_ROM () {0x7;}' unless defined(&CARDBUS_CIS_ASI_ROM);
    eval 'sub CARDBUS_CIS_ADDRMASK () {0xffffff8;}' unless defined(&CARDBUS_CIS_ADDRMASK);
    eval 'sub CARDBUS_CIS_ADDR {
        my($x) = @_;
	    eval q(( &CARDBUS_CIS_ADDRMASK & ($x)));
    }' unless defined(&CARDBUS_CIS_ADDR);
    eval 'sub CARDBUS_CIS_ASI_BAR {
        my($x) = @_;
	    eval q(((( &CARDBUS_CIS_ASIMASK & ($x))-1)*4+0x10));
    }' unless defined(&CARDBUS_CIS_ASI_BAR);
    eval 'sub CARDBUS_CIS_ASI_ROM_IMAGE {
        my($x) = @_;
	    eval q(((($x) >> 28) & 0xf));
    }' unless defined(&CARDBUS_CIS_ASI_ROM_IMAGE);
    eval 'sub cbslotcf_dev () { $cf_loc[0];}' unless defined(&cbslotcf_dev);
    eval 'sub cbslotcf_func () { $cf_loc[1];}' unless defined(&cbslotcf_func);
    eval 'sub CBSLOT_UNK_DEV () {-1;}' unless defined(&CBSLOT_UNK_DEV);
    eval 'sub CBSLOT_UNK_FUNC () {-1;}' unless defined(&CBSLOT_UNK_FUNC);
    eval 'sub PCCARD_33V () {0x2;}' unless defined(&PCCARD_33V);
    eval 'sub PCCARD_XXV () {0x4;}' unless defined(&PCCARD_XXV);
    eval 'sub PCCARD_YYV () {0x8;}' unless defined(&PCCARD_YYV);
    eval 'sub CARDBUS_ENABLE () {1;}' unless defined(&CARDBUS_ENABLE);
    eval 'sub CARDBUS_DISABLE () {2;}' unless defined(&CARDBUS_DISABLE);
    eval 'sub CARDBUS_RESET () {4;}' unless defined(&CARDBUS_RESET);
    eval 'sub CARDBUS_CD () {7;}' unless defined(&CARDBUS_CD);
    eval 'sub CARDBUS_NOCARD () {0;}' unless defined(&CARDBUS_NOCARD);
    eval 'sub CARDBUS_5V_CARD () {0x1;}' unless defined(&CARDBUS_5V_CARD);
    eval 'sub CARDBUS_3V_CARD () {0x2;}' unless defined(&CARDBUS_3V_CARD);
    eval 'sub CARDBUS_XV_CARD () {0x4;}' unless defined(&CARDBUS_XV_CARD);
    eval 'sub CARDBUS_YV_CARD () {0x8;}' unless defined(&CARDBUS_YV_CARD);
    eval 'sub CARDBUS_IO_ENABLE () {100;}' unless defined(&CARDBUS_IO_ENABLE);
    eval 'sub CARDBUS_IO_DISABLE () {101;}' unless defined(&CARDBUS_IO_DISABLE);
    eval 'sub CARDBUS_MEM_ENABLE () {102;}' unless defined(&CARDBUS_MEM_ENABLE);
    eval 'sub CARDBUS_MEM_DISABLE () {103;}' unless defined(&CARDBUS_MEM_DISABLE);
    eval 'sub CARDBUS_BM_ENABLE () {104;}' unless defined(&CARDBUS_BM_ENABLE);
    eval 'sub CARDBUS_BM_DISABLE () {105;}' unless defined(&CARDBUS_BM_DISABLE);
    eval 'sub CARDBUS_VCC_UC () {0x;}' unless defined(&CARDBUS_VCC_UC);
    eval 'sub CARDBUS_VCC_3V () {0x1;}' unless defined(&CARDBUS_VCC_3V);
    eval 'sub CARDBUS_VCC_XV () {0x2;}' unless defined(&CARDBUS_VCC_XV);
    eval 'sub CARDBUS_VCC_YV () {0x3;}' unless defined(&CARDBUS_VCC_YV);
    eval 'sub CARDBUS_VCC_0V () {0x4;}' unless defined(&CARDBUS_VCC_0V);
    eval 'sub CARDBUS_VCC_5V () {0x5;}' unless defined(&CARDBUS_VCC_5V);
    eval 'sub CARDBUS_VCCMASK () {0xf;}' unless defined(&CARDBUS_VCCMASK);
    eval 'sub CARDBUS_VPP_UC () {0x;}' unless defined(&CARDBUS_VPP_UC);
    eval 'sub CARDBUS_VPP_VCC () {0x10;}' unless defined(&CARDBUS_VPP_VCC);
    eval 'sub CARDBUS_VPP_12V () {0x30;}' unless defined(&CARDBUS_VPP_12V);
    eval 'sub CARDBUS_VPP_0V () {0x40;}' unless defined(&CARDBUS_VPP_0V);
    eval 'sub CARDBUS_VPPMASK () {0xf0;}' unless defined(&CARDBUS_VPPMASK);
    eval 'sub CARDBUSCF_DEV () {0;}' unless defined(&CARDBUSCF_DEV);
    eval 'sub CARDBUSCF_DEV_DEFAULT () {-1;}' unless defined(&CARDBUSCF_DEV_DEFAULT);
    eval 'sub CARDBUSCF_FUNCTION () {1;}' unless defined(&CARDBUSCF_FUNCTION);
    eval 'sub CARDBUSCF_FUNCTION_DEFAULT () {-1;}' unless defined(&CARDBUSCF_FUNCTION_DEFAULT);
    eval 'sub cardbuscf_dev () { $cf_loc[ &CARDBUSCF_DEV];}' unless defined(&cardbuscf_dev);
    eval 'sub CARDBUS_UNK_DEV () { &CARDBUSCF_DEV_DEFAULT;}' unless defined(&CARDBUS_UNK_DEV);
    eval 'sub cardbuscf_function () { $cf_loc[ &CARDBUSCF_FUNCTION];}' unless defined(&cardbuscf_function);
    eval 'sub CARDBUS_UNK_FUNCTION () { &CARDBUSCF_FUNCTION_DEFAULT;}' unless defined(&CARDBUS_UNK_FUNCTION);
    eval 'sub Cardbus_function_enable {
        my($ct) = @_;
	    eval q( &cardbus_function_enable(($ct)-> &ct_sc, ($ct)-> &ct_func));
    }' unless defined(&Cardbus_function_enable);
    eval 'sub Cardbus_function_disable {
        my($ct) = @_;
	    eval q( &cardbus_function_disable(($ct)-> &ct_sc, ($ct)-> &ct_func));
    }' unless defined(&Cardbus_function_disable);
    eval 'sub Cardbus_mapreg_map {
        my($ct, $reg, $type, $busflags, $tagp, $handlep, $basep, $sizep) = @_;
	    eval q( &cardbus_mapreg_map(($ct)-> &ct_sc, ( ($ct->{ct_func})), ($reg), ($type), ($busflags), ($tagp), ($handlep), ($basep), ($sizep)));
    }' unless defined(&Cardbus_mapreg_map);
    eval 'sub Cardbus_mapreg_unmap {
        my($ct, $reg, $tag, $handle, $size) = @_;
	    eval q( &cardbus_mapreg_unmap(($ct)-> &ct_sc, ( ($ct->{ct_func})), ($reg), ($tag), ($handle), ($size)));
    }' unless defined(&Cardbus_mapreg_unmap);
}
1;
