freebsd-src/sys/cam
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 Fix 'camcontrol inquiry'. The inquiry data structure changes (increased to 2000-02-20 04:42:44 +00:00
cam.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cam.h Add a CAM_SENT_STATUS for use in target mode. JHK approved. 2000-01-17 06:11:33 +00:00
cam_ccb.h Because we added 4 bytes to the inquiry data size, we need to 2000-01-25 21:24:52 +00:00
cam_debug.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_extend.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cam_extend.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_periph.c When autosense fails, make sure we retry the command. 2000-01-25 17:45:02 +00:00
cam_periph.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_queue.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cam_queue.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_sim.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cam_sim.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_xpt.c Redo the SHORT INQUIRY length stuff to be a bit cleaner. 2000-01-25 18:25:22 +00:00
cam_xpt.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_xpt_periph.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_xpt_sim.h Clean up the xpt_sim creation to mirror how HBA drivers perform this task. 2000-01-14 23:08:46 +00:00