Philip Oberfichtner | 62a0992 | 2022-07-26 15:04:50 +0200 | [diff] [blame] | 1 | /* 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 | */ |
| 12 | bool dh_mac_is_in_env(const char *env); |
| 13 | |
| 14 | /* |
Marek Vasut | 29ab1a9 | 2024-03-12 22:15:58 +0100 | [diff] [blame] | 15 | * 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 | */ |
| 20 | int dh_get_mac_is_enabled(const char *alias); |
| 21 | |
| 22 | /* |
Philip Oberfichtner | 62a0992 | 2022-07-26 15:04:50 +0200 | [diff] [blame] | 23 | * 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 | */ |
| 29 | int 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 | */ |
| 36 | int dh_setup_mac_address(void); |