cvs commit: src/sys/cam/scsi scsi_all.c scsi_all.h scsi_cd.c scsi_cd.h scsi_da.c src/sys/dev/ata atapi-cam.c

Kenneth D. Merry ken at
Sat Aug 23 20:26:39 PDT 2003

ken         2003/08/23 20:26:38 PDT

  FreeBSD src repository

  Modified files:        (Branch: RELENG_4)
    sys/cam/scsi         scsi_all.c scsi_all.h scsi_cd.c scsi_cd.h 
    sys/dev/ata          atapi-cam.c 
  MFC:  Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully
  fix a number of related problems along the way.
  Files/revisions merged:
  scsi_cd.c:      1.72, 1.77, 1.80
  scsi_all.c:     1.39 (partial)
  scsi_all.h:     1.22
  scsi_cd.h:      1.7
  scsi_da.c:      1.139
  atapi-cam.c:    1.13
  not merged:     umass.c rev 1.76 (doesn't apply to -stable)
  Because of the differences between -current and -stable, some of these
  changes are not identical to the ones in -current.
  Most notably, cd(4) in -stable uses the slice code, whereas cd(4) in
  -current has no disklabel support at all.  So there is extra code in the
  -stable version of these patches to handle that.
   - 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 in ATAPICAM, since
     there's no way for that to work properly.
   - Merge support for sending a path inquiry CCB to see if the SIM has set
     the PIM_NO_6_BYTE flag. (scsi_cd.c rev 1.80)
   - 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 at  This is to make sure that we fully understand why
     each quirk is needed.  In most cases, the PIM_NO_6_BYTE flag set by the
     SIM driver should eliminate the need for a quirk.
   - 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)
   - 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.  For
     -stable, open() will still fail if there is no media in the drive.  This
     is because of issues with the slice code handling media changing
     underneath it.  If bde and I can get those issues worked out, there is
     basic code in this set of patches to handle allowing the CDIOCCLOSE and
     CDIOCEJECT ioctls without media in the drive.
   - 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.
  Approved by:    re
  Revision   Changes     Path  +28 -2      src/sys/cam/scsi/scsi_all.c   +17 -0      src/sys/cam/scsi/scsi_all.h  +1117 -378  src/sys/cam/scsi/scsi_cd.c    +54 -31     src/sys/cam/scsi/scsi_cd.h  +94 -8      src/sys/cam/scsi/scsi_da.c   +0 -30      src/sys/dev/ata/atapi-cam.c

More information about the cvs-src mailing list