Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150504
b: refs/heads/master
c: 3d6593e
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hao authored and David S. Miller committed May 27, 2009
1 parent 7b56ac4 commit 1b47034
Show file tree
Hide file tree
Showing 2 changed files with 33 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: 9c5cd6708008fcc3dbced6e4b97aa5ecd0634a85
refs/heads/master: 3d6593e9cc40d0eacc03f75f90834794a4a477df
33 changes: 32 additions & 1 deletion trunk/drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3325,6 +3325,37 @@ static void ucc_netpoll(struct net_device *dev)
}
#endif /* CONFIG_NET_POLL_CONTROLLER */

static int ucc_geth_set_mac_addr(struct net_device *dev, void *p)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);
struct sockaddr *addr = p;

if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;

memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);

/*
* If device is not running, we will set mac addr register
* when opening the device.
*/
if (!netif_running(dev))
return 0;

spin_lock_irq(&ugeth->lock);
init_mac_station_addr_regs(dev->dev_addr[0],
dev->dev_addr[1],
dev->dev_addr[2],
dev->dev_addr[3],
dev->dev_addr[4],
dev->dev_addr[5],
&ugeth->ug_regs->macstnaddr1,
&ugeth->ug_regs->macstnaddr2);
spin_unlock_irq(&ugeth->lock);

return 0;
}

/* Called when something needs to use the ethernet device */
/* Returns 0 for success. */
static int ucc_geth_open(struct net_device *dev)
Expand Down Expand Up @@ -3501,7 +3532,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = {
.ndo_stop = ucc_geth_close,
.ndo_start_xmit = ucc_geth_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_set_mac_address = ucc_geth_set_mac_addr,
.ndo_change_mtu = eth_change_mtu,
.ndo_set_multicast_list = ucc_geth_set_multi,
.ndo_tx_timeout = ucc_geth_timeout,
Expand Down

0 comments on commit 1b47034

Please sign in to comment.