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
This commit is contained in:
Maxime Henrion 2005-02-27 15:12:50 +00:00
parent e94c6cb4a2
commit 93b6e2e6ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142655

View file

@ -448,11 +448,20 @@ 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;
@ -489,15 +498,6 @@ fxp_attach(device_t dev)
"noflow", &sc->tunable_noflow);
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.
*