3 #include "qemu/cutils.h"
4 #include "block/nvme.h"
6 typedef struct NvmeAsyncEvent
{
7 QSIMPLEQ_ENTRY(NvmeAsyncEvent
) entry
;
11 typedef struct NvmeRequest
{
12 struct NvmeSQueue
*sq
;
20 QTAILQ_ENTRY(NvmeRequest
)entry
;
23 typedef struct NvmeSQueue
{
24 struct NvmeCtrl
*ctrl
;
33 QTAILQ_HEAD(sq_req_list
, NvmeRequest
) req_list
;
34 QTAILQ_HEAD(out_req_list
, NvmeRequest
) out_req_list
;
35 QTAILQ_ENTRY(NvmeSQueue
) entry
;
38 typedef struct NvmeCQueue
{
39 struct NvmeCtrl
*ctrl
;
49 QTAILQ_HEAD(sq_list
, NvmeSQueue
) sq_list
;
50 QTAILQ_HEAD(cq_req_list
, NvmeRequest
) req_list
;
53 typedef struct NvmeNamespace
{
57 #define TYPE_NVME "nvme"
59 OBJECT_CHECK(NvmeCtrl, (obj), TYPE_NVME)
61 typedef struct NvmeCtrl
{
64 MemoryRegion ctrl_mem
;
70 uint16_t max_prp_ents
;
74 uint32_t num_namespaces
;
85 NvmeNamespace
*namespaces
;
93 #endif /* HW_NVME_H */