Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 0a9bde1 | 2016-01-17 14:51:57 -0700 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2001-2015 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 5 | * Joe Hershberger, National Instruments |
Simon Glass | 0a9bde1 | 2016-01-17 14:51:57 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __ETH_INTERNAL_H |
| 9 | #define __ETH_INTERNAL_H |
| 10 | |
| 11 | /* Do init that is common to driver model and legacy networking */ |
| 12 | void eth_common_init(void); |
| 13 | |
Simon Glass | ce63f89 | 2016-01-17 14:51:58 -0700 | [diff] [blame] | 14 | /** |
Simon Glass | 8551d55 | 2017-08-03 12:22:11 -0600 | [diff] [blame] | 15 | * eth_env_set_enetaddr_by_index() - set the MAC address environment variable |
Simon Glass | ce63f89 | 2016-01-17 14:51:58 -0700 | [diff] [blame] | 16 | * |
| 17 | * This sets up an environment variable with the given MAC address (@enetaddr). |
| 18 | * The environment variable to be set is defined by <@base_name><@index>addr. |
| 19 | * If @index is 0 it is omitted. For common Ethernet this means ethaddr, |
| 20 | * eth1addr, etc. |
| 21 | * |
| 22 | * @base_name: Base name for variable, typically "eth" |
| 23 | * @index: Index of interface being updated (>=0) |
| 24 | * @enetaddr: Pointer to MAC address to put into the variable |
| 25 | * @return 0 if OK, other value on error |
| 26 | */ |
Simon Glass | 8551d55 | 2017-08-03 12:22:11 -0600 | [diff] [blame] | 27 | int eth_env_set_enetaddr_by_index(const char *base_name, int index, |
Simon Glass | ce63f89 | 2016-01-17 14:51:58 -0700 | [diff] [blame] | 28 | uchar *enetaddr); |
| 29 | |
Simon Glass | d9582c3 | 2016-01-17 14:51:59 -0700 | [diff] [blame] | 30 | int eth_mac_skip(int index); |
| 31 | void eth_current_changed(void); |
| 32 | #ifdef CONFIG_DM_ETH |
| 33 | void eth_set_dev(struct udevice *dev); |
| 34 | #else |
| 35 | void eth_set_dev(struct eth_device *dev); |
| 36 | #endif |
| 37 | void eth_set_current_to_next(void); |
| 38 | |
Simon Glass | 0a9bde1 | 2016-01-17 14:51:57 -0700 | [diff] [blame] | 39 | #endif |