Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127825
b: refs/heads/master
c: 4b9f8ec
h: refs/heads/master
i:
  127823: 0866fef
v: v3
  • Loading branch information
Wu Fengguang authored and David S. Miller committed Jan 8, 2009
1 parent 8b474c2 commit 6dd9a10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 684f2176015b313ab59cecf574117969cf638f28
refs/heads/master: 4b9f8ec6e5e98779e8b3806a5f58267378ef57eb
9 changes: 8 additions & 1 deletion trunk/drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6dd9a10

Please sign in to comment.