Re: Asynchronous CDROM Events in Userland

From: Erik Andersen (andersen@codepoet.org)
Date: Mon Feb 04 2002 - 02:04:14 EST


On Sun Feb 03, 2002 at 11:41:47PM -0500, Calin A. Culianu wrote:
>
> Is there any way, other than by polling, to have a user process be
> notified of a change in status on a cdrom drive? (Such as if the drive
> opens, closes, gets new media, etc)?

Nope. It would be nice, but the current crop of hardware simply
doesn't support it. From the Mt. Fuji spec (SFF8090i) 11.5 Get
Event/Status Notification:

    The GET EVENT/STATUS NOTIFICATION Command requests the Logical Unit to
    report event(s) and status as specified in the Notification
    ClassNotification Class Request field and provides asynchronous
    notification. Two modes of operation are defined here. They are
    polling and asynchronous modes.

    In polling mode, the Host will issue GET EVENT/STATUS NOTIFICATION
    Commands at periodic intervals with an immediate (Immed) bit of 1 set.
    The Logical Unit shall complete this Command with the most recently
    available event status requested. The Logical Unit shall support
    polling mode.

    In asynchronous mode, the Host will issue a single GET EVENT/STATUS
    NOTIFICATION Command with an Immed (immediate) bit of 0 requested. If
    the Logical Unit supports Asynchronous event status notification
    (through tagged queuing) the model outlined here shall be used. If the
    Logical Unit does not support Asynchronous Mode, the Command shall
    fail as an illegal request. If the Host requests Asynchronous Mode
    using a non-queable or non-overlappable request, the Command shall
    fail with CHECK CONDITION Status, 5/24/00 INVALID FIELD IN CDB.

Jens Axboe and I wrote a little test app a year or two ago to check
for whether drives supported asynchronous mode. We found it to be
unsupported on 100% of the drives we tested (and we tested quite a
few)...

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:31 EST