Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/nvme/nvme_sim.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) | ||||
if (req == NULL) { | if (req == NULL) { | ||||
nvmeio->ccb_h.status = CAM_RESRC_UNAVAIL; | nvmeio->ccb_h.status = CAM_RESRC_UNAVAIL; | ||||
xpt_done(ccb); | xpt_done(ccb); | ||||
return; | return; | ||||
} | } | ||||
memcpy(&req->cmd, &ccb->nvmeio.cmd, sizeof(ccb->nvmeio.cmd)); | memcpy(&req->cmd, &ccb->nvmeio.cmd, sizeof(ccb->nvmeio.cmd)); | ||||
if (ccb->ccb_h.func_code == XPT_NVME_IO) | |||||
nvme_ctrlr_submit_io_request(ctrlr, req); | nvme_ctrlr_submit_io_request(ctrlr, req); | ||||
else | |||||
nvme_ctrlr_submit_admin_request(ctrlr, req); | |||||
ccb->ccb_h.status |= CAM_SIM_QUEUED; | ccb->ccb_h.status |= CAM_SIM_QUEUED; | ||||
} | } | ||||
static void | static void | ||||
nvme_sim_action(struct cam_sim *sim, union ccb *ccb) | nvme_sim_action(struct cam_sim *sim, union ccb *ccb) | ||||
{ | { | ||||
struct nvme_controller *ctrlr; | struct nvme_controller *ctrlr; | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | case XPT_RESET_BUS: /* Reset the specified bus */ | ||||
/* | /* | ||||
* NVMe doesn't really support physically resetting the bus. It's part | * NVMe doesn't really support physically resetting the bus. It's part | ||||
* of the bus scanning dance, so return sucess to tell the process to | * of the bus scanning dance, so return sucess to tell the process to | ||||
* proceed. | * proceed. | ||||
*/ | */ | ||||
ccb->ccb_h.status = CAM_REQ_CMP; | ccb->ccb_h.status = CAM_REQ_CMP; | ||||
break; | break; | ||||
case XPT_NVME_IO: /* Execute the requested I/O operation */ | case XPT_NVME_IO: /* Execute the requested I/O operation */ | ||||
case XPT_NVME_ADMIN: /* or Admin operation */ | |||||
nvme_sim_nvmeio(sim, ccb); | nvme_sim_nvmeio(sim, ccb); | ||||
return; /* no done */ | return; /* no done */ | ||||
default: | default: | ||||
ccb->ccb_h.status = CAM_REQ_INVALID; | ccb->ccb_h.status = CAM_REQ_INVALID; | ||||
break; | break; | ||||
} | } | ||||
xpt_done(ccb); | xpt_done(ccb); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |