<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//en">
<!–Converted with LaTeX2HTML 2022 (Released January 1, 2022) –>
<HTML lang="en">
<HEAD>
<TITLE>Contents of CDROM capabilities</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0">
<META NAME="Generator" CONTENT="LaTeX2HTML v2022">
<LINK REL="STYLESHEET" HREF="cdrom-st.css">
<LINK REL="next" HREF="node19_mn.html">
<LINK REL="previous" HREF="node17_mn.html">
<LINK REL="up" HREF="node2_mn.html">
<LINK REL="next" HREF="node19_mn.html">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#9944EE" vlink="#0000ff" alink="#00ff00">
<H2><A ID="SECTION000216000000000000000">
CD<SMALL>ROM</SMALL> capabilities</A>
</H2>
<P>
<TT>Instead of just implementing some <I>ioctl</I> calls, the interface in
<TT>cdrom.c</TT> supplies the possibility to indicate the <EM>capabilities</EM>
of a CD<SMALL>ROM</SMALL> drive. This can be done by ORing any number of
capability-constants that are defined in <TT>ucdrom.h</TT> at the registration
phase. Currently, the capabilities are any of:
</TT><P><!– MATH

$#$ & $/*$ #$*/$
CDCCLOSETRAY &
canclosetraybysoftwarecontrol
CDCOPENTRAY &
canopentray
CDCLOCK &
canlockandunlockthedoor
CDCSELECTSPEED &
canselectspeed,
inunitsof$∼$150
kB/
s
CDCSELECTDISC &
driveisjuke-
box
CDCMULTISESSION &
canreadsessions$ > 1$
CDCMCN &
canreadMediumCatalogNumber
CDCMEDIACHANGED &
canreportifdischaschanged
CDCPLAYAUDIO &
canperformaudio-
functions(
play,
pause,
etc)
–>
</P>
<DIV ALIGN="CENTER">
<IMG
STYLE="" SRC="img1.png"
ALT="
"># & /*#*/<IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>C</SUB><I>LOSE</I><SUB>T</SUB><I>RAY</I> & <I>canclosetraybysoftwarecontrol</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>O</SUB><I>PEN</I><SUB>T</SUB><I>RAY</I> & <I>canopentray</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>L</SUB><I>OCK</I> & <I>canlockandunlockthedoor</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>S</SUB><I>ELECT</I><SUB>S</SUB><I>PEED</I> & <I>canselectspeed</I>, <I>inunitsof</I>& #8764;150 <I>kB</I>/<I>s</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>S</SUB><I>ELECT</I><SUB>D</SUB><I>ISC</I> & <I>driveisjuke</I>-<I>box</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>M</SUB><I>ULTI</I><SUB>S</SUB><I>ESSION</I> & <I>canreadsessions</I>
& gt;1<IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>M</SUB><I>CN</I> & <I>canreadMediumCatalogNumber</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>M</SUB><I>EDIA</I><SUB>C</SUB><I>HANGED</I> & <I>canreportifdischaschanged</I><IMG
STYLE="" SRC="img2.png"
ALT="
"><I>CDC</I><SUB>P</SUB><I>LAY</I><SUB>A</SUB><I>UDIO</I> & <I>canperformaudio</I>-<I>functions</I>(<I>play</I>, <I>pause</I>, <I>etc</I>)<IMG
STYLE="" SRC="img2.png"
ALT="
">
</DIV><P></P><TT>
The capability flag is declared <I>const</I>, 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 <!– MATH
registercdrom()
–>
<I>register</I><SUB>c</SUB><I>drom</I>() in
<TT>cdrom.c</TT>).
</TT>
<P>
<TT>If you want to disable any of the capabilities, there is a special
flag register <!– MATH
< device > dops.mask
–>
< <I>device</I> > <SUB>d</SUB><I>ops</I>.<I>mask</I> that may (temporarily) disable
certain capabilities. In the file <TT>cdrom.c</TT> you will encounter many
constructions of the type
</TT><P><!– MATH
–>
</P>
<DIV ALIGN="CENTER">
<IMG
STYLE="" SRC="img7.png"
ALT="
">
</DIV><P></P><TT>
The <I>mask</I> 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 <I>ioctl</I> to set
the mask...The reason is that I think it is better to control the
<EM>behavior</EM> rather than the <EM>capabilities</EM>.
</TT>
<P>
<HR>
</BODY>
</HTML>