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]

Re: ecos + lwip


On Tue, Sep 1, 2009 at 5:50 PM, Simon Kallweit<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>>>>>
>
> This looks fine so far. I have not used the netif API myself, so I don't
> know if there were changes between the old and the new version. But I bet
> there are, as there was lots of work between 1.1.1 and 1.3.1.

I'm not particularly inclined to using the netif API.

If I can get the IP address of my interface "et0" by any other means then thats
fine too, as I'm only using it to retrieve the static IP assigned to
my interface.

Is there any other way achieve this?

>
> Can you please show us the code you are trying to use with the netif API?
> Maybe we should also add a netif API test to the lwip package.

Sure. It's simply a call to netif_find().

<snip>
struct netif *local = NULL;
local = netif_find("et0");
...
</snip>

I'm getting "local" as NULL. Also enabling netif debugs show this:

netif_find: didn't find et

Also, I forgot to mention that I'm using the sequential API.

>
>> Also, I traced the lwIP init path (from lwIP_init()) and I didn't see any
>> calls
>> to init_hw_drivers(). How are h/w drivers initialized then? Is there a
>> different
>> mechanism now?
>
> Well the drivers are initialized in cyg_lwip_simple_init() in ecos/simple.c
> (for simple mode) and tcpip_init_done() in ecos/sequential.c (for sequential
> mode) with the following code:
>
> ? ? ? ?// Initialize network devices
> ? ? ? ?for (t = &__NETDEVTAB__[0]; t != &__NETDEVTAB_END__; t++) {
> ? ? ? ? ? ?if (t->init(t)) {
> ? ? ? ? ? ? ? ?t->status = CYG_NETDEVTAB_STATUS_AVAIL;
> ? ? ? ? ? ?} else {
> ? ? ? ? ? ? ? ?// Device not [currently] available
> ? ? ? ? ? ? ? ?t->status = 0;
> ? ? ? ? ? ?}
> ? ? ? ?}

Ok. Thanks. This is essentially the same stuff as was in  init_hw_drivers()! :)

Regards,
-mandeep

>
>
> Simon
>

--
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]