public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] redboot net_init question
@ 2005-09-12  7:24 Melvin Lim
  0 siblings, 0 replies; only message in thread
From: Melvin Lim @ 2005-09-12  7:24 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-12  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-12  7:24 [ECOS] redboot net_init question Melvin Lim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).