This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
NETDEVTAB_ENTRY()????
- From: "vasantha.rajan" <vasantha dot rajan at cranessoftware dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 28 Dec 2005 17:21:01 +0530
- Subject: [ECOS] NETDEVTAB_ENTRY()????
Hi,
We are working on developing driver for wlan.
We use arm excalibur board and use lwip_stack.
I have doubt in NETDEVTAB_ENTRY() MACRO.
I will list my doubts.
1. I have given the NETDEVTAB_ENTRY() MACRO in a .inl file (first I am not
clear with .inl file...why it cant be .h file?????Plz explain).
2. Now In my high level driver code I have #included the .inl file (Where i
have my NETDEVTAB_ENTRY() MACRO) and in my high level driver code i have
given the MACRO: CYG_HAL_TABLE_BEGIN( ) & CYG_HAL_TABLE_END( )
3. In my cdl I have compiled the high level driver code with
-library=libextras.a (option).
4. Now when I check for the __NETDEVTAB__[0] and __NETDEVTAB_END__ in a for
loop and both of them give the same address??? So its not entering the for
loop even once.
5. if I try to print the name of the device it gives tty/diag???
I will give the sketch of the code below.My file name epx_high_driver.c
//------------------------epx_high_driver.c---------------------------------------------------------------------------------------------------
CYG_HAL_TABLE_BEGIN( __NETDEVTAB__, CYGDAT_DEVS_ETH_ALTERA_EPXA10_NAME );
CYG_HAL_TABLE_END( __NETDEVTAB_END__, CYGDAT_DEVS_ETH_ALTERA_EPXA10_NAME);
void init_hw_drivers( void )
{
cyg_netdevtab_entry_t *t = &__NETDEVTAB__[0];
cyg_netdevtab_entry_t *t1 = &__NETDEVTAB_END__;
diag_printf("__NETDEVTAB__[0]:%02x::__NETDEVTAB_END__:%02x\n",t,t1); // both
t & t1 prints same address
diag_printf("device names:%s:\n\n",t->name); //name of the device tty/diag
for (t = &__NETDEVTAB__[0]; t != &__NETDEVTAB_END__; t++) {
if (t->init(t)) {
t->status = CYG_NETDEVTAB_STATUS_AVAIL;
}
else {
t->status = 0;
}
}
}
what is the problem in the above code???? Whether I have make any other
changes???Plz explain....................
Thanks
Regards
Vasanth
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss