David Weiss
|
Re: io-net convertor/driver issues
|
David Weiss
12/05/2008 12:33 PM
post18034
|
Re: io-net convertor/driver issues
Both netstat's show 0 for everything.
Here's the code from my convertor's rx_up method
int rx_up(....)
printf("foo_rx_up\n");
struct foo_ctl *pctrl = func_hdl;
if (npkt->flags & _NPKT_MSG)
{
int ret = foo_message(pctrl, npkt, cell, endpoint, iface);
return ret;
}
net_iov_t *iov;
net_buf_t *buf;
int i;
uint8_t dst[1024] = {0};
uint8_t* pTmp = (uint8_t*)dst;
int data_len = 0;
for (buf = TAILQ_FIRST(& npkt->buffers); buf != NULL; buf = TAILQ_NEXT(buf, ptrs))
{
for (i = 0, iov = buf->net_iov; i < buf->niov; i++, iov++)
{
memcpy(pTmp, iov->iov_base, iov->iov_len);
pTmp += iov->iov_len;
data_len += iov->iov_len;
}
}
printf("size of packet = %d\n", data_len);
for (i = 0; i < data_len; i++)
{
printf("%02x ", dst[i]);
}
printf("\n");
if(pctrl->npi->tx_up_start(pctrl->reg_hdl, npkt, 0, 0, pctrl->cell, pctrl->endpoint, 0, 0) != 0)
{
printf("failed %d\n", errno);
pctrl->npi->tx_done(pctrl->reg_hdl, npkt);
}
else
{
printf("success\n");
}
return 0;
}
//////////////////////////////////////////////
Here's the output from the printf's
/////////////////////////////////////////////
foo_rx_up
size of packet = 84
45 00 00 54 00 1a 00 00 ff 01 3a 3b c0 a8 00 02 c0 a8 00 01 08 00 07 25 e0 30 00 00 4f 00 00 00 0d 00 a6 06 00 08 09 0a
0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32
33 34 35 36
FooDriver::TxDone
success
/////////////////////////////////////////////////////
End output
/////////////////////////////////////////////////////
The packet data listed above is a valid ICMP echo request from my other device as far as I can tell - and it's what the
other device outputs when I display the data from my driver on that one.
Is it possible that i am filling in something incorrectly in the npkt_t structure in my driver? I took the makepacket
code directly out of your online docs, so I don't know why that would be incorrect, but I am at a loss as to why
tx_up_start is returning success in this case if the data is not getting to the stack.
Thanks again for any help you can provide me with.
|
|
|