diff options
author | ken <ken@FreeBSD.org> | 2010-12-10 21:38:51 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 2010-12-10 21:38:51 +0000 |
commit | ff1d787db7946285069059143079c2906cf1725e (patch) | |
tree | 16ae5188eba0247928f464c632436c72f8e34e77 /sys/cam/scsi | |
parent | 3e590c80dd031994516eb3aacfd132e53a5de7ba (diff) | |
download | FreeBSD-src-ff1d787db7946285069059143079c2906cf1725e.zip FreeBSD-src-ff1d787db7946285069059143079c2906cf1725e.tar.gz |
Fix a few issues related to the XPT_GDEV_ADVINFO CCB.
camcontrol.c: In buildbusdevlist(), don't attempt to get call
getdevid() for an unconfigured device, even when the
verbose flag is set. The cam_open_btl() call will almost
certainly fail.
Probe for the buffer size when issuing the XPT_GDEV_ADVINFO
CCB. Probing for the buffer size first helps us avoid
allocating the maximum buffer size when it really may not
be necessary. This also helps avoid errors from
cam_periph_mapmem() if we attempt to map more than MAXPHYS.
cam_periph.c: In cam_periph_mapmem(), if the XPT_GDEV_ADVINFO CCB
shows a bufsiz of 0, we don't have anything to map,
so just return.
Also, set the maximum mapping size to MAXPHYS
instead of DFLTPHYS for XPT_GDEV_ADVINFO CCBs,
since they don't actually go down to the hardware.
scsi_pass.c: Don't bother mapping the buffer in XPT_GDEV_ADVINFO
CCBs if bufsiz is 0.
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_pass.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index 00cf61f..2941136 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -525,9 +525,9 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb) * if they haven't passed in a physical memory pointer, * and if there is actually an I/O operation to perform. * cam_periph_mapmem() supports SCSI, ATA, SMP, ADVINFO and device - * match CCBs. For the SCSI and ATA CCBs, we only pass the CCB in if - * there's actually data to map. cam_periph_mapmem() will do the - * right thing, even if there isn't data to map, but since CCBs + * match CCBs. For the SCSI, ATA and ADVINFO CCBs, we only pass the + * CCB in if there's actually data to map. cam_periph_mapmem() will + * do the right thing, even if there isn't data to map, but since CCBs * without data are a reasonably common occurance (e.g. test unit * ready), it will save a few cycles if we check for it here. */ @@ -537,7 +537,8 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb) && ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)) || (ccb->ccb_h.func_code == XPT_DEV_MATCH) || (ccb->ccb_h.func_code == XPT_SMP_IO) - || (ccb->ccb_h.func_code == XPT_GDEV_ADVINFO))) { + || ((ccb->ccb_h.func_code == XPT_GDEV_ADVINFO) + && (ccb->cgdai.bufsiz > 0)))) { bzero(&mapinfo, sizeof(mapinfo)); |