freebsd-src/sys/dev
Kenneth D. Merry 56eac725a3 Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fix
a number of related problems along the way.

 - Automatically detect CDROM drives that can't handle 6 byte mode
   sense and mode select, and adjust our command size accordingly.
   We have to handle this in the cd(4) driver (where the buffers are
   allocated), since the parameter list length is different for the
   6 and 10 byte mode sense commands.

 - Remove MODE_SENSE and MODE_SELECT translation removed in ATAPICAM
   and in the umass(4) driver, since there's no way for that to work
   properly.

 - Add a quirk entry for CDROM drives that just hang when they get a 6
   byte mode sense or mode select.  The reason for the quirk must be
   documented in a PR, and all quirks must be approved by
   ken@FreeBSD.org.  This is to make sure that we fully understand why
   each quirk is needed.  Once the CAM_NEW_TRAN_CODE is finished, we
   should be able to remove any such quirks, since we'll know what
   protocol the drive speaks (SCSI, ATAPI, etc.) and therefore whether
   we should use 6 or 10 byte mode sense/select commands.

 - Change the way the da(4) handles the no_6_byte sysctl.  There is
   now a per-drive sysctl to set the minimum command size for that
   particular disk.  (Since you could have multiple disks with
   multiple requirements in one system.)

 - Loader tunable support for all the sysctls in the da(4) and cd(4)
   drivers.

 - Add a CDIOCCLOSE ioctl for cd(4) (bde pointed this out a long
   time ago).

 - Add a media validation routine (cdcheckmedia()) to the cd(4)
   driver, to fix some problems bde pointed out a long time ago.  We
   now allow open() to succeed no matter what, but if we don't detect
   valid media, the user can only issue CDIOCCLOSE or CDIOCEJECT
   ioctls.

 - The media validation routine also reads the table of contents off
   the drive.  We use the table of contents to implement the
   CDIOCPLAYTRACKS ioctl using the PLAY AUDIO MSF command.  The
   PLAY AUDIO TRACK INDEX command that we previously used was
   deprecated after SCSI-2.  It works in every SCSI CDROM I've tried,
   but doesn't seem to work on ATAPI CDROM drives.  We still use the
   play audio track index command if we don't have a valid TOC, but
   I suppose it'll fail anyway in that case.

 - Add _len() versions of scsi_mode_sense() and scsi_mode_select() so
   that we can specify the minimum command length.

 - Fix a couple of formatting problems in the sense printing code.

