NETDEVTAB_ENTRY()????

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

NETDEVTAB_ENTRY()????

vasantha.rajan-2


----------  Forwarded Message  ----------

Subject: NETDEVTAB_ENTRY()????
Date: Wednesday 28 December 2005 17:21
From: "vasantha.rajan" <[hidden email]>
To: [hidden email]

Hi,

We are working on developing driver for wlan.
We use arm 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 to 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

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

Andrew Lunn-2
On Thu, Dec 29, 2005 at 10:09:33AM +0530, vasantha.rajan wrote:

>
>
> ----------  Forwarded Message  ----------
>
> Subject: NETDEVTAB_ENTRY()????
> Date: Wednesday 28 December 2005 17:21
> From: "vasantha.rajan" <[hidden email]>
> To: [hidden email]
>
> Hi,
>
> We are working on developing driver for wlan.
> We use arm 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).

.inl stands for inline. It contains bits of C code which can be
inlined into other files. .h files only contain definitions etc, no
code.

> 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);


What are you trying to do here? Do you want to use eCos's existing
NETDEVTAB table, or are you trying to implement your own table?

        Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

vasantha.rajan-2
On Thursday 29 December 2005 14:59, you wrote:

Hi Andrew,

Thanks for ur explaination for .inl file.

You asked me a question...as follows

"What are you trying to do here? Do you want to use eCos's existing
 NETDEVTAB table, or are you trying to implement your own table?"

But to some extent only I understood your question.....

I will list my doubts...

1. What is ecos's existing NETDEVTAB table  and how many devices it contains
(ie how many max table entry it can accomodate)????

2. In our application we have only one network device,so can I use the
existing NETDEVTAB table??..or I have to create my own NETDEVTAB table???

3. If I want to create my own NETDEVTAB table, then what changes I have to
make to my code what I have mailed previous???

4. In my last mail, I gave a sketch of my code....., when I print the device
name it prints tty/diag....How come in a NETDEVTAB table can I have a serial
device???Or it is something else....???

Plz give explanation

Thanks and Regards
Vasanth




> On Thu, Dec 29, 2005 at 10:09:33AM +0530, vasantha.rajan wrote:
> > ----------  Forwarded Message  ----------
> >
> > Subject: NETDEVTAB_ENTRY()????
> > Date: Wednesday 28 December 2005 17:21
> > From: "vasantha.rajan" <[hidden email]>
> > To: [hidden email]
> >
> > Hi,
> >
> > We are working on developing driver for wlan.
> > We use arm 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).
>
> .inl stands for inline. It contains bits of C code which can be
> inlined into other files. .h files only contain definitions etc, no
> code.
>
> > 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);
>
> What are you trying to do here? Do you want to use eCos's existing
> NETDEVTAB table, or are you trying to implement your own table?
>
>         Andrew



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

Andrew Lunn-2
On Thu, Dec 29, 2005 at 07:54:38PM +0530, vasantha.rajan wrote:

> On Thursday 29 December 2005 14:59, you wrote:
>
> Hi Andrew,
>
> Thanks for ur explaination for .inl file.
>
> You asked me a question...as follows
>
> "What are you trying to do here? Do you want to use eCos's existing
>  NETDEVTAB table, or are you trying to implement your own table?"
>
> But to some extent only I understood your question.....
>
> I will list my doubts...
>
> 1. What is ecos's existing NETDEVTAB table  and how many devices it contains
> (ie how many max table entry it can accomodate)????

The tables are only limited by the amount of memory you have.

The netdev table is created in
packages/net/bsd_tcpip/current/src/ecos/support.c.

To put an entry into the table you use the macro NETDEVTAB_ENTRY
declared in netdev.h. For an example of how to use this macro see eg
packages/devs/eth/i386/pc/lancepci/current/include/devs_eth_i386_pc_lancepci.inl
> 2. In our application we have only one network device,so can I use the
> existing NETDEVTAB table??..or I have to create my own NETDEVTAB table???

It does not matter how many device you have, you should always use
NETDEVTAB_ENTRY and the netdev table. When the tcp/ip stack starts it
will then know about your devices and initialize them correctly.

>
> 3. If I want to create my own NETDEVTAB table, then what changes I have to
> make to my code what I have mailed previous???

Well you would not call it netdev for a start. Call it something else
so that it does not cause problems with the eCos netdev table. You can
however use the netdev table as an example of how it should be
done. There are other examples for using HAL tables, eg commands for
redboot.
 
