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