require '_h2ph_pre.ph';

unless(defined(&_AIC7XXXVAR_H_)) {
    eval 'sub _AIC7XXXVAR_H_ () {1;}' unless defined(&_AIC7XXXVAR_H_);
    unless(defined(&FALSE)) {
	eval 'sub FALSE () {0;}' unless defined(&FALSE);
    }
    unless(defined(&TRUE)) {
	eval 'sub TRUE () {1;}' unless defined(&TRUE);
    }
    eval 'sub STAILQ_ENTRY () { &SIMPLEQ_ENTRY;}' unless defined(&STAILQ_ENTRY);
    eval 'sub STAILQ_HEAD () { &SIMPLEQ_HEAD;}' unless defined(&STAILQ_HEAD);
    eval 'sub STAILQ_INIT () { &SIMPLEQ_INIT;}' unless defined(&STAILQ_INIT);
    eval 'sub STAILQ_INSERT_HEAD () { &SIMPLEQ_INSERT_HEAD;}' unless defined(&STAILQ_INSERT_HEAD);
    eval 'sub STAILQ_INSERT_TAIL () { &SIMPLEQ_INSERT_TAIL;}' unless defined(&STAILQ_INSERT_TAIL);
    eval 'sub STAILQ_REMOVE_HEAD {
        local($head, $field) = @_;
	    eval q( &SIMPLEQ_REMOVE_HEAD($head, ($head)-> &sqh_first, $field));
    }' unless defined(&STAILQ_REMOVE_HEAD);
    eval 'sub stqh_first () { &sqh_first;}' unless defined(&stqh_first);
    eval 'sub stqe_next () { &sqe_next;}' unless defined(&stqe_next);
    eval 'sub AHC_MAXTRANSFER_SIZE () {0x00ffffff;}' unless defined(&AHC_MAXTRANSFER_SIZE);
    eval 'sub AHC_NSEG () {( &MIN( &btoc( &MAXPHYS) + 1, 255));}' unless defined(&AHC_NSEG);
    eval 'sub AHC_SCB_MAX () {255;}' unless defined(&AHC_SCB_MAX);
    eval 'sub AHC_TMODE_CMDS () {256;}' unless defined(&AHC_TMODE_CMDS);
    eval("sub AHC_NONE () { 0x0000; }") unless defined(&AHC_NONE);
    eval("sub AHC_CHIPID_MASK () { 0x00FF; }") unless defined(&AHC_CHIPID_MASK);
    eval("sub AHC_AIC7770 () { 0x0001; }") unless defined(&AHC_AIC7770);
    eval("sub AHC_AIC7850 () { 0x0002; }") unless defined(&AHC_AIC7850);
    eval("sub AHC_AIC7855 () { 0x0003; }") unless defined(&AHC_AIC7855);
    eval("sub AHC_AIC7859 () { 0x0004; }") unless defined(&AHC_AIC7859);
    eval("sub AHC_AIC7860 () { 0x0005; }") unless defined(&AHC_AIC7860);
    eval("sub AHC_AIC7870 () { 0x0006; }") unless defined(&AHC_AIC7870);
    eval("sub AHC_AIC7880 () { 0x0007; }") unless defined(&AHC_AIC7880);
    eval("sub AHC_AIC7890 () { 0x0008; }") unless defined(&AHC_AIC7890);
    eval("sub AHC_AIC7892 () { 0x0009; }") unless defined(&AHC_AIC7892);
    eval("sub AHC_AIC7895 () { 0x000a; }") unless defined(&AHC_AIC7895);
    eval("sub AHC_AIC7896 () { 0x000b; }") unless defined(&AHC_AIC7896);
    eval("sub AHC_AIC7899 () { 0x000c; }") unless defined(&AHC_AIC7899);
    eval("sub AHC_VL () { 0x0100; }") unless defined(&AHC_VL);
    eval("sub AHC_EISA () { 0x0200; }") unless defined(&AHC_EISA);
    eval("sub AHC_PCI () { 0x0400; }") unless defined(&AHC_PCI);
    eval("sub AHC_BUS_MASK () { 0x0F00; }") unless defined(&AHC_BUS_MASK);
    eval("sub AHC_FENONE () { 0x0000; }") unless defined(&AHC_FENONE);
    eval("sub AHC_ULTRA () { 0x0001; }") unless defined(&AHC_ULTRA);
    eval("sub AHC_ULTRA2 () { 0x0002; }") unless defined(&AHC_ULTRA2);
    eval("sub AHC_WIDE () { 0x0004; }") unless defined(&AHC_WIDE);
    eval("sub AHC_TWIN () { 0x0008; }") unless defined(&AHC_TWIN);
    eval("sub AHC_MORE_SRAM () { 0x0010; }") unless defined(&AHC_MORE_SRAM);
    eval("sub AHC_CMD_CHAN () { 0x0020; }") unless defined(&AHC_CMD_CHAN);
    eval("sub AHC_QUEUE_REGS () { 0x0040; }") unless defined(&AHC_QUEUE_REGS);
    eval("sub AHC_SG_PRELOAD () { 0x0080; }") unless defined(&AHC_SG_PRELOAD);
    eval("sub AHC_SPIOCAP () { 0x0100; }") unless defined(&AHC_SPIOCAP);
    eval("sub AHC_MULTI_TID () { 0x0200; }") unless defined(&AHC_MULTI_TID);
    eval("sub AHC_HS_MAILBOX () { 0x0400; }") unless defined(&AHC_HS_MAILBOX);
    eval("sub AHC_DT () { 0x0800; }") unless defined(&AHC_DT);
    eval("sub AHC_NEW_TERMCTL () { 0x1000; }") unless defined(&AHC_NEW_TERMCTL);
    eval("sub AHC_MULTI_FUNC () { 0x2000; }") unless defined(&AHC_MULTI_FUNC);
    eval("sub AHC_TARG_DMABUG () { 0x4000; }") unless defined(&AHC_TARG_DMABUG);
    eval("sub AHC_AIC7770_FE () { AHC_TARG_DMABUG; }") unless defined(&AHC_AIC7770_FE);
    eval("sub AHC_AIC7850_FE () { AHC_TARG_DMABUG|AHC_SPIOCAP; }") unless defined(&AHC_AIC7850_FE);
    eval("sub AHC_AIC7855_FE () { AHC_AIC7850_FE; }") unless defined(&AHC_AIC7855_FE);
    eval("sub AHC_AIC7859_FE () { AHC_AIC7850_FE|AHC_ULTRA; }") unless defined(&AHC_AIC7859_FE);
    eval("sub AHC_AIC7860_FE () { AHC_AIC7859_FE; }") unless defined(&AHC_AIC7860_FE);
    eval("sub AHC_AIC7870_FE () { AHC_TARG_DMABUG; }") unless defined(&AHC_AIC7870_FE);
    eval("sub AHC_AIC7880_FE () { AHC_TARG_DMABUG|AHC_ULTRA; }") unless defined(&AHC_AIC7880_FE);
    eval("sub AHC_AIC7890_FE () { AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_ULTRA2|AHC_QUEUE_REGS|AHC_SG_PRELOAD|AHC_MULTI_TID|AHC_HS_MAILBOX|AHC_NEW_TERMCTL; }") unless defined(&AHC_AIC7890_FE);
    eval("sub AHC_AIC7892_FE () { AHC_AIC7890_FE|AHC_DT; }") unless defined(&AHC_AIC7892_FE);
    eval("sub AHC_AIC7895_FE () { AHC_AIC7880_FE|AHC_MORE_SRAM|AHC_CMD_CHAN|AHC_MULTI_FUNC; }") unless defined(&AHC_AIC7895_FE);
    eval("sub AHC_AIC7895C_FE () { AHC_AIC7895_FE|AHC_MULTI_TID; }") unless defined(&AHC_AIC7895C_FE);
    eval("sub AHC_AIC7896_FE () { AHC_AIC7890_FE|AHC_MULTI_FUNC; }") unless defined(&AHC_AIC7896_FE);
    eval("sub AHC_AIC7899_FE () { AHC_AIC7892_FE|AHC_MULTI_FUNC; }") unless defined(&AHC_AIC7899_FE);
    eval("sub AHC_FNONE () { 0x000; }") unless defined(&AHC_FNONE);
    eval("sub AHC_PAGESCBS () { 0x001; }") unless defined(&AHC_PAGESCBS);
    eval("sub AHC_CHANNEL_B_PRIMARY () { 0x002; }") unless defined(&AHC_CHANNEL_B_PRIMARY);
    eval("sub AHC_USEDEFAULTS () { 0x004; }") unless defined(&AHC_USEDEFAULTS);
    eval("sub AHC_SHARED_SRAM () { 0x010; }") unless defined(&AHC_SHARED_SRAM);
    eval("sub AHC_LARGE_SEEPROM () { 0x020; }") unless defined(&AHC_LARGE_SEEPROM);
    eval("sub AHC_RESET_BUS_A () { 0x040; }") unless defined(&AHC_RESET_BUS_A);
    eval("sub AHC_RESET_BUS_B () { 0x080; }") unless defined(&AHC_RESET_BUS_B);
    eval("sub AHC_EXTENDED_TRANS_A () { 0x100; }") unless defined(&AHC_EXTENDED_TRANS_A);
    eval("sub AHC_EXTENDED_TRANS_B () { 0x200; }") unless defined(&AHC_EXTENDED_TRANS_B);
    eval("sub AHC_TERM_ENB_A () { 0x400; }") unless defined(&AHC_TERM_ENB_A);
    eval("sub AHC_TERM_ENB_B () { 0x800; }") unless defined(&AHC_TERM_ENB_B);
    eval("sub AHC_INITIATORMODE () { 0x1000; }") unless defined(&AHC_INITIATORMODE);
    eval("sub AHC_TARGETMODE () { 0x2000; }") unless defined(&AHC_TARGETMODE);
    eval("sub AHC_NEWEEPROM_FMT () { 0x4000; }") unless defined(&AHC_NEWEEPROM_FMT);
    eval("sub AHC_RESOURCE_SHORTAGE () { 0x8000; }") unless defined(&AHC_RESOURCE_SHORTAGE);
    eval("sub AHC_TQINFIFO_BLOCKED () { 0x10000; }") unless defined(&AHC_TQINFIFO_BLOCKED);
    eval("sub AHC_INT50_SPEEDFLEX () { 0x20000; }") unless defined(&AHC_INT50_SPEEDFLEX);
    eval("sub SCB_FREE () { 0x0000; }") unless defined(&SCB_FREE);
    eval("sub SCB_OTHERTCL_TIMEOUT () { 0x0002; }") unless defined(&SCB_OTHERTCL_TIMEOUT);
    eval("sub SCB_DEVICE_RESET () { 0x0004; }") unless defined(&SCB_DEVICE_RESET);
    eval("sub SCB_SENSE () { 0x0008; }") unless defined(&SCB_SENSE);
    eval("sub SCB_FREEZE_QUEUE () { 0x0010; }") unless defined(&SCB_FREEZE_QUEUE);
    eval("sub SCB_REQUEUE () { 0x0020; }") unless defined(&SCB_REQUEUE);
    eval("sub SCB_RECOVERY_SCB () { 0x0040; }") unless defined(&SCB_RECOVERY_SCB);
    eval("sub SCB_ABORT () { 0x1000; }") unless defined(&SCB_ABORT);
    eval("sub SCB_QUEUED_MSG () { 0x2000; }") unless defined(&SCB_QUEUED_MSG);
    eval("sub SCB_ACTIVE () { 0x4000; }") unless defined(&SCB_ACTIVE);
    eval("sub SCB_TARGET_IMMEDIATE () { 0x8000; }") unless defined(&SCB_TARGET_IMMEDIATE);
    eval 'sub AHC_TMODE_EVENT_BUFFER_SIZE () {8;}' unless defined(&AHC_TMODE_EVENT_BUFFER_SIZE);
    eval 'sub EVENT_TYPE_BUS_RESET () {0xff;}' unless defined(&EVENT_TYPE_BUS_RESET);
    eval 'sub AHC_TRANS_CUR () {0x01;}' unless defined(&AHC_TRANS_CUR);
    eval 'sub AHC_TRANS_ACTIVE () {0x03;}' unless defined(&AHC_TRANS_ACTIVE);
    eval 'sub AHC_TRANS_GOAL () {0x04;}' unless defined(&AHC_TRANS_GOAL);
    eval 'sub AHC_TRANS_USER () {0x08;}' unless defined(&AHC_TRANS_USER);
    eval 'sub ALL_TARGETS () {-1;}' unless defined(&ALL_TARGETS);
    eval 'sub ALL_LUNS () {-1;}' unless defined(&ALL_LUNS);
    eval 'sub CFXFER () {0x0007;}' unless defined(&CFXFER);
    eval 'sub CFSYNCH () {0x0008;}' unless defined(&CFSYNCH);
    eval 'sub CFDISC () {0x0010;}' unless defined(&CFDISC);
    eval 'sub CFWIDEB () {0x0020;}' unless defined(&CFWIDEB);
    eval 'sub CFSYNCHISULTRA () {0x0040;}' unless defined(&CFSYNCHISULTRA);
    eval 'sub CFSYNCSINGLE () {0x0080;}' unless defined(&CFSYNCSINGLE);
    eval 'sub CFSTART () {0x0100;}' unless defined(&CFSTART);
    eval 'sub CFINCBIOS () {0x0200;}' unless defined(&CFINCBIOS);
    eval 'sub CFRNFOUND () {0x0400;}' unless defined(&CFRNFOUND);
    eval 'sub CFMULTILUN () {0x0800;}' unless defined(&CFMULTILUN);
    eval 'sub CFWBCACHEENB () {0x4000;}' unless defined(&CFWBCACHEENB);
    eval 'sub CFWBCACHENOP () {0xc000;}' unless defined(&CFWBCACHENOP);
    eval 'sub CFSUPREM () {0x0001;}' unless defined(&CFSUPREM);
    eval 'sub CFSUPREMB () {0x0002;}' unless defined(&CFSUPREMB);
    eval 'sub CFBIOSEN () {0x0004;}' unless defined(&CFBIOSEN);
    eval 'sub CFSM2DRV () {0x0010;}' unless defined(&CFSM2DRV);
    eval 'sub CF284XEXTEND () {0x0020;}' unless defined(&CF284XEXTEND);
    eval 'sub CFEXTEND () {0x0080;}' unless defined(&CFEXTEND);
    eval 'sub CFAUTOTERM () {0x0001;}' unless defined(&CFAUTOTERM);
    eval 'sub CFULTRAEN () {0x0002;}' unless defined(&CFULTRAEN);
    eval 'sub CF284XSELTO () {0x0003;}' unless defined(&CF284XSELTO);
    eval 'sub CF284XFIFO () {0x000c;}' unless defined(&CF284XFIFO);
    eval 'sub CFSTERM () {0x0004;}' unless defined(&CFSTERM);
    eval 'sub CFWSTERM () {0x0008;}' unless defined(&CFWSTERM);
    eval 'sub CFSPARITY () {0x0010;}' unless defined(&CFSPARITY);
    eval 'sub CF284XSTERM () {0x0020;}' unless defined(&CF284XSTERM);
    eval 'sub CFRESETB () {0x0040;}' unless defined(&CFRESETB);
    eval 'sub CFCHNLBPRIMARY () {0x0100;}' unless defined(&CFCHNLBPRIMARY);
    eval 'sub CFSEAUTOTERM () {0x0400;}' unless defined(&CFSEAUTOTERM);
    eval 'sub CFLVDSTERM () {0x0800;}' unless defined(&CFLVDSTERM);
    eval 'sub CFSCSIID () {0x000f;}' unless defined(&CFSCSIID);
    eval 'sub CFBRTIME () {0xff00;}' unless defined(&CFBRTIME);
    eval 'sub CFMAXTARG () {0x00ff;}' unless defined(&CFMAXTARG);
    eval 'sub ULTRA_SXFR () {0x100;}' unless defined(&ULTRA_SXFR);
    eval 'sub ST_SXFR () {0x010;}' unless defined(&ST_SXFR);
    eval("sub MSG_TYPE_NONE () { 0x00; }") unless defined(&MSG_TYPE_NONE);
    eval("sub MSG_TYPE_INITIATOR_MSGOUT () { 0x01; }") unless defined(&MSG_TYPE_INITIATOR_MSGOUT);
    eval("sub MSG_TYPE_INITIATOR_MSGIN () { 0x02; }") unless defined(&MSG_TYPE_INITIATOR_MSGIN);
    eval("sub MSG_TYPE_TARGET_MSGOUT () { 0x03; }") unless defined(&MSG_TYPE_TARGET_MSGOUT);
    eval("sub MSG_TYPE_TARGET_MSGIN () { 0x04; }") unless defined(&MSG_TYPE_TARGET_MSGIN);
    eval 'sub AHC_NEG_PENDING () {0x01;}' unless defined(&AHC_NEG_PENDING);
    eval 'sub AHC_NEG_SDTRDONE () {0x02;}' unless defined(&AHC_NEG_SDTRDONE);
    eval 'sub AHC_NEG_WDTRDONE () {0x04;}' unless defined(&AHC_NEG_WDTRDONE);
    if(defined(&AHC_DEBUG)) {
	eval 'sub AHC_SHOWMISC () {0x0001;}' unless defined(&AHC_SHOWMISC);
	eval 'sub AHC_SHOWCMDS () {0x0002;}' unless defined(&AHC_SHOWCMDS);
	eval 'sub AHC_SHOWSCBS () {0x0004;}' unless defined(&AHC_SHOWSCBS);
	eval 'sub AHC_SHOWABORTS () {0x0008;}' unless defined(&AHC_SHOWABORTS);
	eval 'sub AHC_SHOWSENSE () {0x0010;}' unless defined(&AHC_SHOWSENSE);
	eval 'sub AHC_SHOWSCBCNT () {0x0020;}' unless defined(&AHC_SHOWSCBCNT);
    }
    eval 'sub ahc_name {
        local($ahc) = @_;
	    eval q(($ahc)-> ($sc_dev->{dv_xname}));
    }' unless defined(&ahc_name);
    eval 'sub ahc_isa_reset () { &ahc_xxx_reset;}' unless defined(&ahc_isa_reset);
    eval 'sub ahc_eisa_reset () { &ahc_xxx_reset;}' unless defined(&ahc_eisa_reset);
    eval 'sub AHC_INB {
        local($ahc, $port) = @_;
	    eval q( &bus_space_read_1(($ahc)-> &sc_iot, ($ahc)-> &sc_ioh, $port));
    }' unless defined(&AHC_INB);
    eval 'sub AHC_INSB {
        local($ahc, $port, $valp, $size) = @_;
	    eval q( &bus_space_read_multi_1(-> &sc_iot, -> &sc_ioh, $port, $valp, $size));
    }' unless defined(&AHC_INSB);
    eval 'sub AHC_OUTB {
        local($ahc, $port, $val) = @_;
	    eval q( &bus_space_write_1(($ahc)-> &sc_iot, ($ahc)-> &sc_ioh, $port, $val));
    }' unless defined(&AHC_OUTB);
    eval 'sub AHC_OUTSB {
        local($ahc, $port, $valp, $size) = @_;
	    eval q( &bus_space_write_multi_1(-> &sc_iot, -> &sc_ioh, $port, $valp, $size));
    }' unless defined(&AHC_OUTSB);
    eval 'sub AHC_OUTSL {
        local($ahc, $port, $valp, $size) = @_;
	    eval q( &bus_space_write_multi_4(-> &sc_iot, -> &sc_ioh, $port, $valp, $size));
    }' unless defined(&AHC_OUTSL);
    eval 'sub ahc_inb () { &AHC_INB;}' unless defined(&ahc_inb);
    eval 'sub ahc_insb () { &AHC_INSB;}' unless defined(&ahc_insb);
    eval 'sub ahc_outb () { &AHC_OUTB;}' unless defined(&ahc_outb);
    eval 'sub ahc_outsb () { &AHC_OUTSB;}' unless defined(&ahc_outsb);
    eval 'sub ahc_outsl () { &AHC_OUTSL;}' unless defined(&ahc_outsl);
}
1;
