Fix the breakage resulting from Rev. 1.80. Get the eeprom width

for all but two cards. This should fix broken cards like these:

DM9102 (Davicom, DEVICE_ID: 0x9002)
DM9009 (Davicom, DEVICE_ID: 0x9009)
DM9100 (Davicom, DEVICE_ID: 0x9100)
98713/98713_CP (Macronix PMAC, DEVICE_ID: 0x0512)
98713_CP (Macronix PMAC, DEVICE_ID: 0x0512)
987x5 (Macronix PMAC, DEVICE_ID: 0x0531)
98727  (Macronix PMAC, DEVICE_ID: 0x0532)
82C115 (Lite-On PNIC II, DEVICE_ID: 0xc115)
AX88140A (ASIX Dev_ID: DEVICE_ID: 0x1400)
EN1217 (Accton EN1217, DEVICE_ID: 0x1217)

Note that these cards sould still work in STABLE.

Reviewed by:	imp
This commit is contained in:
mbr 2003-02-07 23:12:51 +00:00
parent e8f2dea5dd
commit 6d1daa2399
2 changed files with 10 additions and 8 deletions

View File

@ -1955,13 +1955,17 @@ dc_attach(dev)
sc->dc_info = dc_devtype(dev); sc->dc_info = dc_devtype(dev);
revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF; revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF;
/* Get the eeprom width, but PNIC and XIRCOM have no eeprom */
if (sc->dc_info->dc_did != DC_DEVICEID_82C168 &&
sc->dc_info->dc_did != DC_DEVICEID_X3201)
dc_eeprom_width(sc);
switch(sc->dc_info->dc_did) { switch(sc->dc_info->dc_did) {
case DC_DEVICEID_21143: case DC_DEVICEID_21143:
sc->dc_type = DC_TYPE_21143; sc->dc_type = DC_TYPE_21143;
sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_flags |= DC_REDUCED_MII_POLL;
/* Save EEPROM contents so we can parse them later. */ /* Save EEPROM contents so we can parse them later. */
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_DM9009: case DC_DEVICEID_DM9009:
@ -1982,7 +1986,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_AN985: case DC_DEVICEID_AN985:
@ -1993,7 +1996,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_98713: case DC_DEVICEID_98713:
@ -2064,7 +2066,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_TX_INTR_ALWAYS;
sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_flags |= DC_REDUCED_MII_POLL;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
default: default:

View File

@ -1955,13 +1955,17 @@ dc_attach(dev)
sc->dc_info = dc_devtype(dev); sc->dc_info = dc_devtype(dev);
revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF; revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF;
/* Get the eeprom width, but PNIC and XIRCOM have no eeprom */
if (sc->dc_info->dc_did != DC_DEVICEID_82C168 &&
sc->dc_info->dc_did != DC_DEVICEID_X3201)
dc_eeprom_width(sc);
switch(sc->dc_info->dc_did) { switch(sc->dc_info->dc_did) {
case DC_DEVICEID_21143: case DC_DEVICEID_21143:
sc->dc_type = DC_TYPE_21143; sc->dc_type = DC_TYPE_21143;
sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_flags |= DC_REDUCED_MII_POLL;
/* Save EEPROM contents so we can parse them later. */ /* Save EEPROM contents so we can parse them later. */
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_DM9009: case DC_DEVICEID_DM9009:
@ -1982,7 +1986,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_AN985: case DC_DEVICEID_AN985:
@ -1993,7 +1996,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
case DC_DEVICEID_98713: case DC_DEVICEID_98713:
@ -2064,7 +2066,6 @@ dc_attach(dev)
sc->dc_flags |= DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_TX_INTR_ALWAYS;
sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_flags |= DC_REDUCED_MII_POLL;
sc->dc_pmode = DC_PMODE_MII; sc->dc_pmode = DC_PMODE_MII;
dc_eeprom_width(sc);
dc_read_srom(sc, sc->dc_romwidth); dc_read_srom(sc, sc->dc_romwidth);
break; break;
default: default: