<!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

$\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$

–> </P> <DIV ALIGN="CENTER"> <IMG STYLE="" SRC="img1.png" ALT=" $\displaystyle \halign$">#&nbsp; &amp; /*#*/<IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>C</SUB><I>LOSE</I><SUB>T</SUB><I>RAY</I> &amp; <I>canclosetraybysoftwarecontrol</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>O</SUB><I>PEN</I><SUB>T</SUB><I>RAY</I> &amp; <I>canopentray</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>L</SUB><I>OCK</I> &amp; <I>canlockandunlockthedoor</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>S</SUB><I>ELECT</I><SUB>S</SUB><I>PEED</I> &amp; <I>canselectspeed</I>, <I>inunitsof</I>& #8764;150&nbsp;<I>kB</I>/<I>s</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>S</SUB><I>ELECT</I><SUB>D</SUB><I>ISC</I> &amp; <I>driveisjuke</I>-<I>box</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>M</SUB><I>ULTI</I><SUB>S</SUB><I>ESSION</I> &amp; <I>canreadsessions</I> & gt;1<IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>M</SUB><I>CN</I> &amp; <I>canreadMediumCatalogNumber</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>M</SUB><I>EDIA</I><SUB>C</SUB><I>HANGED</I> &amp; <I>canreportifdischaschanged</I><IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"><I>CDC</I><SUB>P</SUB><I>LAY</I><SUB>A</SUB><I>UDIO</I> &amp; <I>canperformaudio</I>-<I>functions</I>(<I>play</I>, <I>pause</I>, <I>etc</I>)<IMG STYLE="" SRC="img2.png" ALT=" $\displaystyle \cr$"> </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 –> &lt; <I>device</I> &gt; <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

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

–> </P> <DIV ALIGN="CENTER"> <IMG STYLE="" SRC="img7.png" ALT=" $\displaystyle \it
if\ (cdo\rightarrow capability \mathrel\\ & \mathord{\sim} cd...
...htarrow mask
\mathrel{\\ &} CDC_\ensuremath{<}capability\ensuremath{>}) \ldots
$"> </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>