OpenQNX :: The QNX Community Portal

Jul 25, 2008 - 04:19 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 20 unlogged users and 2 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Q
Post subject: Should I call tx_done() after tx_down() ?  PostPosted: Oct 24, 2007 - 02:40 PM
Guest





I've written net filter (io-net/en_en0)
and sometimes (after sending data down, to ethernet card)
I have to wait long time for tx_done() callback;

Should I call ion->tx_done() after ion->tx_down() ?
 
   
Reply with quote Back to top
seanb
Post subject: Re: Should I call tx_done() after tx_down() ?  PostPosted: Oct 24, 2007 - 07:40 PM
QNX Master


Joined: Jul 28, 2006
Posts: 67

Q <no@spam.pl> wrote:
Quote:
I've written net filter (io-net/en_en0)
and sometimes (after sending data down, to ethernet card)
I have to wait long time for tx_done() callback;

Some drivers so a lazy reap: don't reap until asked
to tx additional packets.

Quote:
Should I call ion->tx_done() after ion->tx_down() ?

No, the driver or io-net will call it for you.

Some drivers may support the DCMD_IO_NET_TX_FLUSH devctl
which will poke them into returning packets but if you
don't need them back right away it's better to wait.

{
struct _io_net_dcmd_redirect redir;
int ret = 0;

redir.op = _IO_NET_REDIRECT_ENDPOINT;
redir.u.endpoint.dcmd = DCMD_IO_NET_TX_FLUSH;
redir.u.endpoint.data = NULL;
redir.u.endpoint.size = 0;
redir.u.endpoint.cell = cell;
redir.u.endpoint.endpoint = endpoint;
redir.u.endpoint.iface = iface;

ion->devctl(our_reg_hdl, DCMD_IO_NET_REDIRECT_BELOW, &redir, sizeof
redir, &ret);
}
 
 View user's profile Send private message  
Reply with quote Back to top
Q
Post subject: Re: Should I call tx_done() after tx_down() ?  PostPosted: Oct 31, 2007 - 08:40 AM
Guest





Quote:
ion->devctl(our_reg_hdl, DCMD_IO_NET_REDIRECT_BELOW, &redir, sizeof
redir, &ret);
}

...and what about DCMD_IO_NET_TX_FLUSH cmd ?
does it flush all network devices ?

int ret, int_val = 0;
ion->devctl(reg_hdl, DCMD_IO_NET_TX_FLUSH, &int_val, sizeof(int_val), &ret);


and should I set _NPKT_NO_RES flag in packet after which I do "flush" ?

#define _NPKT_NO_RES 0x0002 /* Up producer wants its buffer back
right away. */
 
   
Reply with quote Back to top
Q
Post subject: Re: Should I call tx_done() after tx_down() ?  PostPosted: Oct 31, 2007 - 08:49 AM
Guest





Quote:
and should I set _NPKT_NO_RES flag in packet after which I do "flush" ?

#define _NPKT_NO_RES 0x0002 /* Up producer wants its buffer back
right away. */


and what about flag:
#define _NPKT_TX_WAIT 0x0400 /* More packets or a
DCMD_IO_NET_TX_FLUSH to come */

should I set it in npkt after which I do "flush" ?
 
   
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.