Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_nvme.c
Show First 20 Lines • Show All 462 Lines • ▼ Show 20 Lines | pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) | ||||
cd->mdts = NVME_MDTS; /* max data transfer size (2^mdts * CAP.MPSMIN) */ | cd->mdts = NVME_MDTS; /* max data transfer size (2^mdts * CAP.MPSMIN) */ | ||||
cd->ver = 0x00010300; | cd->ver = 0x00010300; | ||||
cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; | cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; | ||||
cd->acl = 2; | cd->acl = 2; | ||||
cd->aerl = 4; | cd->aerl = 4; | ||||
/* Advertise 1, Read-only firmware slot */ | |||||
cd->frmw = NVME_CTRLR_DATA_FRMW_SLOT1_RO_MASK | | |||||
(1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); | |||||
cd->lpa = 0; /* TODO: support some simple things like SMART */ | cd->lpa = 0; /* TODO: support some simple things like SMART */ | ||||
cd->elpe = 0; /* max error log page entries */ | cd->elpe = 0; /* max error log page entries */ | ||||
cd->npss = 1; /* number of power states support */ | cd->npss = 1; /* number of power states support */ | ||||
/* Warning Composite Temperature Threshold */ | /* Warning Composite Temperature Threshold */ | ||||
cd->wctemp = 0x0157; | cd->wctemp = 0x0157; | ||||
cd->sqes = (6 << NVME_CTRLR_DATA_SQES_MAX_SHIFT) | | cd->sqes = (6 << NVME_CTRLR_DATA_SQES_MAX_SHIFT) | | ||||
▲ Show 20 Lines • Show All 1,072 Lines • ▼ Show 20 Lines | case NVME_OPC_ABORT: | ||||
break; | break; | ||||
case NVME_OPC_SET_FEATURES: | case NVME_OPC_SET_FEATURES: | ||||
DPRINTF("%s command SET_FEATURES", __func__); | DPRINTF("%s command SET_FEATURES", __func__); | ||||
nvme_opc_set_features(sc, cmd, &compl); | nvme_opc_set_features(sc, cmd, &compl); | ||||
break; | break; | ||||
case NVME_OPC_GET_FEATURES: | case NVME_OPC_GET_FEATURES: | ||||
DPRINTF("%s command GET_FEATURES", __func__); | DPRINTF("%s command GET_FEATURES", __func__); | ||||
nvme_opc_get_features(sc, cmd, &compl); | nvme_opc_get_features(sc, cmd, &compl); | ||||
break; | |||||
case NVME_OPC_FIRMWARE_ACTIVATE: | |||||
DPRINTF("%s command FIRMWARE_ACTIVATE", __func__); | |||||
pci_nvme_status_tc(&compl.status, | |||||
NVME_SCT_COMMAND_SPECIFIC, | |||||
NVME_SC_INVALID_FIRMWARE_SLOT); | |||||
break; | break; | ||||
case NVME_OPC_ASYNC_EVENT_REQUEST: | case NVME_OPC_ASYNC_EVENT_REQUEST: | ||||
DPRINTF("%s command ASYNC_EVENT_REQ", __func__); | DPRINTF("%s command ASYNC_EVENT_REQ", __func__); | ||||
nvme_opc_async_event_req(sc, cmd, &compl); | nvme_opc_async_event_req(sc, cmd, &compl); | ||||
break; | break; | ||||
case NVME_OPC_FORMAT_NVM: | case NVME_OPC_FORMAT_NVM: | ||||
DPRINTF("%s command FORMAT_NVM", __func__); | DPRINTF("%s command FORMAT_NVM", __func__); | ||||
if ((sc->ctrldata.oacs & | if ((sc->ctrldata.oacs & | ||||
▲ Show 20 Lines • Show All 1,180 Lines • Show Last 20 Lines |