[U-Boot] [PATCH 2/2] mvgbe: fix network device indices

Prafulla Wadaskar
2011-11-04T06:29:24Z

> -----Original Message-----
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> Sent: Friday, November 04, 2011 4:42 AM
> To: Michael Walle
> Cc: u-boot at lists.denx.de; Prafulla Wadaskar; Wolfgang Denk
> Subject: Re: [PATCH 2/2] mvgbe: fix network device indices
>
> On Thursday 03 November 2011 19:02:26 Michael Walle wrote:
> > Am Donnerstag 03 November 2011, 19:10:57 schrieb Mike
> Frysinger:
> > > On Thursday 27 October 2011 17:31:36 Michael Walle wrote:
> > > > --- a/drivers/net/mvgbe.c
> > > > +++ b/drivers/net/mvgbe.c
> > > >
> > > > + /* Extract the MAC address from the environment */
> > > > + while (!eth_getenv_enetaddr_by_index("eth", dev-
> >index,
> > > > + dev->enetaddr)) {
> > > >
> > > > /* Generate Private MAC addr if not set */
> > > > dev->enetaddr[0] = 0x02;
> > > > dev->enetaddr[1] = 0x50;
> > >
> > > this is wrong. net drivers should not be touching the env
> at all.
> > > please fix your driver to not do that first.
> >
> > i guess this whole mac randomization/generation code belongs
> to board
> > specific files.
>
> correct

We can move mac randomization code to the board specific files, but it will be needed for each board and there will be code duplication.

How about supporting standalone mac randomization feature?

Regards..
Prafulla . .