Lines Matching full:mac
64 const void *mac; in of_get_mac_addr_nvmem() local
77 cell = of_nvmem_cell_get(np, "mac-address"); in of_get_mac_addr_nvmem()
81 mac = nvmem_cell_read(cell, &len); in of_get_mac_addr_nvmem()
84 if (IS_ERR(mac)) in of_get_mac_addr_nvmem()
85 return PTR_ERR(mac); in of_get_mac_addr_nvmem()
87 if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { in of_get_mac_addr_nvmem()
88 kfree(mac); in of_get_mac_addr_nvmem()
92 memcpy(addr, mac, ETH_ALEN); in of_get_mac_addr_nvmem()
93 kfree(mac); in of_get_mac_addr_nvmem()
103 * Search the device tree for the best MAC address to use. 'mac-address' is
104 * checked first, because that is supposed to contain to "most recent" MAC
105 * address. If that isn't set, then 'local-mac-address' is checked next,
108 * of the above isn't set, then try to get MAC address from nvmem cell named
109 * 'mac-address'.
113 * MAC address.
115 * All-zero MAC addresses are rejected, because those could be properties that
117 * DTS could define 'mac-address' and 'local-mac-address', with zero MAC
118 * addresses. Some older U-Boots only initialized 'local-mac-address'. In
119 * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
131 ret = of_get_mac_addr(np, "mac-address", addr); in of_get_mac_address()
135 ret = of_get_mac_addr(np, "local-mac-address", addr); in of_get_mac_address()
152 * Search the device tree for the best MAC address to use.