aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files/drivers
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-03-13 08:38:01 +0000
committerJohn Crispin <john@openwrt.org>2015-03-13 08:38:01 +0000
commit2c94eef5dfa54748f7f2099f84ca86f82b4f8bc1 (patch)
tree35202a85a15fccdfd771c1433293883c1086e7ac /target/linux/ramips/files/drivers
parent800da5a02e48b435f390ac9694bf65d078a279ba (diff)
downloadupstream-2c94eef5dfa54748f7f2099f84ca86f82b4f8bc1.tar.gz
upstream-2c94eef5dfa54748f7f2099f84ca86f82b4f8bc1.tar.bz2
upstream-2c94eef5dfa54748f7f2099f84ca86f82b4f8bc1.zip
ralink: use random generate mac address instead of default one.
Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44740
Diffstat (limited to 'target/linux/ramips/files/drivers')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c9
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h1
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c2
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c1
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt305x.c2
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c1
6 files changed, 6 insertions, 10 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
index 96bc0e5fb1..c21643bbd3 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
@@ -1228,9 +1228,12 @@ static int __init fe_init(struct net_device *dev)
priv->soc->switch_init(priv);
of_get_mac_address_mtd(priv->device->of_node, dev->dev_addr);
- /*If the mac address is invalid, use default mac address */
- if (!is_valid_ether_addr(dev->dev_addr))
- memcpy(dev->dev_addr, priv->soc->mac, ETH_ALEN);
+ /*If the mac address is invalid, use random mac address */
+ if (!is_valid_ether_addr(dev->dev_addr)) {
+ random_ether_addr(dev->dev_addr);
+ dev_err(priv->device, "generated random MAC address %pM\n",
+ dev->dev_addr);
+ }
err = fe_mdio_init(priv);
if (err)
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
index bf2a999f60..9d5ea0ce58 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
@@ -386,7 +386,6 @@ struct fe_phy {
struct fe_soc_data
{
- unsigned char mac[6];
const u32 *reg_table;
void (*init_data)(struct fe_soc_data *data, struct net_device *netdev);
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index 3d610ec38a..f408f07733 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -229,7 +229,6 @@ static void mt7621_set_mac(struct fe_priv *priv, unsigned char *mac)
}
static struct fe_soc_data mt7620_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = mt7620_init_data,
.reset_fe = mt7620_fe_reset,
.set_mac = mt7620_set_mac,
@@ -251,7 +250,6 @@ static struct fe_soc_data mt7620_data = {
};
static struct fe_soc_data mt7621_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = mt7621_init_data,
.reset_fe = mt7621_fe_reset,
.set_mac = mt7621_set_mac,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
index 715221b100..147687b39e 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
@@ -57,7 +57,6 @@ static int rt2880_fwd_config(struct fe_priv *priv)
}
struct fe_soc_data rt2880_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = rt2880_init_data,
.reset_fe = rt2880_fe_reset,
.fwd_config = rt2880_fwd_config,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt305x.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt305x.c
index 4c04ca5f5b..eacb8d874b 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt305x.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt305x.c
@@ -125,7 +125,6 @@ static void rt5350_fe_reset(void)
}
static struct fe_soc_data rt3050_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = rt305x_init_data,
.reset_fe = rt305x_fe_reset,
.fwd_config = rt3050_fwd_config,
@@ -137,7 +136,6 @@ static struct fe_soc_data rt3050_data = {
};
static struct fe_soc_data rt5350_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = rt5350_init_data,
.reg_table = rt5350_reg_table,
.reset_fe = rt5350_fe_reset,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
index 5d540c2c1e..82499fe3b6 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
@@ -56,7 +56,6 @@ static void rt3883_init_data(struct fe_soc_data *data,
}
static struct fe_soc_data rt3883_data = {
- .mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.init_data = rt3883_init_data,
.reset_fe = rt3883_fe_reset,
.fwd_config = rt3883_fwd_config,