aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/scsi
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-01-08 15:10:25 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-01-08 15:10:25 +0000
commit68f71fc1809eb7ef51b18f099858de46f4c4c05a (patch)
tree7ac48932a9500ddc61030e3b83888c7c4d67fe52 /sys/cam/scsi
parent5e3cd9e19c294dd532375ec34a92d02add609b8a (diff)
downloadsrc-68f71fc1809eb7ef51b18f099858de46f4c4c05a.tar.gz
src-68f71fc1809eb7ef51b18f099858de46f4c4c05a.zip
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". Reviewed by: mav @ MFC after: 1 week
Notes
Notes: svn path=/head/; revision=276825
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_da.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 6c2235f7a96b..d5e49372576a 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -3094,8 +3094,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if (block_size == 0 && maxsector == 0) {
block_size = 512;
maxsector = -1;
+ } else if (block_size == 0) {
+ block_size = 512;
}
- if (block_size >= MAXPHYS || block_size == 0) {
+ if (block_size >= MAXPHYS) {
xpt_print(periph->path,
"unsupportable block size %ju\n",
(uintmax_t) block_size);