CDROM capabilities

Instead of just implementing some ioctl calls, the interface in cdrom.c supplies the possibility to indicate the capabilities of a CDROM drive. This can be done by ORing any number of capability-constants that are defined in ucdrom.h at the registration phase. Currently, the capabilities are any of:

$\displaystyle \halign$$#$  & $/*$#$*/$$\displaystyle \cr$CDCCLOSETRAY & canclosetraybysoftwarecontrol$\displaystyle \cr$CDCOPENTRAY & canopentray$\displaystyle \cr$CDCLOCK & canlockandunlockthedoor$\displaystyle \cr$CDCSELECTSPEED & canselectspeed, inunitsof$∼$150 kB/s$\displaystyle \cr$CDCSELECTDISC & driveisjuke-box$\displaystyle \cr$CDCMULTISESSION & canreadsessions$ > 1$$\displaystyle \cr$CDCMCN & canreadMediumCatalogNumber$\displaystyle \cr$CDCMEDIACHANGED & canreportifdischaschanged$\displaystyle \cr$CDCPLAYAUDIO & canperformaudio-functions(play, pause, etc)$\displaystyle \cr$

The capability flag is declared const, to prevent drivers from accidentally tampering with the contents. However, upon registration, some (claimed) capability flags may be cleared if the supporting function has not been implemented (see registercdrom() in cdrom.c).

If you want to disable any of the capabilities, there is a special flag register < device > dops.mask that may (temporarily) disable certain capabilities. In the file cdrom.c you will encounter many constructions of the type

$\displaystyle \it
if\ (cdo\rightarrow capability \mathrel\& \mathord{\sim} cdo\rightarrow mask
\mathrel{\&} CDC_<capability>) \ldots
$

The mask could be set in the low-level driver code to disable certain capabilities for special brands of the device that can't perform the actions. However, there is not (yet) an ioctl to set the mask...The reason is that I think it is better to control the behavior rather than the capabilities.