Andor Nas
|
Re: io-pkt-v4 crashes when devnp driver hands ethernet packet over (qnx 6.4.0) -- WTP is null!! -- hmmm ...
|
Andor Nas
07/24/2009 12:27 PM
post34533
|
Re: io-pkt-v4 crashes when devnp driver hands ethernet packet over (qnx 6.4.0) -- WTP is null!! -- hmmm ...
Hello,
I am writing a devnp ethernet network driver for a usb based card. No shim.
I am using the qnx usb stack and the corresponding usbd_...() api.
The usb stack calls back when there is an ethernet packet to be received. In this routine I got a packet in my hand, I
create an mbuf, stuff it, and hand it over to io-pkt-v4 with (*ifp->if_input)(ifp, m). WTP is zero because this is not
an io-pkt-v4 registered thread (the usb stack client creates it underneath the qnx usbd_...() api, I don't have control
over the thread).
WTP is null and the mbuf macros/functions use it. If I use the ..._wtp() macros/functions only I am OK in the driver but
io-pkt-v4 crashes later at forwarding. Hmmm ...
Code:
static void hsoncusb_bulk_cbf( struct usbd_urb *urb, struct usbd_pipe *pipe, void *hdl )
{
...
m = m_getcl_wtp(M_DONTWAIT, MT_DATA, M_PKTHDR, wtp);
m_copyback(m, 0, hsoncusbdev->len_bulkin, hsoncusbdev->buffer_bulkin);
...
ifp->if_ipackets++;
(*ifp->if_input)(ifp, m);
...
}
How do you hand over (receive) an ethernet packet to io-pkt-v4 from a non-registered devnp driver thread correctly? Is
there some sample code I can use?
Comments? Suggestions?
Thanks.
Andor
7/24/2009
--
Andor Nas
andor.nas@andrew.com
|
|
|