This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

redboot net_init question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]