freebsd-dev/sys/cam/scsi
Kenneth D. Merry 585f796613 Fix a problem with READ ELEMENT STATUS that occurs on some
changers that don't support the DVCID and CURDATA bits that were
introduced in the SMC spec.

These changers will return an Illegal Request type error if the
bits are set.  This causes "chio status" to fail.

The fix is two-fold.  First, for changers that claim to be SCSI-2
or older, don't set the DVCID and CURDATA bits for READ ELEMENT
STATUS.  For newer changers (SCSI-3 and newer), we default to
setting the new bits, but back off and try the READ ELEMENT STATUS
without the bits if we get an Illegal Request type error.

This has been tested on a Qualstar TLS-8211, which is a SCSI-2
changer that does not support the new bits, and a Spectra T-380,
which is a SCSI-3 changer that does support the new bits.  In the
absence of a SCSI-3 changer that does not support the bits, I
tested that with some error injection code.  (The SMC spec says
that support for CURDATA is mandatory, and DVCID is optional.)

scsi_ch.c:	Add a new quirk, CH_Q_NO_DVCID that gets set for
		SCSI-2 and older libraries, or newer libraries that
		report errors when the DVCID/CURDATA bits are set.

		In chgetelemstatus(), use the new quirk to
		determine whether or not to set DVCID and CURDATA.
		If we get an error with the bits set, back off and
		try without the bits.  Set the quirk flag if the
		read element status succeeds without the bits set.

		Increase the READ ELEMENT STATUS timeout to 60
		seconds after testing with a Spectra T-380.  The
		previous value was 10 seconds, and too short for
		the T-380.  This may be decreased later after
		some additional testing and investigation.

Tested by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
Sponsored by:	Spectra Logic
MFC after:	3 days
2013-07-12 17:09:50 +00:00
..
scsi_all.c Fix some UTF-8 chars slipped into r252204 via copy/paste. 2013-06-26 09:56:33 +00:00
scsi_all.h Corrected ATA Passthrough defines from decimal to hex 2013-06-20 21:38:08 +00:00
scsi_cd.c Added output of device QUIRKS for CAM and AHCI devices during boot. 2013-05-18 23:36:21 +00:00
scsi_cd.h
scsi_ch.c Fix a problem with READ ELEMENT STATUS that occurs on some 2013-07-12 17:09:50 +00:00
scsi_ch.h Update chio(1) and ch(4) to support reporting element designators. 2013-04-19 20:03:51 +00:00
scsi_da.c Refactor the various delete methods out of dastart(). Cleans up a bunch 2013-07-12 00:50:25 +00:00
scsi_da.h Change 'camcontrol defects' to first probe a drive to find out how much 2012-06-22 18:57:06 +00:00
scsi_dvcfg.h
scsi_enc_internal.h Fix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4) 2012-12-08 04:03:04 +00:00
scsi_enc_safte.c 1. Remove SEN support. I doubt there are any working examples 2012-08-12 17:01:07 +00:00
scsi_enc_ses.c Make CAM return and GEOM DISK pass through new GEOM::lunid attribute. 2013-06-12 13:36:20 +00:00
scsi_enc.c Fix a device departure bug for the the pass(4), enc(4), sg(4) and ch(4) 2012-12-08 04:03:04 +00:00
scsi_enc.h MFprojects/zfsd: 2012-05-24 14:07:44 +00:00
scsi_iu.h
scsi_low.c Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
scsi_low.h Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
scsi_message.h
scsi_pass.c Add infrastructure for doing compatibility shims, as has been sorely 2013-06-17 08:57:09 +00:00
scsi_pass.h
scsi_pt.c Fxi a bunch of typos. 2013-05-10 16:41:26 +00:00
scsi_pt.h
scsi_sa.c Added output of device QUIRKS for CAM and AHCI devices during boot. 2013-05-18 23:36:21 +00:00
scsi_sa.h
scsi_ses.h Fix off by one error in ses_enc_desc_last_byte(). 2012-07-24 13:32:49 +00:00
scsi_sg.c Simplify the checking of flags for cam_periph_mapmem(). This gets rid of 2013-06-07 00:22:38 +00:00
scsi_sg.h
scsi_targ_bh.c Add the CAM Target Layer (CTL). 2012-01-12 00:34:33 +00:00
scsi_target.c Simplify the checking of flags for cam_periph_mapmem(). This gets rid of 2013-06-07 00:22:38 +00:00
scsi_targetio.h
scsi_xpt.c Introduce accessors for the ccb status word. Convert one (of many more) 2013-06-29 17:48:59 +00:00
smp_all.c Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00
smp_all.h Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00