There's a fine line between native and ported drivers.
If you do more than the initial "make it run" port, the
feature sets of a ported driver and a native driver aren't really any
different.
If you look deeper, there are some differences:
- From a source point of view, a ported driver has a very different layout
from a native io-pkt driver.
The native driver source has all of the source
for a particular driver under one directory.
The NetBSD driver source is quite different in layout, with source for a
particular driver spread out under a specific driver directory,
as well as
ic, pci, usb, and other
directories, depending on the driver type and bus that it's on.
- Ported NetBSD drivers don't allow the stack to run in multi-threaded mode.
NetBSD drivers don't have to worry about Rx / Tx threads running
simultaneously when run inside of the NetBSD operating system, so there's
no need to pay close attention to appropriate locking issues
between Rx and Tx.
For this reason, a configuration flag is, by default, set to indicate
that the driver doesn't support multi-threaded access.
As a result, the entire stack runs in a single-threaded mode of operation
(if one driver can't run in multithreaded mode, no drivers will run
with multiple threads).
You can change this flag once you've carefully
examined the driver to ensure that there are no locking issues.
- NetBSD drivers don't include support for QNX Neutrino-specific utilities,
such as
nicinfo.
- The NetBSD drivers have two different delay functions, both of which
take an argument in microseconds.
From the NetBSD documentation, DELAY() is reentrant (i.e it
doesn't modify any global kernel or machine state)
and is safe to use in interrupt or process context.
However, QNX Neutrino's version of delay() takes a time in
milliseconds, so this could result in very long timeouts if used directly
as-is in the drivers.
We've defined DELAY() to do the appropriate conversion of the
delay from microseconds to milliseconds, so all NetBSD ported drivers
should define delay() to be DELAY().