From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Thu, 16 Jul 2009 10:41:30 -0700 Subject: [U-Boot] [PATCH 17/30] lan91c96/smc91111/smc911x: get mac address from environment In-Reply-To: <200907152036.40158.vapier@gentoo.org> References: <1234847451-3210-1-git-send-email-vapier@gentoo.org> <200906092030.49884.vapier@gentoo.org> <20090713215818.46DEB832E416@gemini.denx.de> <200907152036.40158.vapier@gentoo.org> Message-ID: <4A5F664A.8000701@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Mike, Mike Frysinger wrote: > >>> not specific to either of these drivers, so if we did choose to make this >>> behavior optional via some define, it would make more sense to do it in >>> the common eth code rather than copying & pasting it everywhere. >>> >> Agreed. Do you think you have time and resources to craft such a patch? >> > > net/eth.c:eth_initialize() already has the logic to handle this, but that only > applies to NET_MULTI drivers. and most do not take advantage of it. i think > the documentation should be updated like so: > in the driver function that calls eth_register(), the driver should > initialize dev->enetaddr to the MAC found in the hardware (if possible) > and then applicable drivers should be fixed. if we agree on this route, i can > do a quick scan of the net drivers and post relevant patches. > > That'd be great. You've done good work bringing consistency to the code. > in the case of a mismatch, we would see from the common eth code: > Warning: Blackfin EMAC MAC addresses don't match: > Address in SROM is 0a:0a:0a:0a:0a:0a > Address in environment is 00:e0:22:fe:44:ec > > > the smsc drivers however are not in the NET_MULTI category -- they dont use > any of the common ethernet stack. so once they are converted to NET_MULTI, > they'll get this functionality for free (when exactly were we adding #warning > about non-NET_MULTI usage ?). so rather than expend effort on restoring > duplicate code, how about interested parties convert the driver ;). > -mike > The #warning patch is done but not submitted. Pretty lame, I know, but it's been a crazy summer. I have the SMSC driver mostly ported but don't have any hardware to test on. I guess there are 3 days left in this merge window to get the ball rolling... If anybody else has already done this, please submit. regards, Ben