[OpenWrt-Devel] [PATCH v2 3/4] mpc85xx: gianfar: add mtd-mac-address support

Matthias Schiffer mschiffer at universe-factory.net
Thu Apr 30 16:31:43 EDT 2015


Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 .../101-net-gianfar-use-mtd-mac-address.patch         | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 target/linux/mpc85xx/patches-3.18/101-net-gianfar-use-mtd-mac-address.patch

diff --git a/target/linux/mpc85xx/patches-3.18/101-net-gianfar-use-mtd-mac-address.patch b/target/linux/mpc85xx/patches-3.18/101-net-gianfar-use-mtd-mac-address.patch
new file mode 100644
index 0000000..1b7abc8
--- /dev/null
+++ b/target/linux/mpc85xx/patches-3.18/101-net-gianfar-use-mtd-mac-address.patch
@@ -0,0 +1,19 @@
+--- a/drivers/net/ethernet/freescale/gianfar.c
++++ b/drivers/net/ethernet/freescale/gianfar.c
+@@ -858,10 +858,13 @@ static int gfar_of_init(struct platform_
+ 	if (stash_len || stash_idx)
+ 		priv->device_flags |= FSL_GIANFAR_DEV_HAS_BUF_STASHING;
+ 
+-	mac_addr = of_get_mac_address(np);
++	err = of_get_mac_address_mtd(np, dev->dev_addr);
++	if (err) {
++		mac_addr = of_get_mac_address(np);
+ 
+-	if (mac_addr)
+-		memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
++		if (mac_addr)
++			memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
++	}
+ 
+ 	if (model && !strcasecmp(model, "TSEC"))
+ 		priv->device_flags |= FSL_GIANFAR_DEV_HAS_GIGABIT |
-- 
2.3.7
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list