Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_enc_ses.c
Show First 20 Lines • Show All 968 Lines • ▼ Show 20 Lines | if (addl->proto_hdr.ata != NULL) { | ||||
struct ccb_getdev cgd; | struct ccb_getdev cgd; | ||||
if (xpt_create_path(&path, /*periph*/NULL, | if (xpt_create_path(&path, /*periph*/NULL, | ||||
scsi_4btoul(addl->proto_hdr.ata->bus), | scsi_4btoul(addl->proto_hdr.ata->bus), | ||||
scsi_4btoul(addl->proto_hdr.ata->target), 0) | scsi_4btoul(addl->proto_hdr.ata->target), 0) | ||||
!= CAM_REQ_CMP) | != CAM_REQ_CMP) | ||||
return; | return; | ||||
memset(&cgd, 0, sizeof(cgd)); | |||||
xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cgd.ccb_h, path, 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 (cgd.ccb_h.status == CAM_REQ_CMP) | if (cgd.ccb_h.status == CAM_REQ_CMP) | ||||
callback(enc, elm, path, callback_arg); | callback(enc, elm, path, callback_arg); | ||||
xpt_free_path(path); | xpt_free_path(path); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct ccb_dev_advinfo cdai; | struct ccb_dev_advinfo cdai; | ||||
ses_setphyspath_callback_args_t *args; | ses_setphyspath_callback_args_t *args; | ||||
char *old_physpath; | char *old_physpath; | ||||
args = (ses_setphyspath_callback_args_t *)arg; | args = (ses_setphyspath_callback_args_t *)arg; | ||||
old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); | old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); | ||||
xpt_path_lock(path); | xpt_path_lock(path); | ||||
memset(&cdai, 0, sizeof(cdai)); | |||||
xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); | ||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | ||||
cdai.buftype = CDAI_TYPE_PHYS_PATH; | cdai.buftype = CDAI_TYPE_PHYS_PATH; | ||||
cdai.flags = CDAI_FLAG_NONE; | cdai.flags = CDAI_FLAG_NONE; | ||||
cdai.bufsiz = MAXPATHLEN; | cdai.bufsiz = MAXPATHLEN; | ||||
cdai.buf = old_physpath; | cdai.buf = old_physpath; | ||||
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 44 Lines • ▼ Show 20 Lines | ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, | ||||
elmpriv = elm->elm_private; | elmpriv = elm->elm_private; | ||||
if (elmpriv->addl.hdr == NULL) | if (elmpriv->addl.hdr == NULL) | ||||
goto out; | goto out; | ||||
/* | /* | ||||
* Assemble the components of the physical path starting with | * Assemble the components of the physical path starting with | ||||
* the device ID of the enclosure itself. | * the device ID of the enclosure itself. | ||||
*/ | */ | ||||
memset(&cdai, 0, sizeof(cdai)); | |||||
xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); | ||||
cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | cdai.ccb_h.func_code = XPT_DEV_ADVINFO; | ||||
cdai.flags = CDAI_FLAG_NONE; | cdai.flags = CDAI_FLAG_NONE; | ||||
cdai.buftype = CDAI_TYPE_SCSI_DEVID; | cdai.buftype = CDAI_TYPE_SCSI_DEVID; | ||||
cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; | cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; | ||||
cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO); | cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO); | ||||
cam_periph_lock(enc->periph); | cam_periph_lock(enc->periph); | ||||
xpt_action((union ccb *)&cdai); | xpt_action((union ccb *)&cdai); | ||||
▲ Show 20 Lines • Show All 1,941 Lines • Show Last 20 Lines |