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.\" $FreeBSD$ 26.\" 27.Dd March 25, 2014 28.Dt CD 9 29.Os 30.Sh NAME 31.Nm cd 32.Nd CDROM driver for the CAM SCSI subsystem 33.Sh DESCRIPTION 34The 35.Nm 36device driver provides a read only interface for CDROM drives 37.Tn ( SCSI 38type 5) 39and WORM drives 40.Tn ( SCSI 41type 4) 42that support CDROM type commands. 43Some drives do not behave as the driver expects. 44See the 45.Sx QUIRKS 46section for information on possible flags. 47.Sh QUIRKS 48Each 49.Tn CD-ROM 50device can have different interpretations of the 51.Tn SCSI 52spec. 53This can lead to drives requiring special handling in the driver. 54The following is a list of quirks that the driver recognize. 55.Bl -tag -width CD_Q_BCD_TRACKS 56.It Dv CD_Q_NO_TOUCH 57This flag tells the driver not to probe the drive at attach time to see if 58there is a disk in the drive and find out what size it is. 59This flag is currently unimplemented in the CAM 60.Nm 61driver. 62.It Dv CD_Q_BCD_TRACKS 63This flag is for broken drives that return the track numbers in packed BCD 64instead of straight decimal. 65If the drive seems to skip tracks 66(tracks 10-15 are skipped) 67then you have a drive that is in need of this flag. 68.It Dv CD_Q_NO_CHANGER 69This flag tells the driver that the device in question is not a changer. 70This is only necessary for a CDROM device with multiple luns that are not a 71part of a changer. 72.It Dv CD_Q_CHANGER 73This flag tells the driver that the given device is a multi-lun changer. 74In general, the driver will figure this out automatically when it sees a 75LUN greater than 0. 76Setting this flag only has the effect of telling the 77driver to run the initial read capacity command for LUN 0 of the changer 78through the changer scheduling code. 79.It Dv CD_Q_10_BYTE_ONLY 80This flag tells the driver that the given device only accepts 10 byte MODE 81SENSE/MODE SELECT commands. 82In general these types of quirks should not be 83added to the 84.Xr cd 4 85driver. 86The reason is that the driver does several things to attempt to 87determine whether the drive in question needs 10 byte commands. 88First, it 89issues a CAM Path Inquiry command to determine whether the protocol that 90the drive speaks typically only allows 10 byte commands. 91(ATAPI and USB 92are two prominent examples of protocols where you generally only want to 93send 10 byte commands.) 94Then, if it gets an ILLEGAL REQUEST error back 95from a 6 byte MODE SENSE or MODE SELECT command, it attempts to send the 10 96byte version of the command instead. 97The only reason you would need a 98quirk is if your drive uses a protocol (e.g., 99.Tn SCSI ) 100that typically does not have a problem with 6 byte commands. 101.El 102.Sh FILES 103.Bl -tag -width /sys/cam/scsi/scsi_cd.c -compact 104.It Pa /sys/cam/scsi/scsi_cd.c 105is the driver source file. 106.El 107.Sh SEE ALSO 108.Xr cd 4 , 109.Xr scsi 4 110.Sh HISTORY 111The 112.Nm 113manual page first appeared in 114.Fx 2.2 . 115.Sh AUTHORS 116.An -nosplit 117This 118manual page was written by 119.An John-Mark Gurney Aq jmg@FreeBSD.org . 120It was updated for CAM and 121.Fx 3.0 122by 123.An Kenneth Merry Aq ken@FreeBSD.org . 124