summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-09-30 13:31:37 +0000
committermav <mav@FreeBSD.org>2015-09-30 13:31:37 +0000
commitefed61f85c8d42437b2f71f0e78164039dbf876b (patch)
treef93ec68cb45de7a3c0f34e6d6eb086a29122c036 /sys/cam/cam_periph.c
parent0ed33a9921d09f4a4c791d98ffe797a71936e42a (diff)
downloadFreeBSD-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.c9
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) {
OpenPOWER on IntegriCloud