public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: George G. Davis <davis_g@comcast.net>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] lan91c96 driver MAC address detection
Date: Fri, 30 Apr 2004 15:59:56 -0400	[thread overview]
Message-ID: <20040430195956.GY12746@mvista.com> (raw)
In-Reply-To: <40913509.1090309@mpc-data.co.uk>

On Thu, Apr 29, 2004 at 06:02:01PM +0100, Dave Peverley wrote:
> Hi all,
> 
>  This is a small patch for the lan91c96 ethernet driver that adds the
> capability to automatically detect the MAC address stored in EPROM in the
> absence of a valid MAC address in the environment. It is modelled on the
> system used by the smc91111 driver as suggested by Marius Groeger 
> (thanks!)
> 
> The patch itself was created against the CVS repository tag 
> "U-Boot-1_1_0" using the command :
>  diff -purN u-boot u-boot-omap730p2 > u-boot-1.1.0-omap730p2.patch
> 
> All comments and feedback welcome.

Cool! Thanks for that! I have a minor suggestion though. Can we squelch
the warning for the "setenv ethaddr" case? Like so:

--- drivers/lan91c96.c.orig	2004-04-29 13:15:14.000000000 -0400
+++ drivers/lan91c96.c	2004-04-30 15:47:45.000000000 -0400
@@ -886,9 +886,7 @@
 	uchar v_rom_mac[6];
 
 	env_size = getenv_r ("ethaddr", s_env_mac, sizeof (s_env_mac));
-	if (env_size != sizeof(es)) {	/* Ignore if env is bad or not set */
-		printf ("\n*** Warning: ethaddr is not set properly, ignoring!!\n");
-	} else {
+	if (env_size == sizeof(es)) {
 		env_present = 1;
 		s = s_env_mac;
 
@@ -897,7 +895,8 @@
 			if (s)
 				s = (*e) ? e + 1 : e;
 		}
-	}
+	} else if (env_size >= 0)	/* Ignore if env is bad */
+		printf ("\n*** Warning: ethaddr is not set properly, ignoring!!\n");
 
 	rom_valid = get_rom_mac (v_rom_mac);	/* get ROM mac value if any */
 

I've tested your patch with the above change and it works for me:

OMAP1510 Innovator # bootp
Using MAC Address 08:00:28:32:0F:FF
BOOTP broadcast 1
DHCP client bound to address 192.168.1.91
OMAP1510 Innovator # setenv ethaddr 00:11:22:33:44
OMAP1510 Innovator # bootp

*** Warning: ethaddr is not set properly, ignoring!!
Using MAC Address 08:00:28:32:0F:FF
BOOTP broadcast 1
DHCP client bound to address 192.168.1.91
OMAP1510 Innovator # setenv ethaddr
OMAP1510 Innovator # bootp
Using MAC Address 08:00:28:32:0F:FF
BOOTP broadcast 1
DHCP client bound to address 192.168.1.91


Thanks again!

--
Regards,
George
> 
> Best Wishes,
> 
> Dave Peverley

<snip>

  reply	other threads:[~2004-04-30 19:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-29 17:02 [U-Boot-Users] [PATCH] lan91c96 driver MAC address detection Dave Peverley
2004-04-30 19:59 ` George G. Davis [this message]
2004-05-04  9:48   ` Dave Peverley
2004-05-04 12:06     ` Wolfgang Denk
2004-05-04 12:32       ` Dave Peverley
2004-05-04 17:02         ` Wolfgang Denk
2004-05-04 17:55           ` Communication (Was Re: [U-Boot-Users] [PATCH] lan91c96 driver MAC address detection) Dave Peverley
2004-06-06 22:12 ` [U-Boot-Users] [PATCH] lan91c96 driver MAC address detection Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-05-04 16:20 Woodruff, Richard
2004-05-04 17:12 ` Wolfgang Denk
2004-05-04 17:19 Woodruff, Richard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040430195956.GY12746@mvista.com \
    --to=davis_g@comcast.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox