Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/nvme/nvme_xpt.c
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
cam_status status; | cam_status status; | ||||
struct cam_periph *old_periph; | struct cam_periph *old_periph; | ||||
int lock; | int lock; | ||||
CAM_DEBUG(path, CAM_DEBUG_TRACE, ("nvme_scan_lun\n")); | CAM_DEBUG(path, CAM_DEBUG_TRACE, ("nvme_scan_lun\n")); | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); | xpt_path_inq(&cpi, path, CAM_PRIORITY_NONE); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
if (cpi.ccb_h.status != CAM_REQ_CMP) { | if (cpi.ccb_h.status != CAM_REQ_CMP) { | ||||
if (request_ccb != NULL) { | if (request_ccb != NULL) { | ||||
request_ccb->ccb_h.status = cpi.ccb_h.status; | request_ccb->ccb_h.status = cpi.ccb_h.status; | ||||
xpt_done(request_ccb); | xpt_done(request_ccb); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
nvme_device_transport(struct cam_path *path) | nvme_device_transport(struct cam_path *path) | ||||
{ | { | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
struct ccb_trans_settings cts; | struct ccb_trans_settings cts; | ||||
/* XXX get data from nvme namespace and other info ??? */ | /* XXX get data from nvme namespace and other info ??? */ | ||||
/* Get transport information from the SIM */ | /* Get transport information from the SIM */ | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); | xpt_path_inq(&cpi, path, CAM_PRIORITY_NONE); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
path->device->transport = cpi.transport; | path->device->transport = cpi.transport; | ||||
path->device->transport_version = cpi.transport_version; | path->device->transport_version = cpi.transport_version; | ||||
path->device->protocol = cpi.protocol; | path->device->protocol = cpi.protocol; | ||||
path->device->protocol_version = cpi.protocol_version; | path->device->protocol_version = cpi.protocol_version; | ||||
/* Tell the controller what we think */ | /* Tell the controller what we think */ | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | nvme_announce_periph(struct cam_periph *periph) | ||||
cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | ||||
cts.type = CTS_TYPE_CURRENT_SETTINGS; | cts.type = CTS_TYPE_CURRENT_SETTINGS; | ||||
xpt_action((union ccb*)&cts); | xpt_action((union ccb*)&cts); | ||||
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | ||||
return; | return; | ||||
nvmex = &cts.xport_specific.nvme; | nvmex = &cts.xport_specific.nvme; | ||||
/* Ask the SIM for its base transfer speed */ | /* Ask the SIM for its base transfer speed */ | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_path_inq(&cpi, periph->path, CAM_PRIORITY_NORMAL); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
printf("%s%d: nvme version %d.%d x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", | printf("%s%d: nvme version %d.%d x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", | ||||
periph->periph_name, periph->unit_number, | periph->periph_name, periph->unit_number, | ||||
NVME_MAJOR(nvmex->spec), | NVME_MAJOR(nvmex->spec), | ||||
NVME_MINOR(nvmex->spec), | NVME_MINOR(nvmex->spec), | ||||
nvmex->lanes, nvmex->max_lanes, | nvmex->lanes, nvmex->max_lanes, | ||||
nvmex->speed, nvmex->max_speed); | nvmex->speed, nvmex->max_speed); | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
Show All 33 Lines |