Skip to content

Commit

Permalink
ARCNET: add com20020_set_hwddr to change address
Browse files Browse the repository at this point in the history
This patch adds com20020_set_hwaddr to make
it possible to change the hwaddr on runtime.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Grzeschik authored and David S. Miller committed Sep 29, 2014
1 parent 226ee67 commit a0d2e51
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/arcnet/com20020.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit a0d2e51

Please sign in to comment.