diff options
author | sbruno <sbruno@FreeBSD.org> | 2014-07-21 20:08:53 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2014-07-21 20:08:53 +0000 |
commit | 8f6eb3fcf84d124e0864d1e918865ec9fd8b6f82 (patch) | |
tree | 0565314ea5ee2460be9f7690781d8e7de0833774 /sys/dev/ciss/ciss.c | |
parent | e6b48465b7c368666e10a2bd8f4f500483497b24 (diff) | |
download | FreeBSD-src-8f6eb3fcf84d124e0864d1e918865ec9fd8b6f82.zip FreeBSD-src-8f6eb3fcf84d124e0864d1e918865ec9fd8b6f82.tar.gz |
MFC r268017 and r268018
268017:
Check return of cam_periph_find() before using it in a printf.
268018:
Add detection for ciss(4) controllers that are set to non-raid JBOD mode.
Diffstat (limited to 'sys/dev/ciss/ciss.c')
-rw-r--r-- | sys/dev/ciss/ciss.c | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index c8dee70..5240051 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -1220,7 +1220,7 @@ ciss_identify_adapter(struct ciss_softc *sc) } /* sanity-check reply */ - if (!sc->ciss_id->big_map_supported) { + if (!(sc->ciss_id->controller_flags & CONTROLLER_FLAGS_BIG_MAP_SUPPORT)) { ciss_printf(sc, "adapter does not support BIG_MAP\n"); error = ENXIO; goto out; @@ -1250,7 +1250,7 @@ ciss_identify_adapter(struct ciss_softc *sc) sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); - ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); + ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_chip_count); ciss_printf(sc, " signature '%.4s'\n", sc->ciss_cfg->signature); ciss_printf(sc, " valence %d\n", sc->ciss_cfg->valence); @@ -1274,6 +1274,10 @@ ciss_identify_adapter(struct ciss_softc *sc) ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); + ciss_printf(sc, " JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ? + "Available" : "Unavailable"); + ciss_printf(sc, " JBOD Mode is %s\n", (sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED) ? + "Enabled" : "Disabled"); } out: @@ -3387,25 +3391,28 @@ ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio) bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path)); /* - * Don't let hard drives be seen by the DA driver. They will still be - * attached by the PASS driver. + * If the controller is in JBOD mode, there are no logical volumes. + * Let the disks be probed and dealt with via CAM. Else, mask off + * the physical disks and setup the parts of the inq structure for + * the logical volume. swb */ - if (CISS_IS_PHYSICAL(bus)) { - if (SID_TYPE(inq) == T_DIRECT) - inq->device = (inq->device & 0xe0) | T_NODEVICE; - return; + if( !(sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED)){ + if (CISS_IS_PHYSICAL(bus)) { + if (SID_TYPE(inq) == T_DIRECT) + inq->device = (inq->device & 0xe0) | T_NODEVICE; + return; + } + cl = &sc->ciss_logical[bus][target]; + + padstr(inq->vendor, "HP", + SID_VENDOR_SIZE); + padstr(inq->product, + ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), + SID_PRODUCT_SIZE); + padstr(inq->revision, + ciss_name_ldrive_status(cl->cl_lstatus->status), + SID_REVISION_SIZE); } - - cl = &sc->ciss_logical[bus][target]; - - padstr(inq->vendor, "HP", - SID_VENDOR_SIZE); - padstr(inq->product, - ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), - SID_PRODUCT_SIZE); - padstr(inq->revision, - ciss_name_ldrive_status(cl->cl_lstatus->status), - SID_REVISION_SIZE); } } @@ -3429,13 +3436,17 @@ ciss_name_device(struct ciss_softc *sc, int bus, int target) target, 0); if (status == CAM_REQ_CMP) { + mtx_lock(&sc->ciss_mtx); xpt_path_lock(path); periph = cam_periph_find(path, NULL); - sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", - periph->periph_name, periph->unit_number); xpt_path_unlock(path); + mtx_unlock(&sc->ciss_mtx); xpt_free_path(path); - return(0); + if (periph != NULL) { + sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", + periph->periph_name, periph->unit_number); + return(0); + } } sc->ciss_logical[bus][target].cl_name[0] = 0; return(ENOENT); |