freebsd-dev/sys/cam/scsi
Kenneth D. Merry 955f7e7474 Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to
256 bytes) caused it to break on many devices.

The SCSI spec says that for commands with 8-bit length fields, a value of 0
means 256 bytes.  As it turns out, many devices don't deal with that
properly.  Some interpret the 0 as 0, and return no data.  Others return
more than 256 bytes of data, and cause an overrun.

The fix is to tell the device we've only allocated SHORT_INQUIRY_LENGTH (36
bytes) of inquiry data, instead of sizeof(struct scsi_inquiry_data).

camcontrol.c:		Change inq_len in the call to scsi_inquiry() to
			SHORT_INQUIRY_LENGTH, and add a long comment
			explaining the reason for the change.

scsi_all.h:		Add a comment above the definitinon of
			SHORT_INQUIRY_LENGTH alerting people that it is
			both the initial probe inquiry length, and the
			minimum amount of data needed for scsi_print_inquiry()
			to function.

scsi_all.c:		Add a comment about SHORT_INQUIRY_LENGTH being the
			minimum amount of data needed for
			scsi_print_inquiry() to function.

Reviewed by:	gibbs
Approved by:	jkh
Reported by:	"John W. DeBoskey" <jwd@unx.sas.com>
2000-02-20 04:42:44 +00:00
..
scsi_all.c Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to 2000-02-20 04:42:44 +00:00
scsi_all.h Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to 2000-02-20 04:42:44 +00:00
scsi_cd.c Do the minor changes needed because of change to ccb_getdev structure. 2000-01-17 06:27:37 +00:00
scsi_cd.h Some fixes to the CD driver that may fix PR kern/7996. The data direction 1998-09-20 22:48:15 +00:00
scsi_ch.c Do the minor changes needed because of change to ccb_getdev structure. 2000-01-17 06:27:37 +00:00
scsi_ch.h Correct the definition of the changer device capabilities page. The 1998-12-17 22:26:39 +00:00
scsi_da.c Do the minor changes needed because of change to ccb_getdev structure. 2000-01-17 06:27:37 +00:00
scsi_da.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
scsi_message.h SCSI Peripheral drivers for CAM: 1998-09-15 06:36:34 +00:00
scsi_pass.c Do the minor changes needed because of change to ccb_getdev structure. 2000-01-17 06:27:37 +00:00
scsi_pass.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
scsi_pt.c Do the minor changes needed because of change to ccb_getdev structure. 2000-01-17 06:27:37 +00:00
scsi_pt.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
scsi_sa.c Add a quirk type (and one for ARCHIVE Python's) that disables the 2000-02-03 18:29:25 +00:00
scsi_sa.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
scsi_ses.c Clean up some of the SAF-TE matching code. Add 2000-01-21 21:14:42 +00:00
scsi_ses.h Move the kernel specific stuff into scsi_ses.c. Redo the ioctls 2000-01-15 22:40:04 +00:00
scsi_targ_bh.c Propagate sense data through from SIM (if there) and mark the CTIO 2000-01-25 17:39:09 +00:00
scsi_target.c Propagate sense data through from SIM (if there) and mark the CTIO 2000-01-25 17:42:27 +00:00
scsi_targetio.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00