From 6d1daa2399cd63a0a75a17b6032a37b9079ae1b3 Mon Sep 17 00:00:00 2001 From: mbr Date: Fri, 7 Feb 2003 23:12:51 +0000 Subject: 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 --- sys/pci/if_dc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys/pci') diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 6de0972..c3c740b 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1955,13 +1955,17 @@ dc_attach(dev) sc->dc_info = dc_devtype(dev); 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) { case DC_DEVICEID_21143: sc->dc_type = DC_TYPE_21143; sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR; sc->dc_flags |= DC_REDUCED_MII_POLL; /* Save EEPROM contents so we can parse them later. */ - dc_eeprom_width(sc); dc_read_srom(sc, sc->dc_romwidth); break; case DC_DEVICEID_DM9009: @@ -1982,7 +1986,6 @@ dc_attach(dev) sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; - dc_eeprom_width(sc); dc_read_srom(sc, sc->dc_romwidth); break; case DC_DEVICEID_AN985: @@ -1993,7 +1996,6 @@ dc_attach(dev) sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; sc->dc_pmode = DC_PMODE_MII; - dc_eeprom_width(sc); dc_read_srom(sc, sc->dc_romwidth); break; case DC_DEVICEID_98713: @@ -2064,7 +2066,6 @@ dc_attach(dev) sc->dc_flags |= DC_TX_INTR_ALWAYS; sc->dc_flags |= DC_REDUCED_MII_POLL; sc->dc_pmode = DC_PMODE_MII; - dc_eeprom_width(sc); dc_read_srom(sc, sc->dc_romwidth); break; default: -- cgit v1.1