diff options
author | Daniele Venzano <venza@brownhat.org> | 2009-01-14 23:46:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-14 23:46:24 -0500 |
commit | d1d5e6b1cead3df6f722d1d458874bd7f93da8d6 (patch) | |
tree | 3bf0d0a8202ef17b7c2369d877bfe9a98ed66b97 | |
parent | d7e094d4212bc72f5575e54edfef1349e0c4cdb5 (diff) |
sis900: generate fake MAC address if the hardware doesn't have one
The attached patch modifies the sis900 driver when the MAC address
read from the hardware is invalid. As suggested, the patch now
generates a random address so that the user can go on and use
the hardware. In any case a message is also shown to warn on the
unexpected condition.
This seems to happen with newer HW implementation of the sis900
chipset, since this never came up before.
Patch is against vanilla 2.6.28 (but the driver doesn't change so often,
so it will probably apply to older/newer versions too).
See bugzilla ID 10201 and 11649 and ignore the previous patch.
Signed-off-by: Daniele Venzano <venza@brownhat.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/sis900.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 6cbefcae9ac2..be4465bc0a69 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -509,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, | |||
509 | else | 509 | else |
510 | ret = sis900_get_mac_addr(pci_dev, net_dev); | 510 | ret = sis900_get_mac_addr(pci_dev, net_dev); |
511 | 511 | ||
512 | if (ret == 0) { | 512 | if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) { |
513 | printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name); | 513 | random_ether_addr(net_dev->dev_addr); |
514 | ret = -ENODEV; | 514 | printk(KERN_WARNING "%s: Unreadable or invalid MAC address," |
515 | goto err_unmap_rx; | 515 | "using random generated one\n", dev_name); |
516 | } | 516 | } |
517 | 517 | ||
518 | /* 630ET : set the mii access mode as software-mode */ | 518 | /* 630ET : set the mii access mode as software-mode */ |