This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Is it possible to do polling for the Ethernet driverusing a stack ?
- From: "Cusson, Pascal" <pascal dot cusson at analog dot com>
- To: "David Webster" <dwebster at lanergy dot com>, "Cusson, Pascal" <pascal dot cusson at analog dot com>, "Gary Thomas" <gthomas at ecoscentric dot com>
- Cc: "eCos Discussion" <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 4 Nov 2002 10:41:04 -0500
- Subject: RE: [ECOS] Is it possible to do polling for the Ethernet driverusing a stack ?
Hi David,
Resulting from your advice and Gary's, my driver works now. However
instead of calling the eth_int function, I call the eth_deliver function
which contains a callback to the eth_recv function. I can now ping and
get a reply. I presume this proves that the stack is working.
However, By looking at other drivers, I noticed that the buffers
never get reset in the code. As if the stack takes care of it. In my
case, I have to reset the status of each buffer once I detect a new
packet. In other work, in my eth_recv function, I reset the empty buffer
bit at the end after the data has been passed the stack buffer. Is this
a normal behavior ? Shouldn't the stack take care of resetting the empty
bit as well as the data length ?
Pascal
-----Original Message-----
From: David Webster [mailto:dwebster@lanergy.com]
Sent: Monday, November 04, 2002 4:35 AM
To: 'Cusson, Pascal'; 'Gary Thomas'
Cc: 'eCos Discussion'
Subject: RE: [ECOS] Is it possible to do polling for the Ethernet
driverusing a stack ?
Pascal,
I don't know why your rx buffers aren't being processed now you've got
your thread priorities set up correctly. Maybe there's a more
fundamental problem - I assume the network stack and your driver are
being initialised - ie there's a call to init_all_network_interfaces()
or the equivalent?
As I mentioned the polled mode and interrupt mode drivers are identical
code they're just kicked into life differently. It might be sensible to
get you driver working in a standard interrupt driven manner and once
that's checked out ok convert it to polled mode - might help to narrow
the problem down to your driver or the polling mode.
DaveW
> -----Original Message-----
> From: Cusson, Pascal [mailto:pascal.cusson@analog.com]
> Sent: 31 October 2002 21:00
> To: Gary Thomas; Cusson, Pascal
> Cc: David Webster; eCos Discussion
> Subject: RE: [ECOS] Is it possible to do polling for the Ethernet
> driverusing a stack ?
>
> Hi guys,
> I changed the priorities of my tasks to be 10 for my foreground
task
> and 20 for my background tasks. As I said before I see my Rx buffer
> filling up but I don't see them as being processed by the stack.
>
> I also looked into my ecos.ecc file and it looks to like all the
> network stack are turned on. I built my project using the all
template.
> I attached a copy of it to this email. If someone could take a quick
> look at it, I would really appreciate.
>
> I get this feeling that I am really not missing that much.
>
> So you have any good suggestions, let me know.
>
> Best regards,
>
> Pascal
>
> By the way, thanks again for all you help today. I did process quite a
> bit.
>
> -----Original Message-----
> From: Gary Thomas [mailto:gthomas@ecoscentric.com]
> Sent: Thursday, October 31, 2002 3:04 PM
> To: Cusson, Pascal
> Cc: David Webster; eCos Discussion
> Subject: RE: [ECOS] Is it possible to do polling for the Ethernet
> driverusing a stack ?
>
>
> On Thu, 2002-10-31 at 12:53, Cusson, Pascal wrote:
> > Just to let you know, I use priority 3 for my foreground task and
> > priority 5 for my background task. Do you know what the priority of
> the
> > network tasks are ?
> >
>
> Read the CDL :-)
>
> The network threads by default run a priority 6 & 7, so if your
threads
> never block (give up the CPU), the network will be stopped.
>
> > Pascal
> >
> > -----Original Message-----
> > From: Gary Thomas [mailto:gthomas@ecoscentric.com]
> > Sent: Thursday, October 31, 2002 2:46 PM
> > To: Cusson, Pascal
> > Cc: David Webster; eCos Discussion
> > Subject: RE: [ECOS] Is it possible to do polling for the Ethernet
> > driverusing a stack ?
> >
> >
> > On Thu, 2002-10-31 at 12:32, Cusson, Pascal wrote:
> > > Hi David,
> > > Thank you very much for the email! I had no idea where to take
> the
> > > next step. I will indeed implement your first suggestion, the one
> > > without interrupts. I already created a thread as you suggested
> which
> > > carries the sc pointer.
> > >
> > > So far, when there is a flag raised in FCCE, I call the
eth_int(sc)
> > > function with the proper sc parameter. This function takes car or
> > > resetting the flags. Before it does so, it calls the eth_receive
> > > function with the following call: (sc->funs>eth_drv->recv)(sc,
> > > RxDB->dl). RxDB->dl contains the length of my buffer.
> > >
> > > Following, the eth_receive function gets called. In that function,
I
> > > transfer the data into a pre-made memory allocation called
sg_list.
> > >
> > > All of this seems to be working fine. However, my receive buffer
> don't
> > > get cleared (the status is not reset). From all the examples I
> looked
> > > at, the status is never reset anywhere. I therefore presume it is
> done
> > > by the stack. Could you please explain me some more on this
subject.
> > My
> > > buffers get filled up but they don't ever get reset. I am missing
> > > something little here.
> > >
> >
> > This most likely means that the network threads (there are a number
> > of them) are not getting to run. Those threads do the actual stack
> > processing. If they don't run, the buffers will just queue up and
> > wait.
> >
> > --
> > ------------------------------------------------------------
> > Gary Thomas |
> > eCosCentric, Ltd. |
> > +1 (970) 229-1963 | eCos & RedBoot experts
> > gthomas@ecoscentric.com |
> > http://www.ecoscentric.com/ |
> > ------------------------------------------------------------
> >
> > --
> > Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> > and search the list archive:
http://sources.redhat.com/ml/ecos-discuss
> --
> ------------------------------------------------------------
> Gary Thomas |
> eCosCentric, Ltd. |
> +1 (970) 229-1963 | eCos & RedBoot experts
> gthomas@ecoscentric.com |
> http://www.ecoscentric.com/ |
> ------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss