From owner-cvs-all Sat Feb 19 20:42:52 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 71B2337BDA1; Sat, 19 Feb 2000 20:42:45 -0800 (PST) (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA04738; Sat, 19 Feb 2000 20:42:45 -0800 (PST) (envelope-from ken@FreeBSD.org) Message-Id: <200002200442.UAA04738@freefall.freebsd.org> From: Kenneth Merry Date: Sat, 19 Feb 2000 20:42:45 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sbin/camcontrol camcontrol.c src/sys/cam/scsi scsi_all.c scsi_all.h Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk ken 2000/02/19 20:42:45 PST Modified files: sbin/camcontrol camcontrol.c sys/cam/scsi scsi_all.c scsi_all.h Log: 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" Revision Changes Path 1.21 +36 -3 src/sbin/camcontrol/camcontrol.c 1.14 +8 -1 src/sys/cam/scsi/scsi_all.c 1.14 +7 -2 src/sys/cam/scsi/scsi_all.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message