Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_sg.c
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Lines | sgregister(struct cam_periph *periph, void *arg) | ||||
softc->state = SG_STATE_NORMAL; | softc->state = SG_STATE_NORMAL; | ||||
softc->pd_type = SID_TYPE(&cgd->inq_data); | softc->pd_type = SID_TYPE(&cgd->inq_data); | ||||
softc->sg_timeout = SG_DEFAULT_TIMEOUT / SG_DEFAULT_HZ * hz; | softc->sg_timeout = SG_DEFAULT_TIMEOUT / SG_DEFAULT_HZ * hz; | ||||
softc->sg_user_timeout = SG_DEFAULT_TIMEOUT; | softc->sg_user_timeout = SG_DEFAULT_TIMEOUT; | ||||
TAILQ_INIT(&softc->rdwr_done); | TAILQ_INIT(&softc->rdwr_done); | ||||
periph->softc = softc; | periph->softc = softc; | ||||
bzero(&cpi, sizeof(cpi)); | xpt_path_inq(&cpi, periph->path, CAM_PRIORITY_NORMAL); | ||||
xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | |||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
if (cpi.maxio == 0) | if (cpi.maxio == 0) | ||||
softc->maxio = DFLTPHYS; /* traditional default */ | softc->maxio = DFLTPHYS; /* traditional default */ | ||||
else if (cpi.maxio > MAXPHYS) | else if (cpi.maxio > MAXPHYS) | ||||
softc->maxio = MAXPHYS; /* for safety */ | softc->maxio = MAXPHYS; /* for safety */ | ||||
else | else | ||||
softc->maxio = cpi.maxio; /* real value */ | softc->maxio = cpi.maxio; /* real value */ | ||||
▲ Show 20 Lines • Show All 681 Lines • Show Last 20 Lines |