Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cam/cam_ccb.h
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | XPT_GET_SIM_KNOB = 0x1a, | ||||
/* | /* | ||||
* Get SIM specific knob values. | * Get SIM specific knob values. | ||||
*/ | */ | ||||
XPT_SMP_IO = 0x1b | XPT_FC_DEV_QUEUED, | XPT_SMP_IO = 0x1b | XPT_FC_DEV_QUEUED, | ||||
/* Serial Management Protocol */ | /* Serial Management Protocol */ | ||||
XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, | XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, | ||||
/* Execiute the requestred NVMe I/O operation */ | /* Execute the requested NVMe I/O operation */ | ||||
XPT_MMC_IO = 0x1d | XPT_FC_DEV_QUEUED, | XPT_MMC_IO = 0x1d | XPT_FC_DEV_QUEUED, | ||||
/* Placeholder for MMC / SD / SDIO I/O stuff */ | /* Placeholder for MMC / SD / SDIO I/O stuff */ | ||||
XPT_SCAN_TGT = 0x1e | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_SCAN_TGT = 0x1e | XPT_FC_QUEUED | XPT_FC_USER_CCB | ||||
| XPT_FC_XPT_ONLY, | | XPT_FC_XPT_ONLY, | ||||
/* Scan Target */ | /* Scan Target */ | ||||
XPT_NVME_ADMIN = 0x1f | XPT_FC_DEV_QUEUED, | |||||
/* Execute the requested NVMe Admin operation */ | |||||
/* HBA engine commands 0x20->0x2F */ | /* HBA engine commands 0x20->0x2F */ | ||||
XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, | XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, | ||||
/* HBA engine feature inquiry */ | /* HBA engine feature inquiry */ | ||||
XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED, | XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED, | ||||
/* HBA execute engine request */ | /* HBA execute engine request */ | ||||
/* Target mode commands: 0x30->0x3F */ | /* Target mode commands: 0x30->0x3F */ | ||||
XPT_EN_LUN = 0x30, | XPT_EN_LUN = 0x30, | ||||
▲ Show 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | |||||
#define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 | #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 | ||||
#define RELSIM_RELEASE_AFTER_QEMPTY 0x08 | #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 | ||||
u_int32_t openings; | u_int32_t openings; | ||||
u_int32_t release_timeout; /* Abstract argument. */ | u_int32_t release_timeout; /* Abstract argument. */ | ||||
u_int32_t qfrozen_cnt; | u_int32_t qfrozen_cnt; | ||||
}; | }; | ||||
/* | /* | ||||
* NVMe I/O Request CCB used for the XPT_NVME_IO function code. | * NVMe I/O Request CCB used for the XPT_NVME_IO and XPT_NVME_ADMIN function codes. | ||||
*/ | */ | ||||
struct ccb_nvmeio { | struct ccb_nvmeio { | ||||
struct ccb_hdr ccb_h; | struct ccb_hdr ccb_h; | ||||
union ccb *next_ccb; /* Ptr for next CCB for action */ | union ccb *next_ccb; /* Ptr for next CCB for action */ | ||||
struct nvme_command cmd; /* NVME command, per NVME standard */ | struct nvme_command cmd; /* NVME command, per NVME standard */ | ||||
struct nvme_completion cpl; /* NVME completion, per NVME standard */ | struct nvme_completion cpl; /* NVME completion, per NVME standard */ | ||||
uint8_t *data_ptr; /* Ptr to the data buf/SG list */ | uint8_t *data_ptr; /* Ptr to the data buf/SG list */ | ||||
uint32_t dxfer_len; /* Data transfer length */ | uint32_t dxfer_len; /* Data transfer length */ | ||||
▲ Show 20 Lines • Show All 672 Lines • ▼ Show 20 Lines | |||||
static __inline void | static __inline void | ||||
cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, | cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, | ||||
void (*cbfcnp)(struct cam_periph *, union ccb *), | void (*cbfcnp)(struct cam_periph *, union ccb *), | ||||
u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, | u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, | ||||
u_int32_t timeout) | u_int32_t timeout) | ||||
{ | { | ||||
nvmeio->ccb_h.func_code = XPT_NVME_IO; | nvmeio->ccb_h.func_code = XPT_NVME_IO; | ||||
nvmeio->ccb_h.flags = flags; | |||||
nvmeio->ccb_h.retry_count = retries; | |||||
nvmeio->ccb_h.cbfcnp = cbfcnp; | |||||
nvmeio->ccb_h.timeout = timeout; | |||||
nvmeio->data_ptr = data_ptr; | |||||
nvmeio->dxfer_len = dxfer_len; | |||||
} | |||||
static __inline void | |||||
cam_fill_nvmeadmin(struct ccb_nvmeio *nvmeio, u_int32_t retries, | |||||
void (*cbfcnp)(struct cam_periph *, union ccb *), | |||||
u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, | |||||
u_int32_t timeout) | |||||
{ | |||||
nvmeio->ccb_h.func_code = XPT_NVME_ADMIN; | |||||
nvmeio->ccb_h.flags = flags; | nvmeio->ccb_h.flags = flags; | ||||
nvmeio->ccb_h.retry_count = retries; | nvmeio->ccb_h.retry_count = retries; | ||||
nvmeio->ccb_h.cbfcnp = cbfcnp; | nvmeio->ccb_h.cbfcnp = cbfcnp; | ||||
nvmeio->ccb_h.timeout = timeout; | nvmeio->ccb_h.timeout = timeout; | ||||
nvmeio->data_ptr = data_ptr; | nvmeio->data_ptr = data_ptr; | ||||
nvmeio->dxfer_len = dxfer_len; | nvmeio->dxfer_len = dxfer_len; | ||||
} | } | ||||
__END_DECLS | __END_DECLS | ||||
#endif /* _CAM_CAM_CCB_H */ | #endif /* _CAM_CAM_CCB_H */ |