diff options
| author | Kenneth D. Merry <ken@FreeBSD.org> | 2014-05-22 16:36:01 +0000 |
|---|---|---|
| committer | Kenneth D. Merry <ken@FreeBSD.org> | 2014-05-22 16:36:01 +0000 |
| commit | a58655bc08204a04a7f63d1d289b2c7b7ca8191f (patch) | |
| tree | 685579bb846fd63e8f9fb90feba56ed9db67736d /sys/dev | |
| parent | f9040de1191f1f310ba7231d8674602aeea2342c (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mpr/mpr.c | 2 | ||||
| -rw-r--r-- | sys/dev/mpr/mpr_sas.c | 15 | ||||
| -rw-r--r-- | sys/dev/mpr/mpr_sas_lsi.c | 12 | ||||
| -rw-r--r-- | sys/dev/mps/mps_sas.c | 6 |
4 files changed, 24 insertions, 11 deletions
diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index fe187a53c63b..3656eec36864 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2182,8 +2182,6 @@ mpr_add_chain(struct mpr_command *cm, int segsleft) * code other than 0. */ if (cm->cm_flags & MPR_CM_FLAGS_SGE_SIMPLE) { -//SLM-test -printf("Trying to add a chain element to an MPI SGL\n"); mpr_dprint(sc, MPR_ERROR, "A chain element cannot be added to " "an MPI SGL.\n"); return(ENOBUFS); diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index 1a51109c15ee..1f95358c877e 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -183,7 +183,8 @@ mprsas_startup_increment(struct mprsas_softc *sassc) /* just starting, freeze the simq */ mpr_dprint(sassc->sc, MPR_INIT, "%s freezing simq\n", __func__); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_hold_boot(); #endif xpt_freeze_simq(sassc->sim, 1); @@ -217,7 +218,8 @@ mprsas_startup_decrement(struct mprsas_softc *sassc) "%s releasing simq\n", __func__); sassc->flags &= ~MPRSAS_IN_STARTUP; xpt_release_simq(sassc->sim, 1); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_release_boot(); #else mprsas_rescan_target(sassc->sc, NULL); @@ -974,7 +976,8 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb) cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; #else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; @@ -2355,8 +2358,9 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2367,6 +2371,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index cf5be2b26d29..32e9b3a07804 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -801,7 +801,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){ "and connector name (%4s)\n", targ->encl_level, targ->connector_name); } -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); @@ -992,7 +993,8 @@ mprsas_volume_add(struct mpr_softc *sc, u16 handle) free(lun, M_MPR); } SLIST_INIT(&targ->luns); -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); @@ -1026,6 +1028,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) char path_str[64]; struct timeval cur_time, start_time; + mpr_lock(sc); + /* * For each LUN of each target, issue a StartStopUnit command to stop * the device. @@ -1041,6 +1045,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) SLIST_FOREACH(lun, &target->luns, lun_link) { ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { + mpr_unlock(sc); mpr_dprint(sc, MPR_FAULT, "Unable to alloc " "CCB to stop unit.\n"); return; @@ -1057,6 +1062,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) mpr_dprint(sc, MPR_FAULT, "Unable to " "create LUN path to stop unit.\n"); xpt_free_ccb(ccb); + mpr_unlock(sc); return; } xpt_path_string(ccb->ccb_h.path, path_str, @@ -1092,6 +1098,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) } } + mpr_unlock(sc); + /* * Wait until all of the SSU commands have completed or time has * expired (60 seconds). pause for 100ms each time through. If any diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index 29269598f2de..993cbee97be0 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -2305,8 +2305,9 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2317,6 +2318,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; |
