Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 2010 21:35:13 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r215773 - stable/8/sys/cam/scsi
Message-ID:  <201011232135.oANLZD92044733@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Nov 23 21:35:13 2010
New Revision: 215773
URL: http://svn.freebsd.org/changeset/base/215773

Log:
  MFC r214288:
  Make da driver to handle some probably broken Android devices, returning
  zero media and sector size instead of "Medium not present" error,
  until some confirmation button is tapped on device.

Modified:
  stable/8/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_da.c	Tue Nov 23 21:29:40 2010	(r215772)
+++ stable/8/sys/cam/scsi/scsi_da.c	Tue Nov 23 21:35:13 2010	(r215773)
@@ -1631,7 +1631,10 @@ dadone(struct cam_periph *periph, union 
 			 * give them an 'illegal' value we'll avoid that
 			 * here.
 			 */
-			if (block_size >= MAXPHYS || block_size == 0) {
+			if (block_size == 0 && maxsector == 0) {
+				snprintf(announce_buf, sizeof(announce_buf),
+				        "0MB (no media?)");
+			} else if (block_size >= MAXPHYS || block_size == 0) {
 				xpt_print(periph->path,
 				    "unsupportable block size %ju\n",
 				    (uintmax_t) block_size);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011232135.oANLZD92044733>