Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mps/mps_sas.c
Show First 20 Lines • Show All 922 Lines • ▼ Show 20 Lines | mpssas_action(struct cam_sim *sim, union ccb *ccb) | ||||
mps_dprint(sassc->sc, MPS_TRACE, "ccb func_code 0x%x\n", | mps_dprint(sassc->sc, MPS_TRACE, "ccb func_code 0x%x\n", | ||||
ccb->ccb_h.func_code); | ccb->ccb_h.func_code); | ||||
mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); | mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); | ||||
switch (ccb->ccb_h.func_code) { | switch (ccb->ccb_h.func_code) { | ||||
case XPT_PATH_INQ: | case XPT_PATH_INQ: | ||||
{ | { | ||||
struct ccb_pathinq *cpi = &ccb->cpi; | struct ccb_pathinq *cpi = &ccb->cpi; | ||||
struct mps_softc *sc = sassc->sc; | |||||
uint8_t sges_per_frame; | |||||
cpi->version_num = 1; | cpi->version_num = 1; | ||||
cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; | cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; | ||||
cpi->target_sprt = 0; | cpi->target_sprt = 0; | ||||
#if __FreeBSD_version >= 1000039 | #if __FreeBSD_version >= 1000039 | ||||
cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; | cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; | ||||
#else | #else | ||||
cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; | cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; | ||||
#endif | #endif | ||||
cpi->hba_eng_cnt = 0; | cpi->hba_eng_cnt = 0; | ||||
cpi->max_target = sassc->maxtargets - 1; | cpi->max_target = sassc->maxtargets - 1; | ||||
cpi->max_lun = 255; | cpi->max_lun = 255; | ||||
cpi->initiator_id = sassc->maxtargets - 1; | cpi->initiator_id = sassc->maxtargets - 1; | ||||
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); | strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); | ||||
strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN); | strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN); | ||||
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | ||||
cpi->unit_number = cam_sim_unit(sim); | cpi->unit_number = cam_sim_unit(sim); | ||||
cpi->bus_id = cam_sim_bus(sim); | cpi->bus_id = cam_sim_bus(sim); | ||||
cpi->base_transfer_speed = 150000; | cpi->base_transfer_speed = 150000; | ||||
cpi->transport = XPORT_SAS; | cpi->transport = XPORT_SAS; | ||||
cpi->transport_version = 0; | cpi->transport_version = 0; | ||||
cpi->protocol = PROTO_SCSI; | cpi->protocol = PROTO_SCSI; | ||||
cpi->protocol_version = SCSI_REV_SPC; | cpi->protocol_version = SCSI_REV_SPC; | ||||
#if __FreeBSD_version >= 800001 | |||||
/* | /* | ||||
* XXX KDM where does this number come from? | * Max IO Size is Page Size * the following: | ||||
* ((SGEs per frame - 1 for chain element) * | |||||
* Max Chain Depth) + 1 for no chain needed in last frame | |||||
* | |||||
* If user suggests a Max IO size to use, use the smaller of the | |||||
* user's value and the calculated value as long as the user's | |||||
* value is larger than 0. The user's value is in pages. | |||||
*/ | */ | ||||
cpi->maxio = 256 * 1024; | sges_per_frame = ((sc->facts->IOCRequestFrameSize * 4) / | ||||
#endif | sizeof(MPI2_SGE_SIMPLE64)) - 1; | ||||
cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; | |||||
cpi->maxio *= PAGE_SIZE; | |||||
if ((sc->max_io_pages > 0) && (sc->max_io_pages * PAGE_SIZE < | |||||
cpi->maxio)) | |||||
cpi->maxio = sc->max_io_pages * PAGE_SIZE; | |||||
mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); | mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); | ||||
break; | break; | ||||
} | } | ||||
case XPT_GET_TRAN_SETTINGS: | case XPT_GET_TRAN_SETTINGS: | ||||
{ | { | ||||
struct ccb_trans_settings *cts; | struct ccb_trans_settings *cts; | ||||
struct ccb_trans_settings_sas *sas; | struct ccb_trans_settings_sas *sas; | ||||
struct ccb_trans_settings_scsi *scsi; | struct ccb_trans_settings_scsi *scsi; | ||||
▲ Show 20 Lines • Show All 2,732 Lines • Show Last 20 Lines |