Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109268
b: refs/heads/master
c: 1025433
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Martin authored and Jeff Garzik committed Aug 27, 2008
1 parent 676d049 commit f357d5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8382cc1c2d0eb8918d3b71bf6cb8ac2e883f3e33
refs/heads/master: 1025433147e635af9cd150676a097396cf666ddb
24 changes: 24 additions & 0 deletions trunk/drivers/net/usb/mcs7830.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,29 @@ static struct ethtool_ops mcs7830_ethtool_ops = {
.nway_reset = usbnet_nway_reset,
};

static int mcs7830_set_mac_address(struct net_device *netdev, void *p)
{
int ret;
struct usbnet *dev = netdev_priv(netdev);
struct sockaddr *addr = p;

if (netif_running(netdev))
return -EBUSY;

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

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

ret = mcs7830_set_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN,
netdev->dev_addr);

if (ret < 0)
return ret;

return 0;
}

static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
{
struct net_device *net = dev->net;
Expand All @@ -459,6 +482,7 @@ static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
net->ethtool_ops = &mcs7830_ethtool_ops;
net->set_multicast_list = mcs7830_set_multicast;
mcs7830_set_multicast(net);
net->set_mac_address = mcs7830_set_mac_address;

/* reserve space for the status byte on rx */
dev->rx_urb_size = ETH_FRAME_LEN + 1;
Expand Down

0 comments on commit f357d5c

Please sign in to comment.