Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - help with custom io-pkt driver design / debug: (4 Items)
   
help with custom io-pkt driver design / debug  
We have custom io-pkt driver that interfaces with a proprietary network interface.

Network interface is managed by a QNX resource manager, so rather then interacting with the hardware directly, our io-
pkt driver must interface with the resource manager.  This is a low-bandwidth connection, so throughput is not an issue.


Our current design spawns a thread (using pthread_create) in the io-pkt attach callback.  This thread read-blocks on the
 resource manager and when packets arrive, places them in a in-memory queue.  

In the process_interrupt callback, we check this queue for packets and push them into the io-pkt stack.

Things work well most of the time, but sometimes the system locks up.   System time appears to stop advancing, network 
calls hang and we lose serial shell connectivity.

I suspect we are violating some rules in the process_interrupt callback and blocking/corrupting the system timer.

We use standard pthread_mutex calls to protect access to the in-memory queue between the rx thread and the process 
interrupt callback. 

Should we be usings the NW_SIGLOCK calls instead?   
Is the process_interrupt() invoked in normal context or is it an interrupt or signal handler?  What are the restrictions
 on method usage in this context?

Thanks,
Dan Giorgis

RE: help with custom io-pkt driver design / debug  
Whenever I have mutexing problems (with a new driver)
with io-pkt, I do this:

  dumper -p <pid>

where pid is io-pkt's from pidin.

It will create a core file, as if io-pkt had sigsegv'd,
and you can easily bt with gdb to figure out what went
wrong.  Sounds like you have a window somewhere.

PS  I had to write an identical (emulated ethernet) driver
to talk to the bluetooth server for BNEP.  We just put a
BNEP resmgr in the bluetooth server, and the driver does
read() and write() for packet rx and tx.

I put the driver in the nda section - generally anything
involving wireless involves more legal wrangling than my
first divorce, which was nuclear capable - but it turns
out there is absolutely nothing NDA in the driver - I 
wrote it all from scratch, and it includes a sample resmgr
to integrate into your server that actually talks to the
hardware.  It looks just like an ethernet driver to 
io-pkt so tcp/ip and qnet work over it just fine.

If you want the source to the bt driver, ask Bert, or 
whatever other connection you might have.

--
aboyd  www.pittspecials.com/movies/tumble.wmv



Re: RE: help with custom io-pkt driver design / debug  
Andrew -

Thanks for the suggestion.  Your bt driver sounds very similar to what we are trying to do.  

I've contacted my support channel to get the source.

- Dan
RE: RE: help with custom io-pkt driver design / debug  
Ok.  Pass this source URL onto your connection:

http://svn.ott.qnx.com/view/product/trunk/lib/io-pkt/sys/dev_nda/bluetoo
th/

--
aboyd   www.pittspecials.com/movies/roll.wmv