From 1d70f494bada8c1e50931ebc1f1a0d5e08018985 Mon Sep 17 00:00:00 2001 From: hselasky Date: Thu, 8 Jan 2015 15:10:25 +0000 Subject: 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 --- sys/cam/scsi/scsi_da.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/cam') diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 6c2235f..d5e4937 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); -- cgit v1.1