blob: 0b829a8d3883428763a3ccfe7dfd2553bb679b44 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass0a9bde12016-01-17 14:51:57 -07002/*
3 * (C) Copyright 2001-2015
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * Joe Hershberger, National Instruments
Simon Glass0a9bde12016-01-17 14:51:57 -07006 */
7
8#ifndef __ETH_INTERNAL_H
9#define __ETH_INTERNAL_H
10
11/* Do init that is common to driver model and legacy networking */
12void eth_common_init(void);
13
Simon Glassce63f892016-01-17 14:51:58 -070014/**
Simon Glass8551d552017-08-03 12:22:11 -060015 * eth_env_set_enetaddr_by_index() - set the MAC address environment variable
Simon Glassce63f892016-01-17 14:51:58 -070016 *
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
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010025 * Return: 0 if OK, other value on error
Simon Glassce63f892016-01-17 14:51:58 -070026 */
Simon Glass8551d552017-08-03 12:22:11 -060027int eth_env_set_enetaddr_by_index(const char *base_name, int index,
Simon Glassce63f892016-01-17 14:51:58 -070028 uchar *enetaddr);
29
Simon Glassd9582c32016-01-17 14:51:59 -070030int eth_mac_skip(int index);
31void eth_current_changed(void);
Simon Glassd9582c32016-01-17 14:51:59 -070032void eth_set_dev(struct udevice *dev);
Simon Glassd9582c32016-01-17 14:51:59 -070033void eth_set_current_to_next(void);
34
Simon Glass0a9bde12016-01-17 14:51:57 -070035#endif