diff options
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/cam_ccb.h | 1 | ||||
-rw-r--r-- | sys/cam/cam_xpt.c | 23 |
2 files changed, 15 insertions, 9 deletions
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 04ed592..4012068 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -571,6 +571,7 @@ typedef enum { PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */ PIM_SEQSCAN = 0x04, /* Do bus scans sequentially, not in parallel */ PIM_UNMAPPED = 0x02, + PIM_NOSCAN = 0x01 /* SIM does its own scanning */ } pi_miscflag; /* Path Inquiry CCB */ diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8f2c93e..aac1be2 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3895,18 +3895,23 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) /* Notify interested parties */ if (sim->path_id != CAM_XPT_PATH_ID) { - union ccb *scan_ccb; xpt_async(AC_PATH_REGISTERED, path, &cpi); - /* Initiate bus rescan. */ - scan_ccb = xpt_alloc_ccb_nowait(); - if (scan_ccb != NULL) { - scan_ccb->ccb_h.path = path; - scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; - scan_ccb->crcn.flags = 0; - xpt_rescan(scan_ccb); + if ((cpi.hba_misc & PIM_NOSCAN) == 0) { + union ccb *scan_ccb; + + /* Initiate bus rescan. */ + scan_ccb = xpt_alloc_ccb_nowait(); + if (scan_ccb != NULL) { + scan_ccb->ccb_h.path = path; + scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; + scan_ccb->crcn.flags = 0; + xpt_rescan(scan_ccb); + } else + xpt_print(path, + "Can't allocate CCB to scan bus\n"); } else - xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); } else xpt_free_path(path); return (CAM_SUCCESS); |