net: Move environment functions to the common file
[oweals/u-boot.git] / net / eth_internal.h
index e65d8984e897853747f8db00c210417bd9d219dc..38d84201e6191e0b5102de3af564bdd20d207659 100644 (file)
 /* Do init that is common to driver model and legacy networking */
 void eth_common_init(void);
 
+/**
+ * eth_setenv_enetaddr_by_index() - set the MAC address envrionment variable
+ *
+ * This sets up an environment variable with the given MAC address (@enetaddr).
+ * The environment variable to be set is defined by <@base_name><@index>addr.
+ * If @index is 0 it is omitted. For common Ethernet this means ethaddr,
+ * eth1addr, etc.
+ *
+ * @base_name: Base name for variable, typically "eth"
+ * @index:     Index of interface being updated (>=0)
+ * @enetaddr:  Pointer to MAC address to put into the variable
+ * @return 0 if OK, other value on error
+ */
+int eth_setenv_enetaddr_by_index(const char *base_name, int index,
+                                uchar *enetaddr);
+
 #endif