diff options
author | mav <mav@FreeBSD.org> | 2015-09-30 13:31:37 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-09-30 13:31:37 +0000 |
commit | efed61f85c8d42437b2f71f0e78164039dbf876b (patch) | |
tree | f93ec68cb45de7a3c0f34e6d6eb086a29122c036 /sys/cam/cam_periph.c | |
parent | 0ed33a9921d09f4a4c791d98ffe797a71936e42a (diff) | |
download | FreeBSD-src-efed61f85c8d42437b2f71f0e78164039dbf876b.zip FreeBSD-src-efed61f85c8d42437b2f71f0e78164039dbf876b.tar.gz |
Make pass, sg and targ drivers respect HBA's maxio.
Previous limitation of 64K (DFLTPHYS) is quite annoying.
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 956e5d0..91cb45d 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -716,16 +716,19 @@ camperiphfree(struct cam_periph *periph) * buffers to map stuff in and out, we're limited to the buffer size. */ int -cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) +cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo, + u_int maxmap) { int numbufs, i, j; int flags[CAM_PERIPH_MAXMAPS]; u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; u_int32_t lengths[CAM_PERIPH_MAXMAPS]; u_int32_t dirs[CAM_PERIPH_MAXMAPS]; - /* Some controllers may not be able to handle more data. */ - size_t maxmap = DFLTPHYS; + if (maxmap == 0) + maxmap = DFLTPHYS; /* traditional default */ + else if (maxmap > MAXPHYS) + maxmap = MAXPHYS; /* for safety */ switch(ccb->ccb_h.func_code) { case XPT_DEV_MATCH: if (ccb->cdm.match_buf_len == 0) { |