lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 May 2019 08:24:03 +0000
From:   Andy Duan <fugang.duan@....com>
To:     "davem@...emloft.net" <davem@...emloft.net>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "ynezz@...e.cz" <ynezz@...e.cz>,
        "john@...ozen.org" <john@...ozen.org>,
        "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
        Andy Duan <fugang.duan@....com>
Subject: [PATCH net 2/3] of_net: add property "nvmem-mac-address" for
 of_get_mac_addr()

If MAC address read from nvmem cell and it is valid mac address,
.of_get_mac_addr_nvmem() add new property "nvmem-mac-address" in
ethernet node. Once user call .of_get_mac_address() to get MAC
address again, it can read valid MAC address from device tree in
directly.

Signed-off-by: Fugang Duan <fugang.duan@....com>
---
 drivers/of/of_net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index 9649cd5..5071241 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -125,6 +125,10 @@ const void *of_get_mac_address(struct device_node *np)
 	if (addr)
 		return addr;
 
+	addr = of_get_mac_addr(np, "nvmem-mac-address");
+	if (addr)
+		return addr;
+
 	return of_get_mac_addr_nvmem(np);
 }
 EXPORT_SYMBOL(of_get_mac_address);
-- 
2.7.4

Powered by blists - more mailing lists