From owner-p4-projects@FreeBSD.ORG Sat Feb 19 04:17:34 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3121116A4D0; Sat, 19 Feb 2005 04:17:34 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0814E16A4CE for ; Sat, 19 Feb 2005 04:17:34 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C18943D48 for ; Sat, 19 Feb 2005 04:17:33 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j1J4HXW2076346 for ; Sat, 19 Feb 2005 04:17:33 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1J4HWlg076343 for perforce@freebsd.org; Sat, 19 Feb 2005 04:17:32 GMT (envelope-from scottl@freebsd.org) Date: Sat, 19 Feb 2005 04:17:32 GMT Message-Id: <200502190417.j1J4HWlg076343@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Subject: PERFORCE change 71289 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2005 04:17:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=71289 Change 71289 by scottl@scottl-junior on 2005/02/19 04:17:00 Finish integrating cam_xpt.c rev 1.144 and 1.145 Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_probe.c#4 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_probe.c#4 (text+ko) ==== @@ -376,7 +376,18 @@ if (softc->action == PROBE_INQUIRY) inquiry_len = SHORT_INQUIRY_LENGTH; else - inquiry_len = inq_buf->additional_length + 4; + inquiry_len = inq_buf->additional_length + + offsetof(struct scsi_inquiry_data, + additional_length) + 1; + + /* + * Some parallel SCSI devices fail to send an + * ignore wide residue message when dealing with + * odd length inquiry requests. Round up to be + * safe. + */ + inquiry_len = roundup2(inquiry_len, 2); + scsi_inquiry(csio, /*retries*/4, @@ -529,7 +540,7 @@ switch(periph_qual) { case SID_QUAL_LU_CONNECTED: { - u_int8_t alen; + u_int8_t len; /* * We conservatively request only @@ -541,9 +552,11 @@ * the amount of information the device * is willing to give. */ - alen = inq_buf->additional_length; + len = inq_buf->additional_length + + offsetof(struct scsi_inquiry_data, + additional_length) + 1; if (softc->action == PROBE_INQUIRY - && alen > (SHORT_INQUIRY_LENGTH - 4)) { + && len > SHORT_INQUIRY_LENGTH) { softc->action = PROBE_FULL_INQUIRY; xpt_release_ccb(done_ccb); probereschedule(periph, priority);