Having ported some Linux drivers too, I would not say that philosophycal
difference is not all that relevant.
Yes, QNX drivers are processes, whereas Linux drivers are modules. However
if you look at the framework for writing char/block drivers in Linux, it is
quite similar to QNX ‘resource manager’ framework. Some things are simpler
in QNX (no need to care about kernel vs user space, ability to use all
standard POSIX API in the drivers, no stupid limits on DMA buffers), some
are easier in Linux (I’d say their framework is easier to use because it
includes wait queues management). However major concepts are very similar.
The network drivers of course are different story, since they follow a
separate model. I did not write any so I can not really comment on that …
but from a brief reading I did not see a lot of differences either.
“John McClurkin” <jwm@lsr.nei.nih.gov> wrote in message
news:ci6sib$1t7$1@inn.qnx.com…
Having written device drivers for 2 A/D cards for QNX from a linux
starting
point, I concur with Bill. I also found that Rob Krten’s book “Getting
Started with QNX Neutrino 2” (> www.parse.com> ) was extremely helpful.
“Bill Caroselli” <> qtps@earthlink.net> > wrote in message
news:ci459d$rbp$> 1@inn.qnx.com> …
Device drivers in QNX are philosophicly different. My advice is,
- read through the Linux driver and understand it
- read through any good QNX resource manager (divice driver) source
code
and understand it
- don’t port - redesign the QNX driver to talk to your hardware and do
everything that the linux driver currently does.
Moreshwar Salpekar <> moreshwars@hotmail.com> > wrote:
MS > Yes I need it, I am having problems in porting Linux kernel source
code and
MS > this is my first driver for QNX so unsure. I have managed to detect
the card
MS > and replaced the card detection mechanism in my source code. I have
replaced
MS > everything except the sk_buff structure and its associated
functions.
I am
MS > unable to decide how to go about it.
MS > If I have not mentioned it earlier,I am porting HDLC driver from
Linux to
MS > QNX.
MS > If you could let me know whether I am proceeding I correct
direction,
I
MS > would be grateful
MS > “John Nagle” <> nagle@downside.com> > wrote in message
MS > news:ci3814$61f$> 1@inn.qnx.com> …
First of all, a device driver in QNX is a user program.
You’re talking about memory allocation mechanisms used inside
the Linux kernel.
What you probably need is the source for some QNX Ethernet
device driver to look at.
John Nagle
Team Overbot
Moreshwar Salpekar wrote:
Thanks for the clarification but then how do I port the Linux code?
I
MS > 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… Would
that
MS > be
right? Memory buffer was being allocated for sk_buff through
MS > dev_alloc_skb
and I need to change the code I need to find replacement for this
MS > function
and the structure
Regards
Moreshwar “Igor Kovalenko” <> kovalenko@comcast.net> > wrote in message
news:chrn1s$hsm$> 1@inn.qnx.com> …
There’s isn’t any direct equivalent. I think even in Linux the use
of
GFP_ATOMIC is not encouraged. Basically, doing any kind of memory
allocations inside ISR is a poor design. You’re going to have to
change
that
design so that memory is allocated upfront.
– igor
“Moreshwar Salpekar” <> moreshwars@hotmail.com> > wrote in message
news:chpdun$noc$> 1@inn.qnx.com> …
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
MS > know
the
equivalents in QNX
Thanks in advance
regards
Moreshwar
\
Bill Caroselli – Q-TPS Consulting
1-(708) 308-4956 <== Note: New Number
qtps@earthlink.net