提交 d1d5e6b1 编写于 作者: D Daniele Venzano 提交者: David S. Miller

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: NDaniele Venzano <venza@brownhat.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d7e094d4
...@@ -509,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, ...@@ -509,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
else else
ret = sis900_get_mac_addr(pci_dev, net_dev); ret = sis900_get_mac_addr(pci_dev, net_dev);
if (ret == 0) { if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) {
printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name); random_ether_addr(net_dev->dev_addr);
ret = -ENODEV; printk(KERN_WARNING "%s: Unreadable or invalid MAC address,"
goto err_unmap_rx; "using random generated one\n", dev_name);
} }
/* 630ET : set the mii access mode as software-mode */ /* 630ET : set the mii access mode as software-mode */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册