Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/nvme/nvme_sim.c
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | case XPT_SET_TRAN_SETTINGS: | ||||
/* | /* | ||||
* NVMe doesn't really have different transfer settings, but | * NVMe doesn't really have different transfer settings, but | ||||
* other parts of CAM think failure here is a big deal. | * other parts of CAM think failure here is a big deal. | ||||
*/ | */ | ||||
ccb->ccb_h.status = CAM_REQ_CMP; | ccb->ccb_h.status = CAM_REQ_CMP; | ||||
break; | break; | ||||
case XPT_PATH_INQ: /* Path routing inquiry */ | case XPT_PATH_INQ: /* Path routing inquiry */ | ||||
{ | { | ||||
struct ccb_pathinq *cpi = &ccb->cpi; | struct ccb_pathinq *cpi = &ccb->cpi; | ||||
device_t dev = ctrlr->dev; | |||||
/* | /* | ||||
* NVMe may have multiple LUNs on the same path. Current generation | * NVMe may have multiple LUNs on the same path. Current generation | ||||
* of NVMe devives support only a single name space. Multiple name | * of NVMe devives support only a single name space. Multiple name | ||||
* space drives are coming, but it's unclear how we should report | * space drives are coming, but it's unclear how we should report | ||||
* them up the stack. | * them up the stack. | ||||
*/ | */ | ||||
cpi->version_num = 1; | cpi->version_num = 1; | ||||
Show All 11 Lines | case XPT_PATH_INQ: /* Path routing inquiry */ | ||||
strlcpy(cpi->hba_vid, "NVMe", HBA_IDLEN); | strlcpy(cpi->hba_vid, "NVMe", HBA_IDLEN); | ||||
strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | ||||
cpi->unit_number = cam_sim_unit(sim); | cpi->unit_number = cam_sim_unit(sim); | ||||
cpi->transport = XPORT_NVME; /* XXX XPORT_PCIE ? */ | cpi->transport = XPORT_NVME; /* XXX XPORT_PCIE ? */ | ||||
cpi->transport_version = nvme_mmio_read_4(ctrlr, vs); | cpi->transport_version = nvme_mmio_read_4(ctrlr, vs); | ||||
cpi->protocol = PROTO_NVME; | cpi->protocol = PROTO_NVME; | ||||
cpi->protocol_version = nvme_mmio_read_4(ctrlr, vs); | cpi->protocol_version = nvme_mmio_read_4(ctrlr, vs); | ||||
cpi->xport_specific.nvme.nsid = ns->id; | cpi->xport_specific.nvme.nsid = ns->id; | ||||
cpi->xport_specific.nvme.domain = pci_get_domain(dev); | |||||
cpi->xport_specific.nvme.bus = pci_get_bus(dev); | |||||
cpi->xport_specific.nvme.slot = pci_get_slot(dev); | |||||
cpi->xport_specific.nvme.function = pci_get_function(dev); | |||||
cpi->xport_specific.nvme.extra = 0; | |||||
cpi->ccb_h.status = CAM_REQ_CMP; | cpi->ccb_h.status = CAM_REQ_CMP; | ||||
break; | break; | ||||
} | } | ||||
case XPT_GET_TRAN_SETTINGS: /* Get transport settings */ | case XPT_GET_TRAN_SETTINGS: /* Get transport settings */ | ||||
{ | { | ||||
struct ccb_trans_settings *cts; | struct ccb_trans_settings *cts; | ||||
struct ccb_trans_settings_nvme *nvmep; | struct ccb_trans_settings_nvme *nvmep; | ||||
struct ccb_trans_settings_nvme *nvmex; | struct ccb_trans_settings_nvme *nvmex; | ||||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |