For far most drives you have to resort to polling, as the drive
cannot report event like that asynchronously (spec says that
SCSI drives can do this, but I haven't seen any that does). So
basically this could be done inside the drive or from a user
space utility and inform automount of when to mount the drive.
Polling from inside the driver is just not going to happen,
for just the reasons you state - ugly.
> Do SCSI or EIDE CDROMs notify the host enviroment in any way that a CD was
> inserted or that its status has changed either directly or indirectly?
There are several ways to do it. The newest (as per MMC and Mt Fuji)
is to use GET_EVENT_STATUS with either synch or async notification.
The former requires polling for events while the latter can inform
the driver when a certain event has taken place - not just media
events, but things like power management, etc. This ties in with
what I wrote above - asynch status _is_ possible, but since no
drives implement it...
> Do SCSI or EIDE CDROMs notify the host enviroment in any way that the eject
> button has been pressed or that its status has changed either directly or
> indirectly? If not, could the pressing of the eject button be monitored
> through some sort of polling?
Same as above. Your best choice is probably to poll with
CDROM_MEDIA_CHANGED and use that information, although that
can't tell you about eject attempts.
-- * Jens Axboe <axboe@image.dk> * Linux CD-ROM Maintainer * http://www.kernel.dk- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/