> 4. In my last mail, I gave a sketch of my code....., when I print the device
> name it prints tty/diag....How come in a NETDEVTAB table can I have a serial
> device???Or it is something else....???

I expect the problem is that netdev has been declared twice, once by
eCos and once by your code. This is getting the compiler/linker
confused and so putting things into the wrong table. Delete your
broken code and it will work a lot better.

        Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

Grant Edwards
On 2005-12-29, Andrew Lunn <[hidden email]> wrote:

>> 3. If I want to create my own NETDEVTAB table, then what changes I have to
>> make to my code what I have mailed previous???
>
> Well you would not call it netdev for a start. Call it something else
> so that it does not cause problems with the eCos netdev table. You can
> however use the netdev table as an example of how it should be
> done. There are other examples for using HAL tables, eg commands for
> redboot.

As an aside, I've found the "table" scheme used for those
things in eCos tobe a _very_ useful thing to have in my
toolbox.  I've used it for all sorts of things in both eCos and
non-eCos projects.

In a general sense, it allows "modules" to be more loosely
coupled than C allows.

For example, you can have an embedded system made up of modules
that are _completely_ "static" in the C sense (they export no
global symbols).  You can choose at link time which modules you
want in the program without having to change any source code or
even re-compile anything.

I'm sure the eCos internals gurus are all aware of the power of
the "HAL table", but I expect it has escaped the notice of most
eCos HAL application programs.  It's worth noticing. ;)

--
Grant Edwards
[hidden email]


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

vasantha.rajan-2
In reply to this post by Andrew Lunn-2
On Thursday 29 December 2005 21:37, you wrote:

Hi Andrew,

Thanks for your reply...

Actually for our project we use the Templates-> Altera DDR ARM9/excalibur
board( as Hardware) and default package......and we use lwip stack to develop
driver for WLAN. We are not using any Interrupt...but use polling method and
in ecos HAL i use startup type as "ROMRAM".

Actually  we are really confused about the default package we use in the
template or we have to use net package or something else ????and is it a must
to use interrupt instead of polling???

I really ask sorry for the present lengthy mail.....

1. Currently in my ecos.db for my target board I have included only LWIP
Package....but from your previous reply, the support.c file is present in
CYGPKG_NET_FREEBSD_STACK package only....When I include the
CYGPKG_NET_FREEBSD_STACK along with LWIP_PACKAGE in my
ecos.db the configtool showed me conflict..why????

2. So I cant use both lwip and free_bsd package in same target board..Right???

3. In support.c file...a Nework Thread ( cyg_netinit() ) is resumed and it
waits for a flag....My doubt is whether I have to include the same support.c
file for my lwip_stack (That include network thread, SYSINIT  macro and many
other functions)???? Right now I dont have support.o (object file) in my Lib
directory( target.ld )

4. If i have to use the same support.c file in lwip_stack, where I have to
place that file in the Kernel ( ie,path )??? Or I have to write a seperate
logic for implementation of the support.c file???

5. So I will come to my previous mail question.....I use the macro
NETDEVTAB_ENTRY() MACRO in a .inl file.. and use CYG_HAL_TABLE_BEGIN() &
CYG_HAL_TABLE_END() in high level Driver code with a different name (ie, not
netdev) and not using support.c file (ie, eCos's existing NETDEVTAB
table)...Even then my table entry is not made..why???

Plz Reply...  

Thanks and regards

Vasanth


