This is a case where page 101 of the ATAPI version 2.6 spec could come in
handy. You will find on that page a bit that specifies whether the disc
in the currently loaded cdrom slot has been changed since the last time
the disc was loaded. Unfortunatly, most ATAPI cdrom drives will not
report this particular bit, since slot tables are only returned for cdrom
drives that support cd changer commands.
Since that approach is going to be fairly useless, your next best bet is to
re-reading the TOC on every ioctl call to see if it is still the same
as last time. I would be glad to receive any patches you might have that
improve the behavior of ide-cd.
I have a few things I am working on right now with the kernel cdrom support,
such as a /proc interface for cdrom info and tunables via the generic
cdrom driver and sysctl (almost done), moving all the cdrom header files
except cdrom.h to drivers/cdrom/ (done), merging ucdrom.h and cdrom.h (done),
making some updates to the generic cdrom interface to make it even more
generic (in progress), and porting all the proprietary cdrom drivers to use
the generic interface. When I am done, there will be one (and only one)
Linux cdrom user interface. Just in time for DVDs to take over... [GRIN]
-Erik
-- Erik B. Andersen Web: http://www.inconnect.com/~andersen/ email: andersee@debian.org --This message was written using 73% post-consumer electrons--