Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Network driver events that are not interrupts: (6 Items)
   
Network driver events that are not interrupts  
The documentation says "The stack uses a thread pool to service events that are generated from other parts of the system
. These events may be time outs, ISR events or other things generated by the stack or protocol modules."

An example for a driver registering for interrupt handling is provided - it's interrupt_entry_init(). But where can I 
find an example for a driver registering to handle "other things", such as pulses?
Re: Network driver events that are not interrupts  
If I get the question right, the other events could be among the callbacks
registered to io-net by different driver/filter/protocol modules.

please refer io_net_registrant_funcs_t in qnx documentation

Regards
VG

On Wed, Dec 29, 2010 at 7:56 PM, Max Timchenko <community-noreply@qnx.com>wrote:

> The documentation says "The stack uses a thread pool to service events that
> are generated from other parts of the system. These events may be time outs,
> ISR events or other things generated by the stack or protocol modules."
>
> An example for a driver registering for interrupt handling is provided -
> it's interrupt_entry_init(). But where can I find an example for a driver
> registering to handle "other things", such as pulses?
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post80616
>
>
Re: Network driver events that are not interrupts  
Thanks VG. Sorry, I should have specified I'm interested in how this works in the new io-pkt framework.
Re: Network driver events that are not interrupts  
In the io-net world, drivers created their own (usually priority 21)
threads to service their interrupts.

You're not supposed to do that in io-pkt.  The stack is supposed
to be in charge of threading and execution.  Ideally, an io-pkt
driver should be just a collection of callback functions, which 
the stack executes.

In an io-pkt driver's _attach function, you will see it stuffing
various function callbacks in the driver ifp structure, such
as _ioctl, _start (tx), _init, and _stop.

Additionally, io-pkt drivers also attach to hardware interrupts
but the driver handlers actually kick io-pkt, which in turn call
the driver.

The other common way that a driver can do stuff (eg start
execution) is via the callback_msec() function, where it asks
the stack to make a callback function into the driver after a
certain amount of time has elapsed.  This is often used by
a driver for link monitoring, tx packet harvesting, etc.

However.  You may encounter a situation where you really
really need your own driver thread.  This occasionally happens,
but is discouraged unless really necessary.  It can be done if you 
code carefull, because there are things you simply cannot do if 
you are not "the stack thread".

Seanb or Patrik can explain further if need be.
Re: Network driver events that are not interrupts  
Thanks Andrew. You're confirming my understanding of the Networking architecture so far.

My question is more specific. A driver needs to react to a QNX pulse, which is a MsgReceive blocking call. Can I 
register it with the io-pkt stack in some way (similar to an interrupt) so that my function will get called to handle 
the pulse, or do I need to create my own thread for this?

(the scenario is almost the same as the one described in http://community.qnx.com/sf/discussion/do/listPosts/projects.
networking/discussion.technology.topc14720 - a driver has to communicate with a RM in a different process, instead of 
the actual hardware, to perform I/O).
Re: Network driver events that are not interrupts  
> My question is more specific. A driver needs to react to a QNX pulse, which is
>  a MsgReceive blocking call. Can I register it with the io-pkt stack in some 
> way (similar to an interrupt) so that my function will get called to handle 
> the pulse, or do I need to create my own thread for this?
> 
> (the scenario is almost the same as the one described in http://community.qnx.
> com/sf/discussion/do/listPosts/projects.networking/discussion.technology.
> topc14720 - a driver has to communicate with a RM in a different process, 
> instead of the actual hardware, to perform I/O).

Bump... any help?

Thanks, Max