Changing Mac address

Guillaume Dargaud dargaud at lpsc.in2p3.fr
Tue Jul 29 00:25:54 EST 2008


Hello all,
there's something I miss here. I'd like to setup a MAC address in software 
at the start of the boot process. I'm trying to figure out where this is 
done in the kernel code.
I'm on a custom variant of a Xilinx ML405 card, still in PPC arch.
So it appears to be going in the arch/ppc/boot/simple/embed_config.c piece 
of code, but since I don't have I2C, the only 'relevant' code is this one:

#if (!defined(CONFIG_XILINX_MLxxx) || !defined(XPAR_IIC_0_BASEADDR) || 
!defined(XPAR_PERSISTENT_0_IIC_0_BASEADDR))
int get_cfg_data(unsigned char **cfg_data) {
#warning I2C needed for obtaining the Ethernet MAC address. Using hard-coded 
MAC address
 return 0; /* no cfg data found */
}

Nonetheless, ifconfig (from busybox) gives me a proper MAC address 
(00:0A:35:01:02:03) and can even change it:
ifconfig eth0 down hw ether 00:0A:35:01:02:10 up
But I want to do that before the network is up.

What is the relevant kernel section to change in order to set the MAC 
address ?
Thanks.
-- 
Guillaume Dargaud
http://www.gdargaud.net/





More information about the Linuxppc-dev mailing list