require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_PCI_IF_SKVAR_H_)) {
    eval 'sub _DEV_PCI_IF_SKVAR_H_ () {1;}' unless defined(&_DEV_PCI_IF_SKVAR_H_);
    eval 'sub SK_NTXSEG () {30;}' unless defined(&SK_NTXSEG);
    eval 'sub SK_TX_RING_ADDR {
        my($sc, $i) = @_;
	    eval q((($sc)-> ($sk_ring_map->{dm_segs[0]}->{ds_addr}) +  &offsetof(\'struct sk_ring_data\',  $sk_tx_ring[($i)])));
    }' unless defined(&SK_TX_RING_ADDR);
    eval 'sub SK_RX_RING_ADDR {
        my($sc, $i) = @_;
	    eval q((($sc)-> ($sk_ring_map->{dm_segs[0]}->{ds_addr}) +  &offsetof(\'struct sk_ring_data\',  $sk_rx_ring[($i)])));
    }' unless defined(&SK_RX_RING_ADDR);
    eval 'sub SK_CDOFF {
        my($x) = @_;
	    eval q( &offsetof(\'struct sk_ring_data\', $x));
    }' unless defined(&SK_CDOFF);
    eval 'sub SK_CDTXOFF {
        my($x) = @_;
	    eval q( &SK_CDOFF( $sk_tx_ring[($x)]));
    }' unless defined(&SK_CDTXOFF);
    eval 'sub SK_CDRXOFF {
        my($x) = @_;
	    eval q( &SK_CDOFF( $sk_rx_ring[($x)]));
    }' unless defined(&SK_CDRXOFF);
    eval 'sub SK_CDTXSYNC {
        my($sc, $x, $n, $ops) = @_;
	    eval q( &do { \'int\'  &__x,  &__n;  &__x = ($x);  &__n = ($n);  &if (( &__x +  &__n) >  &SK_TX_RING_CNT) {  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &SK_CDTXOFF( &__x), $sizeof{\'struct sk_tx_desc\'} * ( &SK_TX_RING_CNT -  &__x), ($ops));  &__n -= ( &SK_TX_RING_CNT -  &__x);  &__x = 0; }  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &SK_CDTXOFF(( &__x)), $sizeof{\'struct sk_tx_desc\'} *  &__n, ($ops)); }  &while ( 0));
    }' unless defined(&SK_CDTXSYNC);
    eval 'sub SK_CDRXSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &do {  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &SK_CDRXOFF(($x)), $sizeof{\'struct sk_rx_desc\'}, ($ops)); }  &while ( 0));
    }' unless defined(&SK_CDRXSYNC);
    eval 'sub SK_INC {
        my($x, $y) = @_;
	    eval q(($x) = ($x + 1) % $y);
    }' unless defined(&SK_INC);
}
1;
