aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authorKenneth D. Merry <ken@FreeBSD.org>2010-12-10 21:38:51 +0000
committerKenneth D. Merry <ken@FreeBSD.org>2010-12-10 21:38:51 +0000
commit7c103dde1e50ba3732a8d4ef3a4b1fe1708e13bf (patch)
tree16ae5188eba0247928f464c632436c72f8e34e77 /sys/cam/cam_periph.c
parent7cea3d952b7b8ee48d29d0b77e0d29a064593506 (diff)
downloadsrc-7c103dde1e50ba3732a8d4ef3a4b1fe1708e13bf.tar.gz
src-7c103dde1e50ba3732a8d4ef3a4b1fe1708e13bf.zip
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.
Notes
Notes: svn path=/head/; revision=216361
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r--sys/cam/cam_periph.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 14f3beb3c03d..d17253fbb5e0 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -658,10 +658,19 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
numbufs = 2;
break;
case XPT_GDEV_ADVINFO:
+ if (ccb->cgdai.bufsiz == 0)
+ return (0);
+
data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf;
lengths[0] = ccb->cgdai.bufsiz;
dirs[0] = CAM_DIR_IN;
numbufs = 1;
+
+ /*
+ * This request will not go to the hardware, no reason
+ * to be so strict. vmapbuf() is able to map up to MAXPHYS.
+ */
+ maxmap = MAXPHYS;
break;
default:
return(EINVAL);