blob: a2de5b1553ecf1eef0c627a8b1a67013b1e7cb56 [file] [log] [blame]
Philip Oberfichtner62a09922022-07-26 15:04:50 +02001/* SPDX-License-Identifier: GPL-2.0+
2 *
3 * Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
4 */
5
6/*
7 * dh_mac_is_in_env - Check if MAC address is already set
8 *
9 * @env: name of environment variable
10 * Return: true if MAC is set, false otherwise
11 */
12bool dh_mac_is_in_env(const char *env);
13
14/*
Marek Vasut29ab1a92024-03-12 22:15:58 +010015 * dh_get_mac_is_enabled - Test if ethernet MAC is enabled in DT
16 *
17 * @alias: alias for ethernet MAC device tree node
18 * Return: 0 if OK, other value on error
19 */
20int dh_get_mac_is_enabled(const char *alias);
21
22/*
Philip Oberfichtner62a09922022-07-26 15:04:50 +020023 * dh_get_mac_from_eeprom - Get MAC address from eeprom and write it to enetaddr
24 *
25 * @enetaddr: buffer where address is to be stored
26 * @alias: alias for EEPROM device tree node
27 * Return: 0 if OK, other value on error
28 */
29int dh_get_mac_from_eeprom(unsigned char *enetaddr, const char *alias);
30
31/*
32 * dh_setup_mac_address - Try to get MAC address from various locations and write it to env
33 *
34 * Return: 0 if OK, other value on error
35 */
36int dh_setup_mac_address(void);