Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225222
b: refs/heads/master
c: 4b4f546
h: refs/heads/master
v: v3
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Dec 21, 2010
1 parent cfe2f81 commit 596ebfe
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 24de5285dce378e4170e068f2662236d2b46c033
refs/heads/master: 4b4f54670859074cf7670cc6fa96fe34a65846d9
16 changes: 15 additions & 1 deletion trunk/drivers/net/sundance.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ static void netdev_error(struct net_device *dev, int intr_status);
static void netdev_error(struct net_device *dev, int intr_status);
static void set_rx_mode(struct net_device *dev);
static int __set_mac_addr(struct net_device *dev);
static int sundance_set_mac_addr(struct net_device *dev, void *data);
static struct net_device_stats *get_stats(struct net_device *dev);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int netdev_close(struct net_device *dev);
Expand Down Expand Up @@ -467,7 +468,7 @@ static const struct net_device_ops netdev_ops = {
.ndo_do_ioctl = netdev_ioctl,
.ndo_tx_timeout = tx_timeout,
.ndo_change_mtu = change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_set_mac_address = sundance_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};

Expand Down Expand Up @@ -1595,6 +1596,19 @@ static int __set_mac_addr(struct net_device *dev)
return 0;
}

/* Invoked with rtnl_lock held */
static int sundance_set_mac_addr(struct net_device *dev, void *data)
{
const struct sockaddr *addr = data;

if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
__set_mac_addr(dev);

return 0;
}

static const struct {
const char name[ETH_GSTRING_LEN];
} sundance_stats[] = {
Expand Down

0 comments on commit 596ebfe

Please sign in to comment.