This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
redboot net_init question
- From: Melvin Lim <dumak23 at yahoo dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 12 Sep 2005 00:24:35 -0700 (PDT)
- Subject: [ECOS] redboot net_init question
- Reply-to: dumak23REMOVE_THIS at yahoo dot com
Hi,
I'm currently adding network support for my HAL port.
Looking at redboot's net_init function, I noticed that
it initalizes the __local_enet_sc like this:
struct primary_net = (struct eth_drv_sc *)0;
:
:
if (t->init(t)) {
t->status = CYG_NETDEVTAB_STATUS_AVAIL;
if (primary_net == (struct eth_drv_sc *)0) {
primary_net = __local_enet_sc;
}
}
:
:
__local_enet_sc = primary_net
__local_enet_sc is initialized to NULL, and unless it
was overriden before this function is called - it
wouldn't work. I was expecting that if the
initialization is successful, and primary_net is still
null, it will be initialized with t->device_instance
rather than __local_enet_sc, like this:
if (t->init(t)) {
t->status = CYG_NETDEVTAB_STATUS_AVAIL;
if (primary_net == (struct eth_drv_sc *)0) {
- primary_net = __local_enet_sc;
+ primary_net = t->device_instance;
}
}
This works for me. But I just thought I might be
missing something, so any hints would be appreciated.
Thanks!
- Melvin
______________________________________________________
Yahoo! for Good
Donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss