From owner-svn-src-all@FreeBSD.ORG Tue Jan 20 05:02:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6165A227; Tue, 20 Jan 2015 05:02:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4481000; Tue, 20 Jan 2015 05:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0K52abj076311; Tue, 20 Jan 2015 05:02:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0K52a2B076310; Tue, 20 Jan 2015 05:02:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501200502.t0K52a2B076310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Jan 2015 05:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r277408 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 05:02:36 -0000 Author: hselasky Date: Tue Jan 20 05:02:35 2015 New Revision: 277408 URL: https://svnweb.freebsd.org/changeset/base/277408 Log: MFC r276825 and r277372: Allow a block size of zero to mean 512 bytes, which is the most common block size for USB disks. This fixes support for "Action Cam SJ4000". Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Jan 20 05:00:38 2015 (r277407) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Jan 20 05:02:35 2015 (r277408) @@ -3089,11 +3089,12 @@ dadone(struct cam_periph *periph, union * give them an 'illegal' value we'll avoid that * here. */ - if (block_size == 0 && maxsector == 0) { + if (block_size == 0) { block_size = 512; - maxsector = -1; + if (maxsector == 0) + maxsector = -1; } - if (block_size >= MAXPHYS || block_size == 0) { + if (block_size >= MAXPHYS) { xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size);