Ticket #1609: rtl8139.fix-NoInternalPHY.patch

File rtl8139.fix-NoInternalPHY.patch, 980 bytes (added by siarzhuk, 16 years ago)

possible solution for "no PHY" problem.

  • src/add-ons/kernel/drivers/network/rtl8139/dev/mii/rlphy.c

     
    109109    int rv;
    110110
    111111    rv = mii_phy_dev_probe(dev, rlphys, BUS_PROBE_DEFAULT);
    112     if (rv <= 0)
    113         return (rv);
     112    if (rv <= 0) {
     113        // warning: it looks like a bug in original FreeBSD 7 code:
     114        // I think we should get the chance for internal PHY to be found too.
     115        nic = device_get_name(device_get_parent(device_get_parent(dev)));
     116        if (strcmp(nic, "rl") == 0 || strcmp(nic, "re") == 0)
     117            return (mii_phy_dev_probe(dev, rlintphys, BUS_PROBE_DEFAULT));
     118    }
    114119
    115     nic = device_get_name(device_get_parent(device_get_parent(dev)));
    116     if (strcmp(nic, "rl") == 0 || strcmp(nic, "re") == 0)
    117         return (mii_phy_dev_probe(dev, rlintphys, BUS_PROBE_DEFAULT));
    118120    return (ENXIO);
    119121}
    120122