summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-26 11:55:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-26 11:56:22 +0200
commit1dd5262eb950210a77a01d79327d2fbadae65f86 (patch)
treeae7b2aec8c80f2fe281a0f4936f8127f1cc750f6
parent3b6a1db325bbb3bc89f38efe9527c41367e6e1f1 (diff)
downloadbarebox-1dd5262eb950210a77a01d79327d2fbadae65f86.tar.gz
net: Make set_ethaddr argument const
The set_ethaddr callback should not modify the MAC address passed to it, so make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/net/altera_tse.c2
-rw-r--r--drivers/net/ar231x.c2
-rw-r--r--drivers/net/arc_emac.c2
-rw-r--r--drivers/net/at91_ether.c2
-rw-r--r--drivers/net/cpsw.c2
-rw-r--r--drivers/net/cs8900.c2
-rw-r--r--drivers/net/davinci_emac.c2
-rw-r--r--drivers/net/designware.c2
-rw-r--r--drivers/net/dm9k.c2
-rw-r--r--drivers/net/ep93xx.c2
-rw-r--r--drivers/net/ethoc.c2
-rw-r--r--drivers/net/fec_imx.c2
-rw-r--r--drivers/net/fec_mpc5200.c2
-rw-r--r--drivers/net/gianfar.c2
-rw-r--r--drivers/net/ks8851_mll.c2
-rw-r--r--drivers/net/macb.c2
-rw-r--r--drivers/net/mvneta.c2
-rw-r--r--drivers/net/netx_eth.c2
-rw-r--r--drivers/net/orion-gbe.c2
-rw-r--r--drivers/net/rtl8139.c2
-rw-r--r--drivers/net/rtl8169.c2
-rw-r--r--drivers/net/smc91111.c2
-rw-r--r--drivers/net/smc911x.c2
-rw-r--r--drivers/net/tap.c2
-rw-r--r--drivers/net/usb/asix.c2
-rw-r--r--drivers/net/usb/smsc95xx.c2
-rw-r--r--drivers/net/xgmac.c2
-rw-r--r--include/net.h2
28 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index 385a715..a186365 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -231,7 +231,7 @@ static int tse_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
-static int tse_set_ethaddr(struct eth_device *edev, unsigned char *m)
+static int tse_set_ethaddr(struct eth_device *edev, const unsigned char *m)
{
struct altera_tse_priv *priv = edev->priv;
struct alt_tse_mac *mac_dev = priv->tse_regs;
diff --git a/drivers/net/ar231x.c b/drivers/net/ar231x.c
index 48e4b30..7447c44 100644
--- a/drivers/net/ar231x.c
+++ b/drivers/net/ar231x.c
@@ -70,7 +70,7 @@ static void ar231x_reset_bit_(struct ar231x_eth_priv *priv,
(*priv->reset_bit)(val, state);
}
-static int ar231x_set_ethaddr(struct eth_device *edev, unsigned char *addr);
+static int ar231x_set_ethaddr(struct eth_device *edev, const unsigned char *addr);
static void ar231x_reset_regs(struct eth_device *edev)
{
struct ar231x_eth_priv *priv = edev->priv;
diff --git a/drivers/net/arc_emac.c b/drivers/net/arc_emac.c
index 84e2c75..3dc54cd 100644
--- a/drivers/net/arc_emac.c
+++ b/drivers/net/arc_emac.c
@@ -332,7 +332,7 @@ static int arc_emac_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return -1;
}
-static int arc_emac_set_ethaddr(struct eth_device *edev, unsigned char *mac)
+static int arc_emac_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct arc_emac_priv *priv = edev->priv;
unsigned int addr_low, addr_hi;
diff --git a/drivers/net/at91_ether.c b/drivers/net/at91_ether.c
index 5a74837..523e355 100644
--- a/drivers/net/at91_ether.c
+++ b/drivers/net/at91_ether.c
@@ -261,7 +261,7 @@ static int at91_ether_get_ethaddr(struct eth_device *eth, unsigned char *adr)
return -1;
}
-static int at91_ether_set_ethaddr(struct eth_device *eth, unsigned char *adr)
+static int at91_ether_set_ethaddr(struct eth_device *eth, const unsigned char *adr)
{
int i;
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index c0db96b..4d6b7b2 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -547,7 +547,7 @@ static int cpsw_get_hwaddr(struct eth_device *edev, unsigned char *mac)
return -1;
}
-static int cpsw_set_hwaddr(struct eth_device *edev, unsigned char *mac)
+static int cpsw_set_hwaddr(struct eth_device *edev, const unsigned char *mac)
{
struct cpsw_slave *slave = edev->priv;
struct cpsw_priv *priv = slave->cpsw;
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index dccb808..a4a5dca 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -341,7 +341,7 @@ static int cs8900_get_ethaddr(struct eth_device *dev, unsigned char *mac)
return 0;
}
-static int cs8900_set_ethaddr(struct eth_device *dev, unsigned char *mac)
+static int cs8900_set_ethaddr(struct eth_device *dev, const unsigned char *mac)
{
struct cs8900_priv *priv = (struct cs8900_priv *)dev->priv;
int i;
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 056ffe2..9f8f0e1 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -178,7 +178,7 @@ static int davinci_emac_get_ethaddr(struct eth_device *edev, unsigned char *adr)
* This function must be called before emac_open() if you want to override
* the default mac address.
*/
-static int davinci_emac_set_ethaddr(struct eth_device *edev, unsigned char *addr)
+static int davinci_emac_set_ethaddr(struct eth_device *edev, const unsigned char *addr)
{
struct davinci_emac_priv *priv = edev->priv;
int i;
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 213fe41..8006527 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -384,7 +384,7 @@ static int dwc_ether_get_ethaddr(struct eth_device *dev, u8 adr[6])
return -1;
}
-static int dwc_ether_set_ethaddr(struct eth_device *dev, u8 adr[6])
+static int dwc_ether_set_ethaddr(struct eth_device *dev, const unsigned char *adr)
{
struct dw_eth_dev *priv = dev->priv;
struct eth_mac_regs *mac_p = priv->mac_regs_p;
diff --git a/drivers/net/dm9k.c b/drivers/net/dm9k.c
index c3c2a80..1f1938d 100644
--- a/drivers/net/dm9k.c
+++ b/drivers/net/dm9k.c
@@ -711,7 +711,7 @@ static int dm9k_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
-static int dm9k_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int dm9k_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct dm9k *priv = (struct dm9k *)edev->priv;
int i, oft;
diff --git a/drivers/net/ep93xx.c b/drivers/net/ep93xx.c
index 4b73abf..90c12fc 100644
--- a/drivers/net/ep93xx.c
+++ b/drivers/net/ep93xx.c
@@ -466,7 +466,7 @@ static int ep93xx_eth_get_ethaddr(struct eth_device *edev,
}
static int ep93xx_eth_set_ethaddr(struct eth_device *edev,
- unsigned char *mac_addr)
+ const unsigned char *mac_addr)
{
struct mac_regs *regs = ep93xx_get_regs(edev);
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 7c52a09..6bae7d6 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -435,7 +435,7 @@ static int ethoc_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return 0;
}
-static int ethoc_set_ethaddr(struct eth_device *edev, unsigned char *mac)
+static int ethoc_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct ethoc *dev = edev->priv;
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 9a10c9f..78ccb85 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -249,7 +249,7 @@ static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
return -1;
}
-static int fec_set_hwaddr(struct eth_device *dev, unsigned char *mac)
+static int fec_set_hwaddr(struct eth_device *dev, const unsigned char *mac)
{
struct fec_priv *fec = (struct fec_priv *)dev->priv;
diff --git a/drivers/net/fec_mpc5200.c b/drivers/net/fec_mpc5200.c
index f431d79..14ef872 100644
--- a/drivers/net/fec_mpc5200.c
+++ b/drivers/net/fec_mpc5200.c
@@ -211,7 +211,7 @@ static int mpc5xxx_fec_get_ethaddr(struct eth_device *dev, unsigned char *mac)
return -1;
}
-static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, unsigned char *mac)
+static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, const unsigned char *mac)
{
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
uint8_t currByte; /* byte for which to compute the CRC */
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 5e47c64..ac69833 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -233,7 +233,7 @@ static int gfar_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return -ENODEV;
}
-static int gfar_set_ethaddr(struct eth_device *edev, unsigned char *mac)
+static int gfar_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct gfar_private *priv = edev->priv;
void __iomem *regs = priv->regs;
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index a8974cf..854a666 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -571,7 +571,7 @@ static int ks8851_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
-static int ks8851_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int ks8851_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct ks_net *priv = (struct ks_net *)edev->priv;
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 2ac00f3..6d4973f 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -493,7 +493,7 @@ static int macb_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
-static int macb_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int macb_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct macb_device *macb = edev->priv;
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 3be2ec5..aab52c4 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -486,7 +486,7 @@ recv_err:
return ret;
}
-static int mvneta_set_ethaddr(struct eth_device *edev, unsigned char *mac)
+static int mvneta_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct mvneta_port *priv = edev->priv;
u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3];
diff --git a/drivers/net/netx_eth.c b/drivers/net/netx_eth.c
index 96dbc7c..64e9886 100644
--- a/drivers/net/netx_eth.c
+++ b/drivers/net/netx_eth.c
@@ -210,7 +210,7 @@ static int netx_eth_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
-static int netx_eth_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int netx_eth_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct netx_eth_priv *priv = (struct netx_eth_priv *)edev->priv;
int xcno = priv->xcno;
diff --git a/drivers/net/orion-gbe.c b/drivers/net/orion-gbe.c
index 97ffff2..e6bd757 100644
--- a/drivers/net/orion-gbe.c
+++ b/drivers/net/orion-gbe.c
@@ -322,7 +322,7 @@ recv_err:
return ret;
}
-static int port_set_ethaddr(struct eth_device *edev, unsigned char *mac)
+static int port_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct port_priv *port = edev->priv;
u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3];
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index d57c706..a9eb865 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -352,7 +352,7 @@ static int rtl8139_get_ethaddr(struct eth_device *edev, unsigned char *m)
}
static int rtl8139_set_ethaddr(struct eth_device *edev,
- unsigned char *mac_addr)
+ const unsigned char *mac_addr)
{
struct rtl8139_priv *priv = edev->priv;
int i;
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index d6a7610..47d5e4a8 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -456,7 +456,7 @@ static int rtl8169_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
-static int rtl8169_set_ethaddr(struct eth_device *edev, unsigned char *mac_addr)
+static int rtl8169_set_ethaddr(struct eth_device *edev, const unsigned char *mac_addr)
{
struct rtl8169_priv *priv = edev->priv;
int i;
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index c0cf42a..5ea1bc3 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -1378,7 +1378,7 @@ static int smc91c111_get_ethaddr(struct eth_device *edev, unsigned char *m)
}
static int smc91c111_set_ethaddr(struct eth_device *edev,
- unsigned char *mac_addr)
+ const unsigned char *mac_addr)
{
struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv;
unsigned address;
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 9977ae3..dc46ef1 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -182,7 +182,7 @@ static int smc911x_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
-static int smc911x_set_ethaddr(struct eth_device *edev, unsigned char *m)
+static int smc911x_set_ethaddr(struct eth_device *edev, const unsigned char *m)
{
unsigned long addrh, addrl;
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 2458fb5..ca53f12 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -65,7 +65,7 @@ static int tap_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
-static int tap_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int tap_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
return 0;
}
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 7cce5b9..4c53a14 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -403,7 +403,7 @@ static int asix_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
-static int asix_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int asix_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
/* not possible? */
return 0;
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 053da18..6360e48 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -363,7 +363,7 @@ static int smsc95xx_set_csums(struct usbnet *dev)
return 0;
}
-static int smsc95xx_set_ethaddr(struct eth_device *edev, unsigned char *adr)
+static int smsc95xx_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct usbnet *udev = container_of(edev, struct usbnet, edev);
diff --git a/drivers/net/xgmac.c b/drivers/net/xgmac.c
index 3b2273f..7cc4d48 100644
--- a/drivers/net/xgmac.c
+++ b/drivers/net/xgmac.c
@@ -674,7 +674,7 @@ static int xgmac_get_ethaddr(struct eth_device *edev, unsigned char *addr)
return 0;
}
-static int xgmac_set_ethaddr(struct eth_device *dev, unsigned char *addr)
+static int xgmac_set_ethaddr(struct eth_device *dev, const unsigned char *addr)
{
struct xgmac_priv *priv = dev->priv;
u32 data;
diff --git a/include/net.h b/include/net.h
index 364011b..2955937 100644
--- a/include/net.h
+++ b/include/net.h
@@ -42,7 +42,7 @@ struct eth_device {
int (*recv) (struct eth_device*);
void (*halt) (struct eth_device*);
int (*get_ethaddr) (struct eth_device*, u8 adr[6]);
- int (*set_ethaddr) (struct eth_device*, u8 adr[6]);
+ int (*set_ethaddr) (struct eth_device*, const unsigned char *adr);
struct eth_device *next;
void *priv;