I'm new to writing device drivers ;-)
I've got a device connected to my cpu which can arise an interrupt if it
I succeded in getting an interrupt....
My problem is: How can I tell any user application that the device needs
First off all I thought of implementing the poll function.
I found some resources on the web telling me about this function, but I
can't get behind it (although it must be simple).
unsigned int scull_p_poll(struct file *filp, poll_table *wait)
unsigned int mask = 0;
poll_wait(filp, &dev->inq, wait);
poll_wait(filp, &dev->outq, wait);
if ( isReadable() ) mask |= POLLIN | POLLRDNORM; /* readable */
if ( isWritable() ) mask |= POLLOUT | POLLWRNORM; /* writable */
inq and outq are defined elsewhere.Quote:}
Am'I right when mask is return as 0 (neither readable nor writeable) the
process blocks until the inq or outq is waked up?
But can I use this poll in my case? I don't have blocking read or write.
(The device can allways be read from or written to but its only interesting
after the device arised an interrupt.
The other thing I thought of was to implement an ioctl command, which puts
my process to sleep until an irq occours. Is this allowed and a good
behaviour of a device driver?
Thanks for any hint!