require '_h2ph_pre.ph';

unless(defined(&_DEV_MII_MII_H_)) {
    eval 'sub _DEV_MII_MII_H_ () {1;}' unless defined(&_DEV_MII_MII_H_);
    eval 'sub MII_NPHY () {32;}' unless defined(&MII_NPHY);
    eval 'sub MII_COMMAND_START () {0x01;}' unless defined(&MII_COMMAND_START);
    eval 'sub MII_COMMAND_READ () {0x02;}' unless defined(&MII_COMMAND_READ);
    eval 'sub MII_COMMAND_WRITE () {0x01;}' unless defined(&MII_COMMAND_WRITE);
    eval 'sub MII_COMMAND_ACK () {0x02;}' unless defined(&MII_COMMAND_ACK);
    eval 'sub MII_BMCR () {0x00;}' unless defined(&MII_BMCR);
    eval 'sub BMCR_RESET () {0x8000;}' unless defined(&BMCR_RESET);
    eval 'sub BMCR_LOOP () {0x4000;}' unless defined(&BMCR_LOOP);
    eval 'sub BMCR_S100 () {0x2000;}' unless defined(&BMCR_S100);
    eval 'sub BMCR_AUTOEN () {0x1000;}' unless defined(&BMCR_AUTOEN);
    eval 'sub BMCR_PDOWN () {0x0800;}' unless defined(&BMCR_PDOWN);
    eval 'sub BMCR_ISO () {0x0400;}' unless defined(&BMCR_ISO);
    eval 'sub BMCR_STARTNEG () {0x0200;}' unless defined(&BMCR_STARTNEG);
    eval 'sub BMCR_FDX () {0x0100;}' unless defined(&BMCR_FDX);
    eval 'sub BMCR_CTEST () {0x0080;}' unless defined(&BMCR_CTEST);
    eval 'sub MII_BMSR () {0x01;}' unless defined(&MII_BMSR);
    eval 'sub BMSR_100T4 () {0x8000;}' unless defined(&BMSR_100T4);
    eval 'sub BMSR_100TXFDX () {0x4000;}' unless defined(&BMSR_100TXFDX);
    eval 'sub BMSR_100TXHDX () {0x2000;}' unless defined(&BMSR_100TXHDX);
    eval 'sub BMSR_10TFDX () {0x1000;}' unless defined(&BMSR_10TFDX);
    eval 'sub BMSR_10THDX () {0x0800;}' unless defined(&BMSR_10THDX);
    eval 'sub BMSR_MFPS () {0x0040;}' unless defined(&BMSR_MFPS);
    eval 'sub BMSR_ACOMP () {0x0020;}' unless defined(&BMSR_ACOMP);
    eval 'sub BMSR_RFAULT () {0x0010;}' unless defined(&BMSR_RFAULT);
    eval 'sub BMSR_ANEG () {0x0008;}' unless defined(&BMSR_ANEG);
    eval 'sub BMSR_LINK () {0x0004;}' unless defined(&BMSR_LINK);
    eval 'sub BMSR_JABBER () {0x0002;}' unless defined(&BMSR_JABBER);
    eval 'sub BMSR_EXT () {0x0001;}' unless defined(&BMSR_EXT);
    eval 'sub BMSR_MEDIAMASK () {( &BMSR_100T4| &BMSR_100TXFDX| &BMSR_100TXHDX| &BMSR_10TFDX|  &BMSR_10THDX| &BMSR_ANEG);}' unless defined(&BMSR_MEDIAMASK);
    eval 'sub BMSR_MEDIA_TO_ANAR {
        local($x) = @_;
	    eval q(((($x) &  &BMSR_MEDIAMASK) >> 6));
    }' unless defined(&BMSR_MEDIA_TO_ANAR);
    eval 'sub MII_PHYIDR1 () {0x02;}' unless defined(&MII_PHYIDR1);
    eval 'sub MII_PHYIDR2 () {0x03;}' unless defined(&MII_PHYIDR2);
    eval 'sub IDR2_OUILSB () {0xfc00;}' unless defined(&IDR2_OUILSB);
    eval 'sub IDR2_MODEL () {0x03f0;}' unless defined(&IDR2_MODEL);
    eval 'sub IDR2_REV () {0x000f;}' unless defined(&IDR2_REV);
    eval 'sub MII_OUI {
        local($id1, $id2) = @_;
	    eval q(((($id1) << 6) | (($id2) >> 10)));
    }' unless defined(&MII_OUI);
    eval 'sub MII_MODEL {
        local($id2) = @_;
	    eval q(((($id2) &  &IDR2_MODEL) >> 4));
    }' unless defined(&MII_MODEL);
    eval 'sub MII_REV {
        local($id2) = @_;
	    eval q((($id2) &  &IDR2_REV));
    }' unless defined(&MII_REV);
    eval 'sub MII_ANAR () {0x04;}' unless defined(&MII_ANAR);
    eval 'sub ANAR_NP () {0x8000;}' unless defined(&ANAR_NP);
    eval 'sub ANAR_ACK () {0x4000;}' unless defined(&ANAR_ACK);
    eval 'sub ANAR_RF () {0x2000;}' unless defined(&ANAR_RF);
    eval 'sub ANAR_FC () {0x0400;}' unless defined(&ANAR_FC);
    eval 'sub ANAR_T4 () {0x0200;}' unless defined(&ANAR_T4);
    eval 'sub ANAR_TX_FD () {0x0100;}' unless defined(&ANAR_TX_FD);
    eval 'sub ANAR_TX () {0x0080;}' unless defined(&ANAR_TX);
    eval 'sub ANAR_10_FD () {0x0040;}' unless defined(&ANAR_10_FD);
    eval 'sub ANAR_10 () {0x0020;}' unless defined(&ANAR_10);
    eval 'sub ANAR_CSMA () {0x0001;}' unless defined(&ANAR_CSMA);
    eval 'sub MII_ANLPAR () {0x05;}' unless defined(&MII_ANLPAR);
    eval 'sub ANLPAR_NP () {0x8000;}' unless defined(&ANLPAR_NP);
    eval 'sub ANLPAR_ACK () {0x4000;}' unless defined(&ANLPAR_ACK);
    eval 'sub ANLPAR_RF () {0x2000;}' unless defined(&ANLPAR_RF);
    eval 'sub ANLPAR_FC () {0x0400;}' unless defined(&ANLPAR_FC);
    eval 'sub ANLPAR_T4 () {0x0200;}' unless defined(&ANLPAR_T4);
    eval 'sub ANLPAR_TX_FD () {0x0100;}' unless defined(&ANLPAR_TX_FD);
    eval 'sub ANLPAR_TX () {0x0080;}' unless defined(&ANLPAR_TX);
    eval 'sub ANLPAR_10_FD () {0x0040;}' unless defined(&ANLPAR_10_FD);
    eval 'sub ANLPAR_10 () {0x0020;}' unless defined(&ANLPAR_10);
    eval 'sub ANLPAR_CSMA () {0x0001;}' unless defined(&ANLPAR_CSMA);
    eval 'sub MII_ANER () {0x06;}' unless defined(&MII_ANER);
    eval 'sub ANER_MLF () {0x0010;}' unless defined(&ANER_MLF);
    eval 'sub ANER_LPNP () {0x0008;}' unless defined(&ANER_LPNP);
    eval 'sub ANER_NP () {0x0004;}' unless defined(&ANER_NP);
    eval 'sub ANER_PAGE_RX () {0x0002;}' unless defined(&ANER_PAGE_RX);
    eval 'sub ANER_LPAN () {0x0001;}' unless defined(&ANER_LPAN);
}
1;