> On Thu, Dec 29, 2005 at 07:54:38PM +0530, vasantha.rajan wrote:
> > On Thursday 29 December 2005 14:59, you wrote:
> >
> > Hi Andrew,
> >
> > Thanks for ur explaination for .inl file.
> >
> > You asked me a question...as follows
> >
> > "What are you trying to do here? Do you want to use eCos's existing
> >  NETDEVTAB table, or are you trying to implement your own table?"
> >
> > But to some extent only I understood your question.....
> >
> > I will list my doubts...
> >
> > 1. What is ecos's existing NETDEVTAB table  and how many devices it
> > contains (ie how many max table entry it can accomodate)????
>
> The tables are only limited by the amount of memory you have.
>
> The netdev table is created in
> packages/net/bsd_tcpip/current/src/ecos/support.c.
>
> To put an entry into the table you use the macro NETDEVTAB_ENTRY
> declared in netdev.h. For an example of how to use this macro see eg
> packages/devs/eth/i386/pc/lancepci/current/include/devs_eth_i386_pc_lancepc
>i.inl
>
> > 2. In our application we have only one network device,so can I use the
> > existing NETDEVTAB table??..or I have to create my own NETDEVTAB table???
>
> It does not matter how many device you have, you should always use
> NETDEVTAB_ENTRY and the netdev table. When the tcp/ip stack starts it
> will then know about your devices and initialize them correctly.
>
> > 3. If I want to create my own NETDEVTAB table, then what changes I have
> > to make to my code what I have mailed previous???
>
> Well you would not call it netdev for a start. Call it something else
> so that it does not cause problems with the eCos netdev table. You can
> however use the netdev table as an example of how it should be
> done. There are other examples for using HAL tables, eg commands for
> redboot.
>
> > 4. In my last mail, I gave a sketch of my code....., when I print the
> > device name it prints tty/diag....How come in a NETDEVTAB table can I
> > have a serial device???Or it is something else....???
>
> I expect the problem is that netdev has been declared twice, once by
> eCos and once by your code. This is getting the compiler/linker
> confused and so putting things into the wrong table. Delete your
> broken code and it will work a lot better.
>
>         Andrew



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

Andrew Lunn-2
On Fri, Dec 30, 2005 at 04:41:38PM +0530, vasantha.rajan wrote:

> On Thursday 29 December 2005 21:37, you wrote:
>
> Hi Andrew,
>
> Thanks for your reply...
>
> Actually for our project we use the Templates-> Altera DDR ARM9/excalibur
> board( as Hardware) and default package......and we use lwip stack to develop
> driver for WLAN. We are not using any Interrupt...but use polling method and
> in ecos HAL i use startup type as "ROMRAM".
>
> Actually  we are really confused about the default package we use in the
> template or we have to use net package or something else ????and is it a must
> to use interrupt instead of polling???

There are two templates for lwip. They are in look in
packages/templates. You will see there is lwip_eth and lwip_ppp. Since
you are trying to write an ethernet driver the choice should be
obvious.
 
> I really ask sorry for the present lengthy mail.....
>
> 1. Currently in my ecos.db for my target board I have included only LWIP
> Package....but from your previous reply, the support.c file is present in
> CYGPKG_NET_FREEBSD_STACK package only....When I include the
> CYGPKG_NET_FREEBSD_STACK along with LWIP_PACKAGE in my
> ecos.db the configtool showed me conflict..why????

Come on, reality check. Use your head. Does it make sense to have two
TCP/IP stacks in the same application? No it does not, which is why
you are getting the conflict.
 
> 3. In support.c file...a Nework Thread ( cyg_netinit() ) is resumed and it
> waits for a flag....My doubt is whether I have to include the same support.c
> file for my lwip_stack (That include network thread, SYSINIT  macro and many
> other functions)???? Right now I dont have support.o (object file) in my Lib
> directory( target.ld )
>
> 4. If i have to use the same support.c file in lwip_stack, where I have to
> place that file in the Kernel ( ie,path )??? Or I have to write a seperate
> logic for implementation of the support.c file???

Again, reality check. Do you think lwip works? If so, why would you
need to move code around, implement your own version of support.c?
Surely it makes more sense that everything you need is already there.

You have the source code, try reading it. All this started because of
the table. Lets do something really simple, like search for
CYG_HAL_TABLE_BEGIN in the lwip code....

~/eCos/anoncvs-clean/packages/net/lwip_tcpip$ grep -r CYG_HAL_TABLE_BEGIN .
./current/src/ecos/init.c:CYG_HAL_TABLE_BEGIN(__NETDEVTAB__, netdev);

So maybe init.c contains similar functionality to support.c in the
bsd_tcpip stack. Doesn't this make much more sense than having to copy
code around, or have two stacks which results in a conflict etc.

> Plz Reply...  

OK. Before you ask your next set of questions, please do a reality
check, read the source code, apply logic and reasoning etc...

I you continue to ask questions without doing some basic research and
trying to understand what is going in, i will ignore you.

        Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

vasantha.rajan-2
Hi Andrew,

Thanks a lot for your suggestion, now i got cleared with
netdetab_entry....really I made lot of try and was not geting clear with
that macro,so i mailed a lengthy mail previously,sorry for it.

