require '_h2ph_pre.ph';

unless(defined(&__COM20020_H)) {
    eval 'sub __COM20020_H () {1;}' unless defined(&__COM20020_H);
    eval 'sub ARCNET_TOTAL_SIZE () {9;}' unless defined(&ARCNET_TOTAL_SIZE);
    eval 'sub _INTMASK () {( &ioaddr+0);}' unless defined(&_INTMASK);
    eval 'sub _STATUS () {( &ioaddr+0);}' unless defined(&_STATUS);
    eval 'sub _COMMAND () {( &ioaddr+1);}' unless defined(&_COMMAND);
    eval 'sub _DIAGSTAT () {( &ioaddr+1);}' unless defined(&_DIAGSTAT);
    eval 'sub _ADDR_HI () {( &ioaddr+2);}' unless defined(&_ADDR_HI);
    eval 'sub _ADDR_LO () {( &ioaddr+3);}' unless defined(&_ADDR_LO);
    eval 'sub _MEMDATA () {( &ioaddr+4);}' unless defined(&_MEMDATA);
    eval 'sub _SUBADR () {( &ioaddr+5);}' unless defined(&_SUBADR);
    eval 'sub _CONFIG () {( &ioaddr+6);}' unless defined(&_CONFIG);
    eval 'sub _XREG () {( &ioaddr+7);}' unless defined(&_XREG);
    eval 'sub RDDATAflag () {0x80;}' unless defined(&RDDATAflag);
    eval 'sub NEWNXTIDflag () {0x2;}' unless defined(&NEWNXTIDflag);
    eval 'sub RESETcfg () {0x80;}' unless defined(&RESETcfg);
    eval 'sub TXENcfg () {0x20;}' unless defined(&TXENcfg);
    eval 'sub PROMISCset () {0x10;}' unless defined(&PROMISCset);
    eval 'sub SUB_TENTATIVE () {0;}' unless defined(&SUB_TENTATIVE);
    eval 'sub SUB_NODE () {1;}' unless defined(&SUB_NODE);
    eval 'sub SUB_SETUP1 () {2;}' unless defined(&SUB_SETUP1);
    eval 'sub SUB_TEST () {3;}' unless defined(&SUB_TEST);
    eval 'sub SUB_SETUP2 () {4;}' unless defined(&SUB_SETUP2);
    eval 'sub SUB_BUSCTL () {5;}' unless defined(&SUB_BUSCTL);
    eval 'sub SUB_DMACOUNT () {6;}' unless defined(&SUB_DMACOUNT);
    eval 'sub SET_SUBADR {
        local($x) = @_;
	    eval q( &do {  &if (($x) < 4) {  ($lp->{config}) = ( ($lp->{config}) & ~0x3) | ($x);  &SETCONF; }  &else {  &outb($x,  &_SUBADR); } }  &while (0));
    }' unless defined(&SET_SUBADR);
    undef(&ARCRESET) if defined(&ARCRESET);
    undef(&ASTATUS) if defined(&ASTATUS);
    undef(&ACOMMAND) if defined(&ACOMMAND);
    undef(&AINTMASK) if defined(&AINTMASK);
    eval 'sub ARCRESET () {{  &outb( ($lp->{config}) | 0x80,  &_CONFIG);  &udelay(5);  &outb( ($lp->{config}) ,  &_CONFIG); };}' unless defined(&ARCRESET);
    eval 'sub ARCRESET0 () {{  &outb(0x18 | 0x80,  &_CONFIG);  &udelay(5);  &outb(0x18 ,  &_CONFIG); };}' unless defined(&ARCRESET0);
    eval 'sub ASTATUS () {
        eval q( &inb( &_STATUS));
    }' unless defined(&ASTATUS);
    eval 'sub ACOMMAND {
        local($cmd) = @_;
	    eval q( &outb(($cmd), &_COMMAND));
    }' unless defined(&ACOMMAND);
    eval 'sub AINTMASK {
        local($msk) = @_;
	    eval q( &outb(($msk), &_INTMASK));
    }' unless defined(&AINTMASK);
    eval 'sub SETCONF () { &outb( ($lp->{config}),  &_CONFIG);}' unless defined(&SETCONF);
}
1;
