From patchwork Thu Nov 17 22:52:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 126328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4CE20B7249 for ; Fri, 18 Nov 2011 09:53:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1046C28ADA; Thu, 17 Nov 2011 23:53:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 6tkzCQ7PzoBk; Thu, 17 Nov 2011 23:53:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B53428AB1; Thu, 17 Nov 2011 23:53:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D71C28AB1 for ; Thu, 17 Nov 2011 23:53:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 zkH2WQX7WPKD for ; Thu, 17 Nov 2011 23:53:50 +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 mail.serverraum.org (mail.serverraum.org [78.47.150.89]) by theia.denx.de (Postfix) with ESMTP id 506B928AAC for ; Thu, 17 Nov 2011 23:53:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.serverraum.org (Postfix) with ESMTP id DFCEE3EF86; Thu, 17 Nov 2011 23:53:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.serverraum.org Received: from mail.serverraum.org ([127.0.0.1]) by localhost (web.serverraum.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xW1EmdynK1ON; Thu, 17 Nov 2011 23:53:55 +0100 (CET) Received: from thanatos.fritz.box (95-89-251-205-dynip.superkabel.de [95.89.251.205]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.serverraum.org (Postfix) with ESMTPSA id 316BD3EF1D; Thu, 17 Nov 2011 23:53:49 +0100 (CET) From: Michael Walle To: u-boot@lists.denx.de Date: Thu, 17 Nov 2011 23:52:29 +0100 Message-Id: <1321570349-4224-1-git-send-email-michael@walle.cc> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: Cc: Valentin Longchamp , Siddarth Gore , Simon Guinot Subject: [U-Boot] [PATCH v2] mvgbe: remove setting of ethaddr within the driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de A network driver should not touch the environment at all. This patch fixes this behaviour by removing the code for setting a default/randomized MAC address. Signed-off-by: Michael Walle Acked-by: Mike Frysinger Acked-by: Prafulla Wadaskar Cc: Mike Frysinger Cc: Prafulla Wadaskar Cc: Valentin Longchamp Cc: Eric Cooper Cc: Jason Cooper Cc: Siddarth Gore Cc: Albert ARIBAUD Cc: Simon Guinot Acked-by: Prafulla Wadaskar --- drivers/net/mvgbe.c | 23 ----------------------- 1 files changed, 0 insertions(+), 23 deletions(-) diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index c7f7446..21be642 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -647,7 +647,6 @@ int mvgbe_initialize(bd_t *bis) struct mvgbe_device *dmvgbe; struct eth_device *dev; int devnum; - char *s; u8 used_ports[MAX_MVGBE_DEVS] = CONFIG_MVGBE_PORTS; for (devnum = 0; devnum < MAX_MVGBE_DEVS; devnum++) { @@ -702,16 +701,13 @@ error1: /* must be less than NAMESIZE (16) */ sprintf(dev->name, "egiga%d", devnum); - /* Extract the MAC address from the environment */ switch (devnum) { case 0: dmvgbe->regs = (void *)MVGBE0_BASE; - s = "ethaddr"; break; #if defined(MVGBE1_BASE) case 1: dmvgbe->regs = (void *)MVGBE1_BASE; - s = "eth1addr"; break; #endif default: /* this should never happen */ @@ -720,25 +716,6 @@ error1: return -1; } - while (!eth_getenv_enetaddr(s, dev->enetaddr)) { - /* Generate Private MAC addr if not set */ - dev->enetaddr[0] = 0x02; - dev->enetaddr[1] = 0x50; - dev->enetaddr[2] = 0x43; -#if defined (CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION) - /* Generate fixed lower MAC half using devnum */ - dev->enetaddr[3] = 0; - dev->enetaddr[4] = 0; - dev->enetaddr[5] = devnum; -#else - /* Generate random lower MAC half */ - dev->enetaddr[3] = get_random_hex(); - dev->enetaddr[4] = get_random_hex(); - dev->enetaddr[5] = get_random_hex(); -#endif - eth_setenv_enetaddr(s, dev->enetaddr); - } - dev->init = (void *)mvgbe_init; dev->halt = (void *)mvgbe_halt; dev->send = (void *)mvgbe_send;