I read i some ecos discuss group that
"network device driver for Redboot
 is polled io, where as a full eCos device driver is interrupt
 driven"

1.What is difference bewteen network device driver for Red boot and full
ecos device driver????

2.We use a polling method and our hardware is configured in such a manner
that it is not interrupt driven,and we use ROMRAM as startup type,
so my question is what ever polling Method we use is right or I have to
configure my hardware for interrupt driven????

3. The actual problem is , when my wireless data arrived in my hardware,
that particular data I was able to read from my application layer but when i
read the same data from driver (ie, kernel level) I was not able to read the
complete data (ie, i was able to read only first twenty bytes of data and
remaining are zero).

Why is this difference????

Plz if u have any suggestions kindly mail me.

thanks and Regards
Vasanth
----- Original Message -----
From: "Andrew Lunn" <[hidden email]>
To: "vasantha.rajan" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, December 30, 2005 8:14 PM
Subject: Re: [ECOS] NETDEVTAB_ENTRY()????


> On Fri, Dec 30, 2005 at 04:41:38PM +0530, vasantha.rajan wrote:
> > On Thursday 29 December 2005 21:37, you wrote:
> >
> > Hi Andrew,
> >
> > Thanks for your reply...
> >
> > Actually for our project we use the Templates-> Altera DDR
ARM9/excalibur
> > board( as Hardware) and default package......and we use lwip stack to
develop
> > driver for WLAN. We are not using any Interrupt...but use polling method
and
> > in ecos HAL i use startup type as "ROMRAM".
> >
> > Actually  we are really confused about the default package we use in the
> > template or we have to use net package or something else ????and is it a
must

> > to use interrupt instead of polling???
>
> There are two templates for lwip. They are in look in
> packages/templates. You will see there is lwip_eth and lwip_ppp. Since
> you are trying to write an ethernet driver the choice should be
> obvious.
>
> > I really ask sorry for the present lengthy mail.....
> >
> > 1. Currently in my ecos.db for my target board I have included only LWIP
> > Package....but from your previous reply, the support.c file is present
in
> > CYGPKG_NET_FREEBSD_STACK package only....When I include the
> > CYGPKG_NET_FREEBSD_STACK along with LWIP_PACKAGE in my
> > ecos.db the configtool showed me conflict..why????
>
> Come on, reality check. Use your head. Does it make sense to have two
> TCP/IP stacks in the same application? No it does not, which is why
> you are getting the conflict.
>
> > 3. In support.c file...a Nework Thread ( cyg_netinit() ) is resumed and
it
> > waits for a flag....My doubt is whether I have to include the same
support.c
> > file for my lwip_stack (That include network thread, SYSINIT  macro and
many
> > other functions)???? Right now I dont have support.o (object file) in my
Lib
> > directory( target.ld )
> >
> > 4. If i have to use the same support.c file in lwip_stack, where I have
to
> > place that file in the Kernel ( ie,path )??? Or I have to write a
seperate

> > logic for implementation of the support.c file???
>
> Again, reality check. Do you think lwip works? If so, why would you
> need to move code around, implement your own version of support.c?
> Surely it makes more sense that everything you need is already there.
>
> You have the source code, try reading it. All this started because of
> the table. Lets do something really simple, like search for
> CYG_HAL_TABLE_BEGIN in the lwip code....
>
> ~/eCos/anoncvs-clean/packages/net/lwip_tcpip$ grep -r CYG_HAL_TABLE_BEGIN
.

> /current/src/ecos/init.c:CYG_HAL_TABLE_BEGIN(__NETDEVTAB__, netdev);
>
> So maybe init.c contains similar functionality to support.c in the
> bsd_tcpip stack. Doesn't this make much more sense than having to copy
> code around, or have two stacks which results in a conflict etc.
>
> > Plz Reply...
>
> OK. Before you ask your next set of questions, please do a reality
> check, read the source code, apply logic and reasoning etc...
>
> I you continue to ask questions without doing some basic research and
> trying to understand what is going in, i will ignore you.
>
>         Andrew
>
> **************************************************************
> Scanned by  eScan  Anti-Virus  and  Content Security Software.
> Visit http://www.mwti.net for more info on eScan and MailScan.
> **************************************************************
>
>




--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: NETDEVTAB_ENTRY()????

vasantha.rajan-2
In reply to this post by Andrew Lunn-2
Hi Andrew,