MFC after: 	4 weeks
2003-02-21 06:19:38 +00:00
..
aac On detach, don't remove the child from our list of children unless it has 2003-02-20 23:13:48 +00:00
acpica Move the pnp and location info into the common pci bus. Make all known 2003-02-17 21:20:35 +00:00
advansys Consolidate MIN/MAX macros into one place (param.h). 2003-02-02 13:17:30 +00:00
agp Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
aha Consolidate MIN/MAX macros into one place (param.h). 2003-02-02 13:17:30 +00:00
ahb Consolidate MIN/MAX macros into one place (param.h). 2003-02-02 13:17:30 +00:00
aic Add second and thrid bus-toaster IDs 2002-11-14 05:08:22 +00:00
aic7xxx Revert AHD_TIMER_MAX_US to its original definition now that the 2003-01-22 22:00:07 +00:00
amd Convert the use of vtophys() for doing autosense to use busdma. Also correct 2002-12-14 19:20:57 +00:00
amr Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
an Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ar Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
asr Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ata Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fix 2003-02-21 06:19:38 +00:00
atkbdc Spelling. 2003-02-05 14:03:55 +00:00
awi Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
bge Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
bktr Remove unintended growth of bt848_card_signature. 2003-02-03 18:59:12 +00:00
buslogic Consolidate MIN/MAX macros into one place (param.h). 2003-02-02 13:17:30 +00:00
cardbus Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ccd Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ciss Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
cm Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
cnw Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
cs Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ct This file does not <sys/disklabel.h> 2002-09-20 18:15:40 +00:00
cy Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
dc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
de Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
dec Introduce a boot environment variable (clock_compat_osf1) which can 2001-11-03 17:22:50 +00:00
dgb Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
digi Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
dpt Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
drm Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ed Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
eisa Add tunable "hw.eisa_slots" to allow overriding the default number 2002-10-31 00:45:49 +00:00
em Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
en Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ep Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ex Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
exca Massive overhaul of exca to help with the isa efforts: 2003-02-14 06:21:18 +00:00
fb Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
fdc Bail out of fd_clone() if the parsed unit number doesn't match our 2003-01-11 20:10:41 +00:00
fe Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
firewire Oops, forgot to put back debug level. 2003-02-21 02:27:13 +00:00
fxp Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
gem Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
gfb Move include of opt_fb.h earlier so that FB_INSTALL_CDEV is defined in 2002-11-08 21:04:44 +00:00
gx Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
hea Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
hfa Adjust some casts to quiet warnings. 2002-11-06 22:58:55 +00:00
hifn Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
hme Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ic Move the com_scr register address definition over with the other seven. 2002-09-22 08:51:31 +00:00
ichsmb typo. 2002-10-18 12:06:01 +00:00
ida Update to new crashdump API 2003-02-07 06:58:32 +00:00
idt Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ie Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
iicbus Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
iir Remove S_IROTH from the make_dev() lines for iir-related devices. This 2002-12-27 16:28:31 +00:00
isp Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ispfw Roll to latest level. 2003-02-16 01:30:31 +00:00
joy Fix typo in the BSD copyright: s/withough/without/ 2002-06-02 20:05:59 +00:00
kbd Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
lge Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
lmc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
lnc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
mc146818
mca Argh, isa(4), eisa(4) and mca(4) now attach to legacy(4) instead of 2002-09-26 18:40:06 +00:00
mcd Replace {disable,enable}_intr() with critical_{enter,exit}(). 2002-11-10 03:45:49 +00:00
md Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
mii Remove unused variable and code. 2003-02-19 00:32:01 +00:00
mk48txx Add a driver back end for the Mostek MK48T02, MK48T08 and MK48T59 2002-04-04 23:44:42 +00:00
mlx Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
mly Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
mpt Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
mse Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
musycc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
my Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ncv Change to correct card entry. RATOC REX-R280 is 10Base-T Ether Card, 2003-01-11 13:04:59 +00:00
nge Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
nmdm Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
nsp o Changes to support NEWCARD. 2002-11-28 01:09:29 +00:00
null Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ofw Change the console interface to pass a "struct consdev *" instead of a 2003-02-20 20:54:45 +00:00
pccard Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
pccbb o transition from exca_write to exca_putb and read->getb. This is so that 2003-02-14 06:21:51 +00:00
pcf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
pci Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
pcic DETACH_FORCE was removed recently. Remove it here, even though this 2002-11-17 04:52:37 +00:00
pdq Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ppbus Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ppc Restore the original copyright 2002-03-23 15:36:13 +00:00
pst Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
puc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
raidframe Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
random Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ray Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
rc Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
rp Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
sab Change the console interface to pass a "struct consdev *" instead of a 2003-02-20 20:54:45 +00:00
sbni Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
scd Replace {disable,enable}_intr() with critical_{enter,exit}(). 2002-11-10 03:45:49 +00:00
sf Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
si Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
sio Change the console interface to pass a "struct consdev *" instead of a 2003-02-20 20:54:45 +00:00
sk Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
smbus Cleanup of amdpm(4). 2002-09-21 21:43:49 +00:00
sn Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
snc Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
snp Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
sound Clean up viachan_init. 2003-02-21 01:47:59 +00:00
speaker Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
sr Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
stg o Changes to support NEWCARD. 2002-11-28 01:15:01 +00:00
streams Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
sym Consolidate MIN/MAX macros into one place (param.h). 2003-02-02 13:17:30 +00:00
syscons Change the console interface to pass a "struct consdev *" instead of a 2003-02-20 20:54:45 +00:00
tdfx Make use of UID_ROOT, GID_WHEEL for make_dev() arguments. 2002-12-27 16:40:54 +00:00
tga Use UID_ROOT and GID_WHEEL for uid/gid argments to make_dev(). 2002-12-27 16:44:11 +00:00
ti Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
trm Merge diff between rev 1.08 and rev 1.11 of Tekram driver, this notably add 2003-02-20 03:21:34 +00:00
twe Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
tx Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
txp Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
ubsec Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
usb Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fix 2003-02-21 06:19:38 +00:00
vinum Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
vr Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
vx Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
wds - Use %p to print pointers instead of casting pointers to an int and using 2002-11-07 22:25:13 +00:00
wi Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
wl Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
xe Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
zs Change the console interface to pass a "struct consdev *" instead of a 2003-02-20 20:54:45 +00:00