Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - A bit of help requested with iofunc_notify_trigger.: (2 Items)
   
A bit of help requested with iofunc_notify_trigger.  
Hi all, this is related to post 1282, answered by Sean.

I have a client that wants to be notified when 2 types of events occur in the driver namely:

status = ionotify(fd, _NOTIFY_ACTION_TRANARM, _NOTIFY_COND_INPUT, &thread_data.notify_event);
	printf("resmgr.client: ionotify returned %d.\n", status); 
	
	status = ionotify(fd, _NOTIFY_ACTION_TRANARM, _NOTIFY_COND_OBAND, &thread_data.interrupt_event);
	printf("resmgr.client: ionotify returned %d.\n", status); 

The INPUT condition works, but I have issues getting the OBAND working. I'm a bit stuck now.

In the resource manager, I do:

void *mythread(void *arg)
{
device_attr_t *dattr = (device_attr*)arg;

if (IOFUNC_NOTIFY_OBAND_CHECK(device_attr->notify, 1, 1))
{
iofunc_notify_trigger(device_attr->notify, 1, IOFUNC_NOTIFY_OBAND);
}
return NULL;
}

This is the same as I do for the INPUT condition. 

The difference is that the INPUT condition is set within io_write() and the OBAND condition is set within a thread (as 
shown above) that has been passed the device attribute structure containing the notification structure during creation.

The problem is that the OBAND condition is not received in the client.

Could someone tell me:
1) Tell me about any caveats using i/o notification.
2) if it is allowed having the same client waiting for notification twice using TRANARM?
3) How the IOFUNC_NOTIFY_*_CHECK macro's work. I am really interested in how the 3rd argument works.

I have attached part of the code of the resource manager.

Regards,
Freddy
Re: A bit of help requested with iofunc_notify_trigger.  
On Sun, Dec 02, 2007 at 11:12:16AM -0500, Freddy Martens wrote:
> Hi all, this is related to post 1282, answered by Sean.
> 
> I have a client that wants to be notified when 2 types of events occur
> in the driver namely:
> 
> status = ionotify(fd, _NOTIFY_ACTION_TRANARM, _NOTIFY_COND_INPUT,
> &thread_data.notify_event);
> 	printf("resmgr.client: ionotify returned %d.\n", status); 
> 	
> 	status = ionotify(fd, _NOTIFY_ACTION_TRANARM,
> _NOTIFY_COND_OBAND, &thread_data.interrupt_event);
> 	printf("resmgr.client: ionotify returned %d.\n", status); 
> 
> The INPUT condition works, but I have issues getting the OBAND working.
> I'm a bit stuck now.
> 
> In the resource manager, I do:
> 
> void *mythread(void *arg)
> {
> device_attr_t *dattr = (device_attr*)arg;
> 
> if (IOFUNC_NOTIFY_OBAND_CHECK(device_attr->notify, 1, 1))
> {
> iofunc_notify_trigger(device_attr->notify, 1, IOFUNC_NOTIFY_OBAND);
> }
> return NULL;
> }
> 
> This is the same as I do for the INPUT condition. 
> 
> The difference is that the INPUT condition is set within io_write() and
> the OBAND condition is set within a thread (as shown above) that has
> been passed the device attribute structure containing the notification
> structure during creation.
> 
> The problem is that the OBAND condition is not received in the client.
> 
> Could someone tell me:
> 1) Tell me about any caveats using i/o notification.
> 2) if it is allowed having the same client waiting for notification
> twice using TRANARM?
> 3) How the IOFUNC_NOTIFY_*_CHECK macro's work. I am really interested in
> how the 3rd argument works.
> 
> I have attached part of the code of the resource manager.
> 

There's a check in iofunc_notify() in the manager side that
fails an further TRANARM requests if a previous TRANARM for
INPUT was received (make sure you're checking this return
value).  The comment says this is to enforce mqueue
semantics.  This may be heavy as this could probably be
enforced in mqueue itself.  For now this may work (at least
once) if you request OBAND before INPUT.

-seanb