summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-01-08 15:10:25 +0000
committerhselasky <hselasky@FreeBSD.org>2015-01-08 15:10:25 +0000
commit1d70f494bada8c1e50931ebc1f1a0d5e08018985 (patch)
tree7ac48932a9500ddc61030e3b83888c7c4d67fe52 /sys/cam
parent51aafa4f2b795bc41e545b776205d9b1d3d0d874 (diff)
downloadFreeBSD-src-1d70f494bada8c1e50931ebc1f1a0d5e08018985.zip
FreeBSD-src-1d70f494bada8c1e50931ebc1f1a0d5e08018985.tar.gz
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
Diffstat (limited to 'sys/cam')
-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 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);
OpenPOWER on IntegriCloud