diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index a96583c..f7aab9b 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -147,6 +147,7 @@ #include #include #include +#include #include #include @@ -4987,6 +4988,26 @@ static int nv_close(struct net_device *dev) return 0; } +static int have_broken_macaddr(void) +{ + static const struct dmi_system_id brokenmac_sysids[] = { + { + .ident = "blahblah", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "MY_VENDOR"), + DMI_MATCH(DMI_PRODUCT_NAME, "blahblah"), + }, + }, + + { } /* terminate list */ + }; + + if (dmi_check_system(brokenmac_sysids)) + return 1; + + return 0; +} + static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) { struct net_device *dev; @@ -4997,6 +5018,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i u32 powerstate, txreg; u32 phystate_orig = 0, phystate; int phyinitialized = 0; + int broken_macaddr = 0; DECLARE_MAC_BUF(mac); static int printed_version; @@ -5180,10 +5202,14 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i np->orig_mac[0] = readl(base + NvRegMacAddrA); np->orig_mac[1] = readl(base + NvRegMacAddrB); + if (!(id->driver_data & DEV_HAS_CORRECT_MACADDR)) + broken_macaddr = 1; + else if (have_broken_macaddr()) + broken_macaddr = 1; + /* check the workaround bit for correct mac address order */ txreg = readl(base + NvRegTransmitPoll); - if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) || - (id->driver_data & DEV_HAS_CORRECT_MACADDR)) { + if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) || (!broken_macaddr)) { /* mac address is already in correct order */ dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff; dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;