Regarding QNX structures

Hello,
I need help in replacing Linux sk_buff structure (declared
inlinux/sk_buff.h) to equivalent structure. does anybody have knowledge of
what structure and functions should I use for the same. I need to allocate
the buffer in ISR. linux provides dev_alloc_skb (uses alloc_skb with
GFP_ATOMIC flag) that makes it safe to use in ISR for memory allocation as
it is atomic and does not cause calling process to sleep. I want to know the
equivalents in QNX

Thanks in advance

regards
Moreshwar

Moreshwar Salpekar <moreshwars@hotmail.com> wrote:

Hello,
I need help in replacing Linux sk_buff structure (declared
inlinux/sk_buff.h) to equivalent structure. does anybody have knowledge of
what structure and functions should I use for the same. I need to allocate
the buffer in ISR. linux provides dev_alloc_skb (uses alloc_skb with
GFP_ATOMIC flag) that makes it safe to use in ISR for memory allocation as
it is atomic and does not cause calling process to sleep. I want to know the
equivalents in QNX

You can not allocate memory in an ISR under QNX.

Generally, you will pre-allocate memory in the process (ring buffer,
or some other buffering structure) at process time, and fill it at
interrupt time. If the ISR would need to allocate memory to move data
into, it should return an event, to wake up a thread and have that thread
allocate memory & get it from the hardware.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

Thanks for the clarification but then how do I port the Linux code? I need
to port Linux code to QNX. Linux uses sk_buff structure and uses
dev_alloc_skb for allocation of memory. Seems I need to replace sk_buff
structure with nkpt_t, io_net_self_t and a device structure

Regards
Moreshwar
“David Gibbs” <dagibbs@qnx.com> wrote in message
news:chqath$f7k$3@inn.qnx.com

Moreshwar Salpekar <> moreshwars@hotmail.com> > wrote:
Hello,
I need help in replacing Linux sk_buff structure (declared
inlinux/sk_buff.h) to equivalent structure. does anybody have knowledge
of
what structure and functions should I use for the same. I need to
allocate
the buffer in ISR. linux provides dev_alloc_skb (uses alloc_skb with
GFP_ATOMIC flag) that makes it safe to use in ISR for memory allocation
as
it is atomic and does not cause calling process to sleep. I want to know
the
equivalents in QNX

You can not allocate memory in an ISR under QNX.

Generally, you will pre-allocate memory in the process (ring buffer,
or some other buffering structure) at process time, and fill it at
interrupt time. If the ISR would need to allocate memory to move data
into, it should return an event, to wake up a thread and have that thread
allocate memory & get it from the hardware.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com