Setting up MAC address on SMC91111 and how the config_enaddr() function is supposed to work.

Peter Dufault dufault at
Fri Apr 9 13:26:41 UTC 2010

In the SMC91111 driver it will check to see if the BSDnet config structure rtems_bsdnet_ifconfig has a hardware address set in config->hardware_address.  If there is one, the driver copies it into the arpcom.ac_enaddr and later into the hardware registers.  If there isn't one, it sets the address to a bogus hardware address of

On these chips with a serial EEPROM attached the hardware will load the hardware address into the chip registers from the EEPROM at chip reset time, so what I want to do is to instead read it back into the arpcom.ac_enaddr and take it from there.

There is a function, config_enaddr(), that I could provide to do this.  However, then config->hardware_address will be ignored, which seems wrong.  I think the ordering should be:

1. If there is config->hardware_address, use that.
2. If there is config_enaddr() function, use that.
3. If there is a BSP option to leave the address alone and assume it is already in the hardware, then copy it into arpcom.ac_enaddr and use that.
4. Finally, load a bogus hardware address into the hardware registers.

I actually think 3&4 should be reversed, that is, the bogus hardware address should be an option but that would change current behavior.  I don't see "config_enaddr()" in other drivers so is it OK to change how it works, that is, have config->hardware_address take precedence?  Does anyone use that?

Peter Dufault
HD Associates, Inc.      Software and System Engineering

More information about the users mailing list