summaryrefslogtreecommitdiffstats
path: root/sys/dev/fxp
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2005-02-27 15:12:50 +0000
committermux <mux@FreeBSD.org>2005-02-27 15:12:50 +0000
commitf0c921b4367082d3f5478c3445e52ca8aa0fa7dc (patch)
tree338b5f3fba3e18d28198ecb8eccdad9a4b730b87 /sys/dev/fxp
parent23d961a13f47abb00dde86ee46e2e766a478aca4 (diff)
downloadFreeBSD-src-f0c921b4367082d3f5478c3445e52ca8aa0fa7dc.zip
FreeBSD-src-f0c921b4367082d3f5478c3445e52ca8aa0fa7dc.tar.gz
Fix a stupid bogon from myself, sc->revision wasn't initialized when
testing it to know whether we should enable the 82503 serial mode... Move code to the right location and disallow the use of the 82503 serial mode if the sc->revision field is 0 again. This makes fxp(4) work correctly with ATMEL 350 93C46 cards (3 port 82559 based with a 82555 PHY), as well as with the older ATMEL 220 93C46 (same flavour) and with the even older 10Mbps-only 82557 cards with the 82503 serial interface. Tested by: Andre Albsmeier <andrer@albsmeier.net>, krion MFC after: 2 weeks
Diffstat (limited to 'sys/dev/fxp')
-rw-r--r--sys/dev/fxp/if_fxp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 1949f98..644ec2c 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -449,10 +449,19 @@ fxp_attach(device_t dev)
fxp_autosize_eeprom(sc);
/*
+ * Find out the chip revision; lump all 82557 revs together.
+ */
+ fxp_read_eeprom(sc, &data, 5, 1);
+ if ((data >> 8) == 1)
+ sc->revision = FXP_REV_82557;
+ else
+ sc->revision = pci_get_revid(dev);
+
+ /*
* Determine whether we must use the 503 serial interface.
*/
fxp_read_eeprom(sc, &data, 6, 1);
- if (sc->revision <= FXP_REV_82557 && (data & FXP_PHY_DEVICE_MASK) != 0
+ if (sc->revision == FXP_REV_82557 && (data & FXP_PHY_DEVICE_MASK) != 0
&& (data & FXP_PHY_SERIAL_ONLY))
sc->flags |= FXP_FLAG_SERIAL_MEDIA;
@@ -490,15 +499,6 @@ fxp_attach(device_t dev)
sc->rnr = 0;
/*
- * Find out the chip revision; lump all 82557 revs together.
- */
- fxp_read_eeprom(sc, &data, 5, 1);
- if ((data >> 8) == 1)
- sc->revision = FXP_REV_82557;
- else
- sc->revision = pci_get_revid(dev);
-
- /*
* Enable workarounds for certain chip revision deficiencies.
*
* Systems based on the ICH2/ICH2-M chip from Intel, and possibly
OpenPOWER on IntegriCloud