kqueue/kevent support in scsi device drivers
jaya_bhat100 at yahoo.co.in
Thu Jun 12 02:25:04 PDT 2003
yeah, I would like to implement it in scsi_target driver. I am using scsi HBA in target to emulate as a sequential device. My userland application needs to be notified of some events taking place in scsi_target driver.
Could you pls suggest me the best approach for this??
Valentin Nechayev <netch at iv.nn.kiev.ua> wrote:
Fri, May 30, 2003 at 12:14:50, jaya_bhat100 (Jayasheela Bhat) wrote about "kqueue/kevent support in scsi device drivers":
JB> At present, kevent is supported for vnode, fifos, pipes and sockets, I believe.
JB> I would like to use kevent notification in scsi devices. But the drivers scsi_xx.c do not support it. Whether I can implement it in scsi device driver using KNOTE?
JB> I was going through tty.c where KNOTE is used. struct 'tty' has the support for it. The same is not available in struct 'disk'.
JB> Could anyone tell me whether it is possible to implement it and how??
What is the aim to do it? tty, sockets, pipes, fifos are sequential devices
with data pushing to it. Disks are random access devices, this is the main
reason why disk/filesystem read() can't be nonblocking by itself: there
are two different operations in them - 1) process says to kernel what it
want read, 2) kernel returns data. (And similarly for write().)
To read from random access devices, AIO API was created (aio_read(),
aio_write(), etc.), and it doesn't require your explicit KNOTE adding:
it already supports EVFILT_AIO and SIGEV_KEVENT.
If you can access something at SCSI subsystem as sequential device,
let you go. But, it's better to implement KNOTE in driver of this device
itself, not common SCSI layer, which is too complicated to allow it.
Catch all the cricket action. Download Yahoo! Score tracker
More information about the freebsd-hackers