Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mpr/mpr_sas.c
Show First 20 Lines • Show All 2,041 Lines • ▼ Show 20 Lines | mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb) | ||||
if (sc->eedp_enabled && eedp_flags) { | if (sc->eedp_enabled && eedp_flags) { | ||||
SLIST_FOREACH(lun, &targ->luns, lun_link) { | SLIST_FOREACH(lun, &targ->luns, lun_link) { | ||||
if (lun->lun_id == csio->ccb_h.target_lun) { | if (lun->lun_id == csio->ccb_h.target_lun) { | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if ((lun != NULL) && (lun->eedp_formatted)) { | if ((lun != NULL) && (lun->eedp_formatted)) { | ||||
req->EEDPBlockSize = htole16(lun->eedp_block_size); | req->EEDPBlockSize = htole32(lun->eedp_block_size); | ||||
eedp_flags |= (MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | | eedp_flags |= (MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | | ||||
MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | | MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | | ||||
MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD); | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD); | ||||
if (sc->mpr_flags & MPR_FLAGS_GEN35_IOC) { | if (sc->mpr_flags & MPR_FLAGS_GEN35_IOC) { | ||||
eedp_flags |= | eedp_flags |= | ||||
MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE; | MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE; | ||||
} | } | ||||
req->EEDPFlags = htole16(eedp_flags); | req->EEDPFlags = htole16(eedp_flags); | ||||
▲ Show 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) | ||||
struct scsi_vpd_supported_page_list *vpd_list = NULL; | struct scsi_vpd_supported_page_list *vpd_list = NULL; | ||||
u8 *TLR_bits, TLR_on, *scsi_cdb; | u8 *TLR_bits, TLR_on, *scsi_cdb; | ||||
int dir = 0, i; | int dir = 0, i; | ||||
u16 alloc_len; | u16 alloc_len; | ||||
struct mprsas_target *target; | struct mprsas_target *target; | ||||
target_id_t target_id; | target_id_t target_id; | ||||
MPR_FUNCTRACE(sc); | MPR_FUNCTRACE(sc); | ||||
mpr_dprint(sc, MPR_TRACE, | |||||
"cm %p SMID %u ccb %p reply %p outstanding %u\n", cm, | |||||
cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, | |||||
cm->cm_targ->outstanding); | |||||
callout_stop(&cm->cm_callout); | callout_stop(&cm->cm_callout); | ||||
mtx_assert(&sc->mpr_mtx, MA_OWNED); | mtx_assert(&sc->mpr_mtx, MA_OWNED); | ||||
sassc = sc->sassc; | sassc = sc->sassc; | ||||
ccb = cm->cm_complete_data; | ccb = cm->cm_complete_data; | ||||
csio = &ccb->csio; | csio = &ccb->csio; | ||||
target_id = csio->ccb_h.target_id; | target_id = csio->ccb_h.target_id; | ||||
rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; | rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply; | ||||
mpr_dprint(sc, MPR_TRACE, | |||||
"cm %p SMID %u ccb %p reply %p outstanding %u csio->scsi_status 0x%x," | |||||
"csio->dxfer_len 0x%x, csio->msg_le 0x%xn\n", cm, | |||||
cm->cm_desc.Default.SMID, cm->cm_ccb, cm->cm_reply, | |||||
cm->cm_targ->outstanding, csio->scsi_status, | |||||
csio->dxfer_len, csio->msg_len); | |||||
/* | /* | ||||
* XXX KDM if the chain allocation fails, does it matter if we do | * XXX KDM if the chain allocation fails, does it matter if we do | ||||
* the sync and unload here? It is simpler to do it in every case, | * the sync and unload here? It is simpler to do it in every case, | ||||
* assuming it doesn't cause problems. | * assuming it doesn't cause problems. | ||||
*/ | */ | ||||
if (cm->cm_data != NULL) { | if (cm->cm_data != NULL) { | ||||
if (cm->cm_flags & MPR_CM_FLAGS_DATAIN) | if (cm->cm_flags & MPR_CM_FLAGS_DATAIN) | ||||
dir = BUS_DMASYNC_POSTREAD; | dir = BUS_DMASYNC_POSTREAD; | ||||
▲ Show 20 Lines • Show All 1,056 Lines • ▼ Show 20 Lines | mprsas_portenable_complete(struct mpr_softc *sc, struct mpr_command *cm) | ||||
if ((cm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) { | if ((cm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) { | ||||
mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for port enable! " | mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for port enable! " | ||||
"This should not happen!\n", __func__, cm->cm_flags); | "This should not happen!\n", __func__, cm->cm_flags); | ||||
} | } | ||||
reply = (MPI2_PORT_ENABLE_REPLY *)cm->cm_reply; | reply = (MPI2_PORT_ENABLE_REPLY *)cm->cm_reply; | ||||
if (reply == NULL) | if (reply == NULL) | ||||
mpr_dprint(sc, MPR_FAULT, "Portenable NULL reply\n"); | mpr_dprint(sc, MPR_FAULT, "Portenable NULL reply\n"); | ||||
else if (le16toh(reply->IOCStatus & MPI2_IOCSTATUS_MASK) != | else if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != | ||||
MPI2_IOCSTATUS_SUCCESS) | MPI2_IOCSTATUS_SUCCESS) | ||||
mpr_dprint(sc, MPR_FAULT, "Portenable failed\n"); | mpr_dprint(sc, MPR_FAULT, "Portenable failed\n"); | ||||
mpr_free_command(sc, cm); | mpr_free_command(sc, cm); | ||||
/* | /* | ||||
* Done waiting for port enable to complete. Decrement the refcount. | * Done waiting for port enable to complete. Decrement the refcount. | ||||
* If refcount is 0, discovery is complete and a rescan of the bus can | * If refcount is 0, discovery is complete and a rescan of the bus can | ||||
* take place. | * take place. | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |