roderic@vicom.com (Roderic Taylor) (06/28/90)
(SunOS 4.03, Sparcstation) I'm trying to get a simple driver I've written (read only) to work with Sunview. I open the driver and call notify_set_input_func() with the appropriate arguments, but the notifier only calls the event handler occasionally (when the mouse is moved); it does not call it as new data comes in from the device. Following the advice from the Sun manual, "Writing Device Drivers" (section 6.9-Skeleton Driver Variations, "Asynchronous I/O support"), I've written a simple driver select function and have created a mechanism using ioctl() to direct the driver to generate SIGIO interrupts when new data arrives. I've tested both these features outside the notifier, and they work. I'm presuming the notifier works by getting the device to generate SIGIO interrupts (though I'm not sure this is the case). Perhaps there is some standard mechanism I've missed that enables SIGIO on a file descriptor and needs to be supported in the driver code somehow. The method of using ioctl() to turn on and off SIGIO given in "Writing Device Drivers" doesn't look like a general interface. It mentions that fcntl() can also be used to implement asynchronous IO control, but doesn't mention what (if anything) must be put in the driver for it to work. I've tried enabling the driver's SIGIO feature myself (using my ioctl command) before entering the notifier loop, but that doesn't help.