require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_IC_SMC83C170VAR_H_)) {
    eval 'sub _DEV_IC_SMC83C170VAR_H_ () {1;}' unless defined(&_DEV_IC_SMC83C170VAR_H_);
    require 'sys/timeout.ph';
    eval 'sub EPIC_NTXDESC () {128;}' unless defined(&EPIC_NTXDESC);
    eval 'sub EPIC_NTXDESC_MASK () {( &EPIC_NTXDESC - 1);}' unless defined(&EPIC_NTXDESC_MASK);
    eval 'sub EPIC_NEXTTX {
        my($x) = @_;
	    eval q((($x + 1) &  &EPIC_NTXDESC_MASK));
    }' unless defined(&EPIC_NEXTTX);
    eval 'sub EPIC_NRXDESC () {64;}' unless defined(&EPIC_NRXDESC);
    eval 'sub EPIC_NRXDESC_MASK () {( &EPIC_NRXDESC - 1);}' unless defined(&EPIC_NRXDESC_MASK);
    eval 'sub EPIC_NEXTRX {
        my($x) = @_;
	    eval q((($x + 1) &  &EPIC_NRXDESC_MASK));
    }' unless defined(&EPIC_NEXTRX);
    eval 'sub EPIC_CDOFF {
        my($x) = @_;
	    eval q( &offsetof(\'struct epic_control_data\', $x));
    }' unless defined(&EPIC_CDOFF);
    eval 'sub EPIC_CDTXOFF {
        my($x) = @_;
	    eval q( &EPIC_CDOFF( $ecd_txdescs[($x)]));
    }' unless defined(&EPIC_CDTXOFF);
    eval 'sub EPIC_CDRXOFF {
        my($x) = @_;
	    eval q( &EPIC_CDOFF( $ecd_rxdescs[($x)]));
    }' unless defined(&EPIC_CDRXOFF);
    eval 'sub EPIC_CDFLOFF {
        my($x) = @_;
	    eval q( &EPIC_CDOFF( $ecd_txfrags[($x)]));
    }' unless defined(&EPIC_CDFLOFF);
    eval 'sub EPIC_HAS_BNC () {0x1;}' unless defined(&EPIC_HAS_BNC);
    eval 'sub EPIC_HAS_MII_FIBER () {0x2;}' unless defined(&EPIC_HAS_MII_FIBER);
    eval 'sub EPIC_DUPLEXLED_ON_694 () {0x4;}' unless defined(&EPIC_DUPLEXLED_ON_694);
    eval 'sub sc_cddma () { ($sc_cddmamap->{dm_segs[0]}->{ds_addr});}' unless defined(&sc_cddma);
    eval 'sub sc_nulldma () { ($sc_nulldmamap->{dm_segs[0]}->{ds_addr});}' unless defined(&sc_nulldma);
    eval 'sub EPIC_CDTXADDR {
        my($sc, $x) = @_;
	    eval q((($sc)-> &sc_cddma +  &EPIC_CDTXOFF(($x))));
    }' unless defined(&EPIC_CDTXADDR);
    eval 'sub EPIC_CDRXADDR {
        my($sc, $x) = @_;
	    eval q((($sc)-> &sc_cddma +  &EPIC_CDRXOFF(($x))));
    }' unless defined(&EPIC_CDRXADDR);
    eval 'sub EPIC_CDFLADDR {
        my($sc, $x) = @_;
	    eval q((($sc)-> &sc_cddma +  &EPIC_CDFLOFF(($x))));
    }' unless defined(&EPIC_CDFLADDR);
    eval 'sub EPIC_CDTX {
        my($sc, $x) = @_;
	    eval q((($sc)-> ($sc_control_data->{ecd_txdescs[&(x)]})));
    }' unless defined(&EPIC_CDTX);
    eval 'sub EPIC_CDRX {
        my($sc, $x) = @_;
	    eval q((($sc)-> ($sc_control_data->{ecd_rxdescs[&(x)]})));
    }' unless defined(&EPIC_CDRX);
    eval 'sub EPIC_CDFL {
        my($sc, $x) = @_;
	    eval q((($sc)-> ($sc_control_data->{ecd_txfrags[&(x)]})));
    }' unless defined(&EPIC_CDFL);
    eval 'sub EPIC_DSTX {
        my($sc, $x) = @_;
	    eval q((($sc)-> $sc_txsoft[($x)]));
    }' unless defined(&EPIC_DSTX);
    eval 'sub EPIC_DSRX {
        my($sc, $x) = @_;
	    eval q((($sc)-> $sc_rxsoft[($x)]));
    }' unless defined(&EPIC_DSRX);
    eval 'sub EPIC_CDTXSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &bus_dmamap_sync(($sc)-> &sc_dmat, ($sc)-> &sc_cddmamap,  &EPIC_CDTXOFF(($x)), $sizeof{\'struct epic_txdesc\'}, ($ops)));
    }' unless defined(&EPIC_CDTXSYNC);
    eval 'sub EPIC_CDRXSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &bus_dmamap_sync(($sc)-> &sc_dmat, ($sc)-> &sc_cddmamap,  &EPIC_CDRXOFF(($x)), $sizeof{\'struct epic_rxdesc\'}, ($ops)));
    }' unless defined(&EPIC_CDRXSYNC);
    eval 'sub EPIC_CDFLSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &bus_dmamap_sync(($sc)-> &sc_dmat, ($sc)-> &sc_cddmamap,  &EPIC_CDFLOFF(($x)), $sizeof{\'struct epic_fraglist\'}, ($ops)));
    }' unless defined(&EPIC_CDFLSYNC);
    eval 'sub EPIC_INIT_RXDESC {
        my($sc, $x) = @_;
	    eval q( &do { \'struct epic_descsoft\' * &__ds =  &EPIC_DSRX(($sc), ($x)); \'struct epic_rxdesc\' * &__rxd =  &EPIC_CDRX(($sc), ($x)); \'struct mbuf\' * &__m =  ($__ds->{ds_mbuf});  ($__m->{m_data}) =  ($__m->{m_ext}->{e$xt_buf}) + 2;  ($__rxd->{er_bufaddr}) =  ($__ds->{ds_dmamap}->{dm_segs[0]}->{ds_addr}) + 2;  ($__rxd->{er_control}) =  &RXCTL_BUFLENGTH( ($__m->{m_ext}->{e$xt_size}) - 2);  ($__rxd->{er_rxstatus}) =  &ER_RXSTAT_OWNER;  ($__rxd->{er_nextdesc}) =  &EPIC_CDRXADDR(($sc),  &EPIC_NEXTRX(($x)));  &EPIC_CDRXSYNC(($sc), ($x),  &BUS_DMASYNC_PREREAD| &BUS_DMASYNC_PREWRITE); }  &while ( 0));
    }' unless defined(&EPIC_INIT_RXDESC);
    if(defined(&_KERNEL)) {
    }
}
1;
