require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_IC_ANVAR_H)) {
    eval 'sub _DEV_IC_ANVAR_H () {1;}' unless defined(&_DEV_IC_ANVAR_H);
    eval 'sub AN_TIMEOUT () {65536;}' unless defined(&AN_TIMEOUT);
    eval 'sub AN_MAGIC () {0x414e;}' unless defined(&AN_MAGIC);
    eval 'sub AN_INTRS () {( &AN_EV_RX |  &AN_EV_TX |  &AN_EV_TX_EXC |  &AN_EV_LINKSTAT);}' unless defined(&AN_INTRS);
    eval 'sub CSR_WRITE_2 {
        my($sc, $reg, $val) = @_;
	    eval q( &bus_space_write_2( ($sc->{sc_iot}),  ($sc->{sc_ioh}), $reg, $val));
    }' unless defined(&CSR_WRITE_2);
    eval 'sub CSR_READ_2 {
        my($sc, $reg) = @_;
	    eval q( &bus_space_read_2( ($sc->{sc_iot}),  ($sc->{sc_ioh}), $reg));
    }' unless defined(&CSR_READ_2);
    unless(defined(&__BUS_SPACE_HAS_STREAM_METHODS)) {
	eval 'sub bus_space_write_multi_stream_2 () { &bus_space_write_multi_2;}' unless defined(&bus_space_write_multi_stream_2);
	eval 'sub bus_space_read_multi_stream_2 () { &bus_space_read_multi_2;}' unless defined(&bus_space_read_multi_stream_2);
    }
    eval 'sub CSR_WRITE_MULTI_STREAM_2 {
        my($sc, $reg, $val, $count) = @_;
	    eval q( &bus_space_write_multi_stream_2( ($sc->{sc_iot}),  ($sc->{sc_ioh}), $reg, $val, $count));
    }' unless defined(&CSR_WRITE_MULTI_STREAM_2);
    eval 'sub CSR_READ_MULTI_STREAM_2 {
        my($sc, $reg, $buf, $count) = @_;
	    eval q( &bus_space_read_multi_stream_2( ($sc->{sc_iot}),  ($sc->{sc_ioh}), $reg, $buf, $count));
    }' unless defined(&CSR_READ_MULTI_STREAM_2);
    eval 'sub AN_TX_MAX_LEN () {($sizeof{\'struct an_txframe\'} +  &ETHER_TYPE_LEN +  &ETHER_MAX_LEN);}' unless defined(&AN_TX_MAX_LEN);
    eval 'sub AN_TX_RING_CNT () {4;}' unless defined(&AN_TX_RING_CNT);
    eval 'sub AN_INC {
        my($x, $y) = @_;
	    eval q(($x) = ($x + 1) % $y);
    }' unless defined(&AN_INC);
    eval 'sub AN_GAPLEN_MAX () {8;}' unless defined(&AN_GAPLEN_MAX);
    eval 'sub AN_RX_RADIOTAP_PRESENT () {((1<<  &IEEE80211_RADIOTAP_FLAGS) | (1<<  &IEEE80211_RADIOTAP_RATE) | (1<<  &IEEE80211_RADIOTAP_CHANNEL) | (1<<  &IEEE80211_RADIOTAP_DB_ANTSIGNAL));}' unless defined(&AN_RX_RADIOTAP_PRESENT);
    eval 'sub AN_TX_RADIOTAP_PRESENT () {((1<<  &IEEE80211_RADIOTAP_FLAGS) | (1<<  &IEEE80211_RADIOTAP_RATE) | (1<<  &IEEE80211_RADIOTAP_CHANNEL));}' unless defined(&AN_TX_RADIOTAP_PRESENT);
    eval 'sub sc_rxtap () { ($sc_rxtapu->{tap});}' unless defined(&sc_rxtap);
    eval 'sub sc_txtap () { ($sc_txtapu->{tap});}' unless defined(&sc_txtap);
}
1;
