aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/usb/mcs7830.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index ebf1332abaa1..ca9d00c1194e 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -446,6 +446,29 @@ static struct ethtool_ops mcs7830_ethtool_ops = {
446 .nway_reset = usbnet_nway_reset, 446 .nway_reset = usbnet_nway_reset,
447}; 447};
448 448
449static int mcs7830_set_mac_address(struct net_device *netdev, void *p)
450{
451 int ret;
452 struct usbnet *dev = netdev_priv(netdev);
453 struct sockaddr *addr = p;
454
455 if (netif_running(netdev))
456 return -EBUSY;
457
458 if (!is_valid_ether_addr(addr->sa_data))
459 return -EINVAL;
460
461 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
462
463 ret = mcs7830_set_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN,
464 netdev->dev_addr);
465
466 if (ret < 0)
467 return ret;
468
469 return 0;
470}
471
449static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) 472static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
450{ 473{
451 struct net_device *net = dev->net; 474 struct net_device *net = dev->net;
@@ -459,6 +482,7 @@ static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev)
459 net->ethtool_ops = &mcs7830_ethtool_ops; 482 net->ethtool_ops = &mcs7830_ethtool_ops;
460 net->set_multicast_list = mcs7830_set_multicast; 483 net->set_multicast_list = mcs7830_set_multicast;
461 mcs7830_set_multicast(net); 484 mcs7830_set_multicast(net);
485 net->set_mac_address = mcs7830_set_mac_address;
462 486
463 /* reserve space for the status byte on rx */ 487 /* reserve space for the status byte on rx */
464 dev->rx_urb_size = ETH_FRAME_LEN + 1; 488 dev->rx_urb_size = ETH_FRAME_LEN + 1;