Lines Matching full:mac
65 const void *mac; in of_get_mac_address_nvmem() local
78 cell = of_nvmem_cell_get(np, "mac-address"); in of_get_mac_address_nvmem()
82 mac = nvmem_cell_read(cell, &len); in of_get_mac_address_nvmem()
85 if (IS_ERR(mac)) in of_get_mac_address_nvmem()
86 return PTR_ERR(mac); in of_get_mac_address_nvmem()
88 if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { in of_get_mac_address_nvmem()
89 kfree(mac); in of_get_mac_address_nvmem()
93 memcpy(addr, mac, ETH_ALEN); in of_get_mac_address_nvmem()
94 kfree(mac); in of_get_mac_address_nvmem()
105 * Search the device tree for the best MAC address to use. 'mac-address' is
106 * checked first, because that is supposed to contain to "most recent" MAC
107 * address. If that isn't set, then 'local-mac-address' is checked next,
110 * of the above isn't set, then try to get MAC address from nvmem cell named
111 * 'mac-address'.
115 * MAC address.
117 * All-zero MAC addresses are rejected, because those could be properties that
119 * DTS could define 'mac-address' and 'local-mac-address', with zero MAC
120 * addresses. Some older U-Boots only initialized 'local-mac-address'. In
121 * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
133 ret = of_get_mac_addr(np, "mac-address", addr); in of_get_mac_address()
137 ret = of_get_mac_addr(np, "local-mac-address", addr); in of_get_mac_address()
154 * Search the device tree for the best MAC address to use.