require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_PCI_IF_MSKVAR_H_)) {
    eval 'sub _DEV_PCI_IF_MSKVAR_H_ () {1;}' unless defined(&_DEV_PCI_IF_MSKVAR_H_);
    eval 'sub SK_NTXSEG () {30;}' unless defined(&SK_NTXSEG);
    eval 'sub MSK_TX_RING_ADDR {
        my($sc, $i) = @_;
	    eval q((($sc)-> ($sk_ring_map->{dm_segs[0]}->{ds_addr}) +  &offsetof(\'struct msk_ring_data\',  $sk_tx_ring[($i)])));
    }' unless defined(&MSK_TX_RING_ADDR);
    eval 'sub MSK_RX_RING_ADDR {
        my($sc, $i) = @_;
	    eval q((($sc)-> ($sk_ring_map->{dm_segs[0]}->{ds_addr}) +  &offsetof(\'struct msk_ring_data\',  $sk_rx_ring[($i)])));
    }' unless defined(&MSK_RX_RING_ADDR);
    eval 'sub MSK_CDOFF {
        my($x) = @_;
	    eval q( &offsetof(\'struct msk_ring_data\', $x));
    }' unless defined(&MSK_CDOFF);
    eval 'sub MSK_CDTXOFF {
        my($x) = @_;
	    eval q( &MSK_CDOFF( $sk_tx_ring[($x)]));
    }' unless defined(&MSK_CDTXOFF);
    eval 'sub MSK_CDRXOFF {
        my($x) = @_;
	    eval q( &MSK_CDOFF( $sk_rx_ring[($x)]));
    }' unless defined(&MSK_CDRXOFF);
    eval 'sub MSK_CDSTOFF {
        my($x) = @_;
	    eval q((($x) * $sizeof{\'struct msk_status_desc\'}));
    }' unless defined(&MSK_CDSTOFF);
    eval 'sub MSK_CDTXSYNC {
        my($sc, $x, $n, $ops) = @_;
	    eval q( &do { \'int\'  &__x,  &__n;  &__x = ($x);  &__n = ($n);  &if (( &__x +  &__n) >  &MSK_TX_RING_CNT) {  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &MSK_CDTXOFF( &__x), $sizeof{\'struct msk_tx_desc\'} * ( &MSK_TX_RING_CNT -  &__x), ($ops));  &__n -= ( &MSK_TX_RING_CNT -  &__x);  &__x = 0; }  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &MSK_CDTXOFF(( &__x)), $sizeof{\'struct msk_tx_desc\'} *  &__n, ($ops)); }  &while ( 0));
    }' unless defined(&MSK_CDTXSYNC);
    eval 'sub MSK_CDRXSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &do {  &bus_dmamap_sync(($sc)-> ($sk_softc->{sc_dmatag}), ($sc)-> &sk_ring_map,  &MSK_CDRXOFF(($x)), $sizeof{\'struct msk_rx_desc\'}, ($ops)); }  &while ( 0));
    }' unless defined(&MSK_CDRXSYNC);
    eval 'sub MSK_CDSTSYNC {
        my($sc, $x, $ops) = @_;
	    eval q( &do {  &bus_dmamap_sync(($sc)-> &sc_dmatag, ($sc)-> &sk_status_map,  &MSK_CDSTOFF(($x)), $sizeof{\'struct msk_status_desc\'}, ($ops)); }  &while ( 0));
    }' unless defined(&MSK_CDSTSYNC);
    eval 'sub SK_INC {
        my($x, $y) = @_;
	    eval q(($x) = ($x + 1) % $y);
    }' unless defined(&SK_INC);
}
1;
