// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note

// This file was generated by running
//
//     bindgen include/uapi/linux/nvme_ioctl.h --allowlist-file include/uapi/linux/nvme_ioctl.h \
//         --with-derive-default --no-layout-tests -o nvme_ioctl.rs -- -I include
//
// at the root of the Linux 5.19.0 tree. The SPDX header and this note were then added manually.

/* automatically generated by rust-bindgen 0.60.1 */

pub type __u8 = ::std::os::raw::c_uchar;
pub type __u16 = ::std::os::raw::c_ushort;
pub type __u32 = ::std::os::raw::c_uint;
pub type __u64 = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct nvme_user_io {
    pub opcode: __u8,
    pub flags: __u8,
    pub control: __u16,
    pub nblocks: __u16,
    pub rsvd: __u16,
    pub metadata: __u64,
    pub addr: __u64,
    pub slba: __u64,
    pub dsmgmt: __u32,
    pub reftag: __u32,
    pub apptag: __u16,
    pub appmask: __u16,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct nvme_passthru_cmd {
    pub opcode: __u8,
    pub flags: __u8,
    pub rsvd1: __u16,
    pub nsid: __u32,
    pub cdw2: __u32,
    pub cdw3: __u32,
    pub metadata: __u64,
    pub addr: __u64,
    pub metadata_len: __u32,
    pub data_len: __u32,
    pub cdw10: __u32,
    pub cdw11: __u32,
    pub cdw12: __u32,
    pub cdw13: __u32,
    pub cdw14: __u32,
    pub cdw15: __u32,
    pub timeout_ms: __u32,
    pub result: __u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nvme_passthru_cmd64 {
    pub opcode: __u8,
    pub flags: __u8,
    pub rsvd1: __u16,
    pub nsid: __u32,
    pub cdw2: __u32,
    pub cdw3: __u32,
    pub metadata: __u64,
    pub addr: __u64,
    pub metadata_len: __u32,
    pub __bindgen_anon_1: nvme_passthru_cmd64__bindgen_ty_1,
    pub cdw10: __u32,
    pub cdw11: __u32,
    pub cdw12: __u32,
    pub cdw13: __u32,
    pub cdw14: __u32,
    pub cdw15: __u32,
    pub timeout_ms: __u32,
    pub rsvd2: __u32,
    pub result: __u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union nvme_passthru_cmd64__bindgen_ty_1 {
    pub data_len: __u32,
    pub vec_cnt: __u32,
}
impl Default for nvme_passthru_cmd64__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl Default for nvme_passthru_cmd64 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct nvme_uring_cmd {
    pub opcode: __u8,
    pub flags: __u8,
    pub rsvd1: __u16,
    pub nsid: __u32,
    pub cdw2: __u32,
    pub cdw3: __u32,
    pub metadata: __u64,
    pub addr: __u64,
    pub metadata_len: __u32,
    pub data_len: __u32,
    pub cdw10: __u32,
    pub cdw11: __u32,
    pub cdw12: __u32,
    pub cdw13: __u32,
    pub cdw14: __u32,
    pub cdw15: __u32,
    pub timeout_ms: __u32,
    pub rsvd2: __u32,
}
