driver -> user space async communication | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
I have two drivers, gpio and rf. They both communicate with user space
aynchronously. Here is the code. The problem is that setting at same
time both gpio_in_init and rf_init causes that only the last sighandler
is called.
How can I solve this and have both sighandlers called when a SIGIO event
is signalled by the respective driver?
USER SPACE:
void gpio_in_init(void){
gpio_in_file=open("/dev/gpio_in",O_RDWR | O_NONBLOCK,0);
//set fcntl
memset(&actiongpi,0,sizeof(actiongpi));
actiongpi.sa_handler=sighandler;
actiongpi.sa_flags=0;
sigaction(SIGIO,&actiongpi,NULL);
fcntl(gpio_in_file,F_SETOWN,getpid());
fcntl(gpio_in_file,F_SETFL, fcntl(gpio_in_file, F_GETFL)|FASYNC);
}
void rf_init(void){
gpio_in_file=open("/dev/gpio_in",O_RDWR | O_NONBLOCK,0);
//set fcntl
memset(&actiongpi,0,sizeof(actiongpi));
actiongpi.sa_handler=sighandler;
actiongpi.sa_flags=0;
sigaction(SIGIO,&actiongpi,NULL);
fcntl(gpio_in_file,F_SETOWN,getpid());
fcntl(gpio_in_file,F_SETFL, fcntl(gpio_in_file, F_GETFL)|FASYNC);
}
KERNEL SPACE:
kill_fasync(&async_queue, SIGIO, POLL_IN); In both gpio and rf drivers.
Victor Librado Sancho
Departamento I+D
------------------------------------------------------------------------
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
[Site Home] [Fedora ARM] [IETF Annouce] [Security] [Bugtraq] [Linux] [Linux ARM Kernel] [Linux OMAP] [Linux MIPS] [ECOS] [Tools] [DDR & Rambus] [Monitors]