Thanks a lot for your suggestion, now i got cleared with
netdetab_entry....really I made lot of try and was not geting clear with
that macro,so i mailed a lengthy mail previously,sorry for it.

I read i some ecos discuss group that
"network device driver for Redboot
 is polled io, where as a full eCos device driver is interrupt
 driven"

1.What is difference bewteen network device driver for Red boot and full
ecos device driver????

2.We use a polling method and our hardware is configured in such a manner
that it is not interrupt driven,and we use ROMRAM as startup type,
so my question is what ever polling Method we use is right or I have to
configure my hardware for interrupt driven????

3. The actual problem is , when my wireless data arrived in my hardware,
that particular data I was able to read from my application layer but when i
read the same data from driver (ie, kernel level) I was not able to read the
complete data (ie, i was able to read only first twenty bytes of data and
remaining are zero).

Why is this difference????

Plz if u have any suggestions kindly mail me.

thanks and Regards
Vasanth

----- Original Message -----
From: "Andrew Lunn" <[hidden email]>
To: "vasantha.rajan" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, December 30, 2005 8:14 PM
Subject: Re: [ECOS] NETDEVTAB_ENTRY()????


> On Fri, Dec 30, 2005 at 04:41:38PM +0530, vasantha.rajan wrote:
> > On Thursday 29 December 2005 21:37, you wrote:
> >
> > Hi Andrew,
> >
> > Thanks for your reply...
> >
> > Actually for our project we use the Templates-> Altera DDR
ARM9/excalibur
> > board( as Hardware) and default package......and we use lwip stack to
develop
> > driver for WLAN. We are not using any Interrupt...but use polling method
and
> > in ecos HAL i use startup type as "ROMRAM".
> >
> > Actually  we are really confused about the default package we use in the
> > template or we have to use net package or something else ????and is it a
must

> > to use interrupt instead of polling???
>
> There are two templates for lwip. They are in look in
> packages/templates. You will see there is lwip_eth and lwip_ppp. Since
> you are trying to write an ethernet driver the choice should be
> obvious.
>
> > I really ask sorry for the present lengthy mail.....
> >
> > 1. Currently in my ecos.db for my target board I have included only LWIP
> > Package....but from your previous reply, the support.c file is present
in
> > CYGPKG_NET_FREEBSD_STACK package only....When I include the
> > CYGPKG_NET_FREEBSD_STACK along with LWIP_PACKAGE in my
> > ecos.db the configtool showed me conflict..why????
>
> Come on, reality check. Use your head. Does it make sense to have two
> TCP/IP stacks in the same application? No it does not, which is why
> you are getting the conflict.
>
> > 3. In support.c file...a Nework Thread ( cyg_netinit() ) is resumed and
it
> > waits for a flag....My doubt is whether I have to include the same
support.c
> > file for my lwip_stack (That include network thread, SYSINIT  macro and
many
> > other functions)???? Right now I dont have support.o (object file) in my
Lib
> > directory( target.ld )
> >
> > 4. If i have to use the same support.c file in lwip_stack, where I have
to
> > place that file in the Kernel ( ie,path )??? Or I have to write a
seperate

> > logic for implementation of the support.c file???
>
> Again, reality check. Do you think lwip works? If so, why would you
> need to move code around, implement your own version of support.c?
> Surely it makes more sense that everything you need is already there.
>
> You have the source code, try reading it. All this started because of
> the table. Lets do something really simple, like search for
> CYG_HAL_TABLE_BEGIN in the lwip code....
>
> ~/eCos/anoncvs-clean/packages/net/lwip_tcpip$ grep -r CYG_HAL_TABLE_BEGIN
.

> /current/src/ecos/init.c:CYG_HAL_TABLE_BEGIN(__NETDEVTAB__, netdev);
>
> So maybe init.c contains similar functionality to support.c in the
> bsd_tcpip stack. Doesn't this make much more sense than having to copy
> code around, or have two stacks which results in a conflict etc.
>
> > Plz Reply...
>
> OK. Before you ask your next set of questions, please do a reality
> check, read the source code, apply logic and reasoning etc...
>
> I you continue to ask questions without doing some basic research and
> trying to understand what is going in, i will ignore you.
>
>         Andrew
>
> **************************************************************
> Scanned by  eScan  Anti-Virus  and  Content Security Software.
> Visit http://www.mwti.net for more info on eScan and MailScan.
> **************************************************************
>
>




--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss