Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760906Ab3DBLfh (ORCPT ); Tue, 2 Apr 2013 07:35:37 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:42255 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760181Ab3DBLfd (ORCPT ); Tue, 2 Apr 2013 07:35:33 -0400 Date: Tue, 2 Apr 2013 13:35:32 +0200 From: Pavel Machek To: Frank Li Cc: kernel list , fabio.estevam@freescale.com, l.stach@pengutronix.de, Frank.Li@freescale.com, netdev@vger.kernel.org, davem@davemloft.net Subject: Re: Freescale FEC: fall back to random address Message-ID: <20130402113532.GA8880@amd.pavel.ucw.cz> References: <20130331210605.GA29191@amd.pavel.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1610 Lines: 50 Hi! > I think it is okay. Ok, now... is there someone maintianing Freescale FEC? Or, Dave, can you merge the patch? Thanks, Pavel > 2013/4/1 Pavel Machek : > > If there's no valid ethernet address, fall back to randomly generated > > one. > > > > (Yes, I need to get newer u-boot for the board, but as the only > > available one is from 2009... this might be good idea). > > > > Signed-off-by: Pavel Machek > > > > > > index e3f3937..5a7d1e1 100644 > > pp--- a/drivers/net/ethernet/freescale/fec.c > > +++ b/drivers/net/ethernet/freescale/fec.c > > @@ -906,6 +914,16 @@ static void fec_get_mac(struct net_device *ndev) > > iap = &tmpaddr[0]; > > } > > > > + /* > > + * 5) random mac address > > + */ > > + if (!is_valid_ether_addr(iap)) { > > + /* Report it and use a random ethernet address instead */ > > + netdev_err(ndev, "Invalid MAC address: %pM\n", iap); > > + random_ether_addr(iap); > > + netdev_info(ndev, "Using random MAC address: %pM\n", iap); > > + } > > + > > memcpy(ndev->dev_addr, iap, ETH_ALEN); > > > > /* Adjust MAC if using macaddr */ -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/