summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWu Fengguang <wfg@linux.intel.com>2009-01-06 18:52:58 +0000
committerDavid S. Miller <davem@davemloft.net>2009-01-08 10:46:02 -0800
commit4b9f8ec6e5e98779e8b3806a5f58267378ef57eb (patch)
tree7690cc4c886fc612ec124b4b90c530affef7222f /drivers/net
parent684f2176015b313ab59cecf574117969cf638f28 (diff)
downloadblackbird-op-linux-4b9f8ec6e5e98779e8b3806a5f58267378ef57eb.tar.gz
blackbird-op-linux-4b9f8ec6e5e98779e8b3806a5f58267378ef57eb.zip
dm9601: tell HW about random generated mac address
Otherwise unicast RX will only work in promisc mode. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/dm9601.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 49a30bde7a89..63e97a387085 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -397,6 +397,11 @@ static void dm9601_set_multicast(struct net_device *net)
dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
}
+static void __dm9601_set_mac_address(struct usbnet *dev)
+{
+ dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr);
+}
+
static int dm9601_set_mac_address(struct net_device *net, void *p)
{
struct sockaddr *addr = p;
@@ -406,7 +411,7 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
return -EINVAL;
memcpy(net->dev_addr, addr->sa_data, net->addr_len);
- dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr);
+ __dm9601_set_mac_address(dev);
return 0;
}
@@ -450,6 +455,8 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
*/
if (is_valid_ether_addr(mac))
memcpy(dev->net->dev_addr, mac, ETH_ALEN);
+ else
+ __dm9601_set_mac_address(dev);
/* power up phy */
dm_write_reg(dev, DM_GPR_CTRL, 1);
OpenPOWER on IntegriCloud