From: Michael Grzeschik Date: Mon, 29 Sep 2014 09:55:35 +0000 (+0200) Subject: ARCNET: add com20020_set_hwddr to change address X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a0d2e51390622e4dfd9d7bffb768e6fa22fb7daf;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ARCNET: add com20020_set_hwddr to change address This patch adds com20020_set_hwaddr to make it possible to change the hwaddr on runtime. Signed-off-by: Michael Grzeschik Signed-off-by: David S. Miller --- diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index 7b96c5f47e8d..1a8437842fbc 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c @@ -149,11 +149,25 @@ int com20020_check(struct net_device *dev) return 0; } +static int com20020_set_hwaddr(struct net_device *dev, void *addr) +{ + int ioaddr = dev->base_addr; + struct arcnet_local *lp = netdev_priv(dev); + struct sockaddr *hwaddr = addr; + + memcpy(dev->dev_addr, hwaddr->sa_data, 1); + SET_SUBADR(SUB_NODE); + outb(dev->dev_addr[0], _XREG); + + return 0; +} + const struct net_device_ops com20020_netdev_ops = { .ndo_open = arcnet_open, .ndo_stop = arcnet_close, .ndo_start_xmit = arcnet_send_packet, .ndo_tx_timeout = arcnet_timeout, + .ndo_set_mac_address = com20020_set_hwaddr, .ndo_set_rx_mode = com20020_set_mc_list, };