summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi/scsi_pass.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/scsi/scsi_pass.c')
-rw-r--r--sys/cam/scsi/scsi_pass.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 158e90f..174151e 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -77,6 +77,7 @@ struct pass_softc {
u_int8_t pd_type;
union ccb saved_ccb;
int open_count;
+ u_int maxio;
struct devstat *device_stats;
struct cdev *dev;
struct cdev *alias_dev;
@@ -366,6 +367,13 @@ passregister(struct cam_periph *periph, void *arg)
cpi.ccb_h.func_code = XPT_PATH_INQ;
xpt_action((union ccb *)&cpi);
+ if (cpi.maxio == 0)
+ softc->maxio = DFLTPHYS; /* traditional default */
+ else if (cpi.maxio > MAXPHYS)
+ softc->maxio = MAXPHYS; /* for safety */
+ else
+ softc->maxio = cpi.maxio; /* real value */
+
/*
* We pass in 0 for a blocksize, since we don't
* know what the blocksize of this device is, if
@@ -659,7 +667,7 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
* Dropping it here is reasonably safe.
*/
cam_periph_unlock(periph);
- error = cam_periph_mapmem(ccb, &mapinfo);
+ error = cam_periph_mapmem(ccb, &mapinfo, softc->maxio);
cam_periph_lock(periph);
/*
OpenPOWER on IntegriCloud