summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-05 11:45:28 +0000
committermav <mav@FreeBSD.org>2015-10-05 11:45:28 +0000
commit5ee28f32f3fc011b1e2bc325023cb3d5f52e8781 (patch)
treeb9dd2357559de069f6089b3fa0d7767edff4de57 /sys/cam/cam_periph.c
parent9bfaae3f56e02aaea2d1363f3a19c66e506632e3 (diff)
downloadFreeBSD-src-5ee28f32f3fc011b1e2bc325023cb3d5f52e8781.zip
FreeBSD-src-5ee28f32f3fc011b1e2bc325023cb3d5f52e8781.tar.gz
MFC r288420: 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 53454f8..625be21 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