libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] Miscellaneous questions, primarily on design


From: Thomas Schmitt
Subject: Re: [Libcdio-devel] Miscellaneous questions, primarily on design
Date: Sat, 21 Mar 2020 12:34:39 +0100

Hi,

Samuel May wrote:
> > the physical button on the front of my drive stops working

Rocky Bernstein wrote:
> if you look at the GNU/Linux code in lib/driver/gnu_linux.c around line 80
> you'll see the different levels of access modes. In particular there is
> read/write (_AM_MMC_RDWR) and read/write exclusive (_AM_MMC_RDWR_EXCL)
> and later you'll see the access-mode string that correspond to this are
> "MMC_RDWR" and "MMC_RDWR_EXCL".

Aren't those about the exclusive or shared use of the device file ?


I have to correct myself. It is not SCSI command 1B START/STOP UNIT but
1E PREVENT ALLOW MEDIUM REMOVAL which controls the possibility for
medium removal by an operator.


The SCSI command bytes for unlocking the drive tray are

  { 0x1e, 0, 0, 0, 0, 0 };

for locking the tray:
  { 0x1e, 0, 0, 0, 1, 0 };

In include/cdio/mmc.h the command is mentioned as

  CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL
                                        = 0x1e, /**< Enable/disable Disc
                                                   removal. (6 bytes). */
used in lib/driver/mmc/mmc_ll_cmds.c by

  mmc_prevent_allow_medium_removal()

declared in
  include/cdio/mmc_ll_cmds.h
used by
  mmc_eject_media()
used (as alternative to ioctl(CDROMEJECT)) by
  eject_media_linux()
exposed as
  cdio_funcs_t.eject_media
used in high level API call
  cdio_eject_media()

I cannot spot a higher level API call which would unlock the tray without
trying to eject it.


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]