Re: changing mac address of Sun GEM
On Sat, 2007-03-24 at 05:08 +0800, Ruben Vandeginste wrote:
> At Fri, 23 Mar 2007 09:09:37 +1100, Benjamin Herrenschmidt wrote:
> >
> > the patch is whitespace damaged though...
>
> Ok, that should be fixed now.
>
> > Appart from that, what's the output of strace macchanger ? Might give a
> > clue why it complains...
>
> To be honest, this is the first time I try to change anything in the
> kernel... What exactly is the meaning of "netif_running"? I thought
> it indicated whether the interface is up or down, but that seems not
> to be true. What happened, is that the data structure of the net
> device was updated with the new mac address, but it was not written to
> the hardware.
netif_running() means the device is open() (which generally means the
interface is up).
> > I'll give it a try myself as soon as I find some time and will submit
> > the patch upstream with fixups if needed.
>
> In this patch, the new mac address is written to the hardware
> regardless of "netif_running". It seems to work, but probably needs
> fixups...
You need to be a bit careful here. The chip might be off (power
managed).
I would suggest you do something a bit like change_mtu there, though you
don't actually need to take the locks, only the mutex, and please do
test gp->running before touching the hardware (with the lock held).
Ben.
Reply to: