Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_target.c
Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | targenable(struct targ_softc *softc, struct cam_path *path, int grp6_len, | ||||
struct cam_periph *periph; | struct cam_periph *periph; | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
cam_status status; | cam_status status; | ||||
if ((softc->state & TARG_STATE_LUN_ENABLED) != 0) | if ((softc->state & TARG_STATE_LUN_ENABLED) != 0) | ||||
return (CAM_LUN_ALRDY_ENA); | return (CAM_LUN_ALRDY_ENA); | ||||
/* Make sure SIM supports target mode */ | /* Make sure SIM supports target mode */ | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_path_inq(&cpi, path, CAM_PRIORITY_NORMAL); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
status = cpi.ccb_h.status & CAM_STATUS_MASK; | status = cpi.ccb_h.status & CAM_STATUS_MASK; | ||||
if (status != CAM_REQ_CMP) { | if (status != CAM_REQ_CMP) { | ||||
printf("pathinq failed, status %#x\n", status); | printf("pathinq failed, status %#x\n", status); | ||||
goto enable_fail; | goto enable_fail; | ||||
} | } | ||||
if ((cpi.target_sprt & PIT_PROCESSOR) == 0) { | if ((cpi.target_sprt & PIT_PROCESSOR) == 0) { | ||||
printf("controller does not support target mode\n"); | printf("controller does not support target mode\n"); | ||||
status = CAM_FUNC_NOTAVAIL; | status = CAM_FUNC_NOTAVAIL; | ||||
▲ Show 20 Lines • Show All 757 Lines • Show Last 20 Lines |