This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Re: RedBoot "set MAC address" API?
Grant Edwards <grante@visi.com> writes:
> > In general the MAC address is stored in the fconfig data. All
> > drivers that need to set the MAC address contain code to query
> > the flash and fetch the MAC address from there, or call a
> > platform-specific function than may do that. They usually also
> > have a fallback to a compiled-in MAC address.
>
> Except for the drivers I've used, apparently.
So how do these drivers get the MAC address at present?
> Is there any
> documentation available on how fconfig data is formatted/used?
There's no need for your code to deal with the fconfig data format
itself. Just use one of the virtual vector functions to fetch it
during driver initialization. Here's the relevant code from one of the
drivers that does this:
#ifdef CYGPKG_REDBOOT
esa_ok = flash_get_config(qi->esa_key, _enaddr, CONFIG_ESA);
#else
esa_ok = CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET,
qi->esa_key, _enaddr, CONFIG_ESA);
#endif
if (esa_ok) {
memcpy(qi->enaddr, _enaddr, sizeof(qi->enaddr));
} else {
// No 'flash config' data available - use default
os_printf("FCC_ETH - Warning! Using default ESA for '%s'\n", dtp->name);
}
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss