aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2014-09-29 05:55:35 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-29 14:36:26 -0400
commita0d2e51390622e4dfd9d7bffb768e6fa22fb7daf (patch)
treebe1ea9a0c987658724a555bdb8f233435507c6e2
parent226ee6751541a958cd1ad982f5ba0f9affde6141 (diff)
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 <m.grzeschik@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/arcnet/com20020.c14
1 files changed, 14 insertions, 0 deletions
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)
149 return 0; 149 return 0;
150} 150}
151 151
152static int com20020_set_hwaddr(struct net_device *dev, void *addr)
153{
154 int ioaddr = dev->base_addr;
155 struct arcnet_local *lp = netdev_priv(dev);
156 struct sockaddr *hwaddr = addr;
157
158 memcpy(dev->dev_addr, hwaddr->sa_data, 1);
159 SET_SUBADR(SUB_NODE);
160 outb(dev->dev_addr[0], _XREG);
161
162 return 0;
163}
164
152const struct net_device_ops com20020_netdev_ops = { 165const struct net_device_ops com20020_netdev_ops = {
153 .ndo_open = arcnet_open, 166 .ndo_open = arcnet_open,
154 .ndo_stop = arcnet_close, 167 .ndo_stop = arcnet_close,
155 .ndo_start_xmit = arcnet_send_packet, 168 .ndo_start_xmit = arcnet_send_packet,
156 .ndo_tx_timeout = arcnet_timeout, 169 .ndo_tx_timeout = arcnet_timeout,
170 .ndo_set_mac_address = com20020_set_hwaddr,
157 .ndo_set_rx_mode = com20020_set_mc_list, 171 .ndo_set_rx_mode = com20020_set_mc_list,
158}; 172};
159 173