3 #include "block/nvme.h"
5 typedef struct NvmeAsyncEvent
{
6 QSIMPLEQ_ENTRY(NvmeAsyncEvent
) entry
;
10 typedef struct NvmeRequest
{
11 struct NvmeSQueue
*sq
;
19 QTAILQ_ENTRY(NvmeRequest
)entry
;
22 typedef struct NvmeSQueue
{
23 struct NvmeCtrl
*ctrl
;
32 QTAILQ_HEAD(, NvmeRequest
) req_list
;
33 QTAILQ_HEAD(, NvmeRequest
) out_req_list
;
34 QTAILQ_ENTRY(NvmeSQueue
) entry
;
37 typedef struct NvmeCQueue
{
38 struct NvmeCtrl
*ctrl
;
48 QTAILQ_HEAD(, NvmeSQueue
) sq_list
;
49 QTAILQ_HEAD(, NvmeRequest
) req_list
;
52 typedef struct NvmeNamespace
{
56 #define TYPE_NVME "nvme"
58 OBJECT_CHECK(NvmeCtrl, (obj), TYPE_NVME)
60 typedef struct NvmeCtrl
{
63 MemoryRegion ctrl_mem
;
69 uint16_t max_prp_ents
;
73 uint32_t num_namespaces
;
82 uint64_t host_timestamp
; /* Timestamp sent by the host */
83 uint64_t timestamp_set_qemu_clock_ms
; /* QEMU clock time */
86 NvmeNamespace
*namespaces
;
94 #endif /* HW_NVME_H */