Skip navigation.
Home
The QNX Community Portal

View topic - Should I call tx_done() after tx_down() ?

Should I call tx_done() after tx_down() ?

Read-only archive of qnx.ddk (Writing device drivers for scanners, video card, optical mouse, etc) at inn.qnx.com

Should I call tx_done() after tx_down() ?

Postby Q » Wed Oct 24, 2007 2:40 pm

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() ?
Q
 

Re: Should I call tx_done() after tx_down() ?

Postby seanb » Wed Oct 24, 2007 7:40 pm

Q <no@spam.pl> wrote:
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.

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);
}
seanb
QNX Master
 
Posts: 133
Joined: Fri Jul 28, 2006 5:36 pm

Re: Should I call tx_done() after tx_down() ?

Postby Q » Wed Oct 31, 2007 8:40 am

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. */
Q
 

Re: Should I call tx_done() after tx_down() ?

Postby Q » Wed Oct 31, 2007 8:49 am

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" ?
Q
 


Return to qnx.ddk

Who is online

Users browsing this forum: No registered users and 1 guest

cron