diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-01-20 05:00:38 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-01-20 05:00:38 +0000 |
commit | b34c77d4039444fe890089e15d7392f4ea4db401 (patch) | |
tree | a5b26fc6233eedbd47460b3d66a6e9622c58767a | |
parent | d8207c1298601d62853e6bc0956f489976c5f350 (diff) | |
download | FreeBSD-src-b34c77d4039444fe890089e15d7392f4ea4db401.zip FreeBSD-src-b34c77d4039444fe890089e15d7392f4ea4db401.tar.gz |
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".
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 7d45204..ba646b2 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -3098,11 +3098,12 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * 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); |