Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_da.c
Show First 20 Lines • Show All 4,873 Lines • ▼ Show 20 Lines | if (error == ERESTART) { | ||||
status = done_ccb->ccb_h.status; | status = done_ccb->ccb_h.status; | ||||
if ((status & CAM_DEV_QFRZN) != 0) | if ((status & CAM_DEV_QFRZN) != 0) | ||||
cam_release_devq(done_ccb->ccb_h.path, | cam_release_devq(done_ccb->ccb_h.path, | ||||
/*relsim_flags*/0, | /*relsim_flags*/0, | ||||
/*reduction*/0, | /*reduction*/0, | ||||
/*timeout*/0, | /*timeout*/0, | ||||
/*getcount_only*/0); | /*getcount_only*/0); | ||||
memset(&cgd, 0, sizeof(cgd)); | |||||
xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, | xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, | ||||
CAM_PRIORITY_NORMAL); | CAM_PRIORITY_NORMAL); | ||||
cgd.ccb_h.func_code = XPT_GDEV_TYPE; | cgd.ccb_h.func_code = XPT_GDEV_TYPE; | ||||
xpt_action((union ccb *)&cgd); | xpt_action((union ccb *)&cgd); | ||||
if (scsi_extract_sense_ccb(done_ccb, | if (scsi_extract_sense_ccb(done_ccb, | ||||
&error_code, &sense_key, &asc, &ascq)) | &error_code, &sense_key, &asc, &ascq)) | ||||
have_sense = TRUE; | have_sense = TRUE; | ||||
▲ Show 20 Lines • Show All 1,230 Lines • ▼ Show 20 Lines | dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, | ||||
/* | /* | ||||
* Have the controller provide us with a geometry | * Have the controller provide us with a geometry | ||||
* for this disk. The only time the geometry | * for this disk. The only time the geometry | ||||
* matters is when we boot and the controller | * matters is when we boot and the controller | ||||
* is the only one knowledgeable enough to come | * is the only one knowledgeable enough to come | ||||
* up with something that will make this a bootable | * up with something that will make this a bootable | ||||
* device. | * device. | ||||
*/ | */ | ||||
memset(&ccg, 0, sizeof(ccg)); | |||||
xpt_setup_ccb(&ccg.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&ccg.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | ||||
ccg.ccb_h.func_code = XPT_CALC_GEOMETRY; | ccg.ccb_h.func_code = XPT_CALC_GEOMETRY; | ||||
ccg.block_size = dp->secsize; | ccg.block_size = dp->secsize; | ||||
ccg.volume_size = dp->sectors; | ccg.volume_size = dp->sectors; | ||||
ccg.heads = 0; | ccg.heads = 0; | ||||
ccg.secs_per_track = 0; | ccg.secs_per_track = 0; | ||||
ccg.cylinders = 0; | ccg.cylinders = 0; | ||||
xpt_action((union ccb*)&ccg); | xpt_action((union ccb*)&ccg); | ||||
Show All 21 Lines | dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, | ||||
* If it's the same, we don't bother. This avoids sending an | * If it's the same, we don't bother. This avoids sending an | ||||
* update every time someone opens this device. | * update every time someone opens this device. | ||||
*/ | */ | ||||
if ((rcaplong != NULL) | if ((rcaplong != NULL) | ||||
&& (bcmp(rcaplong, &softc->rcaplong, | && (bcmp(rcaplong, &softc->rcaplong, | ||||
min(sizeof(softc->rcaplong), rcap_len)) != 0)) { | min(sizeof(softc->rcaplong), rcap_len)) != 0)) { | ||||
struct ccb_dev_advinfo cdai; | struct ccb_dev_advinfo cdai; | ||||
memset(&cdai, 0, sizeof(cdai)); | |||||
xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | ||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | ||||
cdai.buftype = CDAI_TYPE_RCAPLONG; | cdai.buftype = CDAI_TYPE_RCAPLONG; | ||||
cdai.flags = CDAI_FLAG_STORE; | cdai.flags = CDAI_FLAG_STORE; | ||||
cdai.bufsiz = rcap_len; | cdai.bufsiz = rcap_len; | ||||
cdai.buf = (uint8_t *)rcaplong; | cdai.buf = (uint8_t *)rcaplong; | ||||
xpt_action((union ccb *)&cdai); | xpt_action((union ccb *)&cdai); | ||||
if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) | if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |