xref: /freebsd/share/man/man9/cd.9 (revision 06c3fb27)
1.\" Copyright (c) 1997
2.\"	John-Mark Gurney.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd March 25, 2014
26.Dt CD 9
27.Os
28.Sh NAME
29.Nm cd
30.Nd CDROM driver for the CAM SCSI subsystem
31.Sh DESCRIPTION
32The
33.Nm
34device driver provides a read-only interface for CDROM drives
35.Tn ( SCSI
36type 5)
37and WORM drives
38.Tn ( SCSI
39type 4)
40that support CDROM type commands.
41Some drives do not behave as the driver expects.
42See the
43.Sx QUIRKS
44section for information on possible flags.
45.Sh QUIRKS
46Each
47.Tn CD-ROM
48device can have different interpretations of the
49.Tn SCSI
50spec.
51This can lead to drives requiring special handling in the driver.
52The following is a list of quirks that the driver recognizes.
53.Bl -tag -width CD_Q_BCD_TRACKS
54.It Dv CD_Q_NO_TOUCH
55This flag tells the driver not to probe the drive at attach time to see if
56there is a disk in the drive and find out what size it is.
57This flag is currently unimplemented in the CAM
58.Nm
59driver.
60.It Dv CD_Q_BCD_TRACKS
61This flag is for broken drives that return the track numbers in packed BCD
62instead of straight decimal.
63If the drive seems to skip tracks
64(tracks 10-15 are skipped)
65then you have a drive that is in need of this flag.
66.It Dv CD_Q_NO_CHANGER
67This flag tells the driver that the device in question is not a changer.
68This is only necessary for a CDROM device with multiple luns that are not a
69part of a changer.
70.It Dv CD_Q_CHANGER
71This flag tells the driver that the given device is a multi-lun changer.
72In general, the driver will figure this out automatically when it sees a
73LUN greater than 0.
74Setting this flag only has the effect of telling the
75driver to run the initial read capacity command for LUN 0 of the changer
76through the changer scheduling code.
77.It Dv CD_Q_10_BYTE_ONLY
78This flag tells the driver that the given device only accepts 10 byte MODE
79SENSE/MODE SELECT commands.
80In general these types of quirks should not be
81added to the
82.Xr cd 4
83driver.
84The reason is that the driver does several things to attempt to
85determine whether the drive in question needs 10 byte commands.
86First, it
87issues a CAM Path Inquiry command to determine whether the protocol that
88the drive speaks typically only allows 10 byte commands.
89(ATAPI and USB
90are two prominent examples of protocols where you generally only want to
91send 10 byte commands.)
92Then, if it gets an ILLEGAL REQUEST error back
93from a 6 byte MODE SENSE or MODE SELECT command, it attempts to send the 10
94byte version of the command instead.
95The only reason you would need a
96quirk is if your drive uses a protocol (e.g.,
97.Tn SCSI )
98that typically does not have a problem with 6 byte commands.
99.El
100.Sh FILES
101.Bl -tag -width /sys/cam/scsi/scsi_cd.c -compact
102.It Pa /sys/cam/scsi/scsi_cd.c
103is the driver source file.
104.El
105.Sh SEE ALSO
106.Xr cd 4 ,
107.Xr scsi 4
108.Sh HISTORY
109The
110.Nm
111manual page first appeared in
112.Fx 2.2 .
113.Sh AUTHORS
114.An -nosplit
115This
116manual page was written by
117.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .
118It was updated for CAM and
119.Fx 3.0
120by
121.An Kenneth Merry Aq Mt ken@FreeBSD.org .
122