From patchwork Fri Mar 18 11:18:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 64052 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1011968lbc; Fri, 18 Mar 2016 05:06:30 -0700 (PDT) X-Received: by 10.28.63.13 with SMTP id m13mr44494970wma.55.1458302790031; Fri, 18 Mar 2016 05:06:30 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id i2si15767072wja.89.2016.03.18.05.06.29; Fri, 18 Mar 2016 05:06:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81AA7A76AD; Fri, 18 Mar 2016 13:06:28 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ClXN-CxxU_67; Fri, 18 Mar 2016 13:06:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80567A76CE; Fri, 18 Mar 2016 13:06:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 89B98A76A4 for ; Fri, 18 Mar 2016 12:18:25 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pJ53QAH4-bQc for ; Fri, 18 Mar 2016 12:18:25 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 1A778A761E for ; Fri, 18 Mar 2016 12:18:22 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u2IBIIWs019175; Fri, 18 Mar 2016 06:18:18 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u2IBIIRH022388; Fri, 18 Mar 2016 06:18:18 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Fri, 18 Mar 2016 06:18:18 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u2IBIERj028502; Fri, 18 Mar 2016 06:18:16 -0500 From: Roger Quadros To: Date: Fri, 18 Mar 2016 13:18:11 +0200 Message-ID: <1458299892-30818-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458299892-30818-1-git-send-email-rogerq@ti.com> References: <1458299892-30818-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 18 Mar 2016 13:06:18 +0100 Cc: Roger Quadros , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] net: export eth_setenv_enetaddr_by_index() to net.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Some TI boards (e.g. IDK) have 4 to 6 ethernet ports and this function is handy at board.c to configure the MAC address of the ports. Signed-off-by: Roger Quadros --- include/net.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.5.0 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/include/net.h b/include/net.h index a739f45..03ae232 100644 --- a/include/net.h +++ b/include/net.h @@ -237,6 +237,23 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr); int eth_getenv_enetaddr(const char *name, uchar *enetaddr); int eth_setenv_enetaddr(const char *name, const uchar *enetaddr); +/** + * 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); + + /* * Get the hardware address for an ethernet interface . * Args: