/* automatically generated by rust-bindgen 0.71.1 */

#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
    #[inline]
    pub const fn new() -> Self {
        __IncompleteArrayField(::std::marker::PhantomData, [])
    }
    #[inline]
    pub fn as_ptr(&self) -> *const T {
        self as *const _ as *const T
    }
    #[inline]
    pub fn as_mut_ptr(&mut self) -> *mut T {
        self as *mut _ as *mut T
    }
    #[inline]
    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
        ::std::slice::from_raw_parts(self.as_ptr(), len)
    }
    #[inline]
    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
    }
}
impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_str("__IncompleteArrayField")
    }
}
pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1;
pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2;
pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4;
pub const VIRTIO_BLK_F_RO: u32 = 5;
pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6;
pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10;
pub const VIRTIO_BLK_F_MQ: u32 = 12;
pub const VIRTIO_BLK_F_DISCARD: u32 = 13;
pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14;
pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16;
pub const VIRTIO_BLK_F_ZONED: u32 = 17;
pub const VIRTIO_BLK_F_BARRIER: u32 = 0;
pub const VIRTIO_BLK_F_SCSI: u32 = 7;
pub const VIRTIO_BLK_F_FLUSH: u32 = 9;
pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11;
pub const VIRTIO_BLK_F_WCE: u32 = 9;
pub const VIRTIO_BLK_ID_BYTES: u32 = 20;
pub const VIRTIO_BLK_T_IN: u32 = 0;
pub const VIRTIO_BLK_T_OUT: u32 = 1;
pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2;
pub const VIRTIO_BLK_T_FLUSH: u32 = 4;
pub const VIRTIO_BLK_T_GET_ID: u32 = 8;
pub const VIRTIO_BLK_T_DISCARD: u32 = 11;
pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13;
pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14;
pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15;
pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16;
pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18;
pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20;
pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22;
pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24;
pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26;
pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648;
pub const VIRTIO_BLK_Z_NONE: u32 = 0;
pub const VIRTIO_BLK_Z_HM: u32 = 1;
pub const VIRTIO_BLK_Z_HA: u32 = 2;
pub const VIRTIO_BLK_ZT_CONV: u32 = 1;
pub const VIRTIO_BLK_ZT_SWR: u32 = 2;
pub const VIRTIO_BLK_ZT_SWP: u32 = 3;
pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0;
pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1;
pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2;
pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3;
pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4;
pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13;
pub const VIRTIO_BLK_ZS_FULL: u32 = 14;
pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15;
pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1;
pub const VIRTIO_BLK_S_OK: u32 = 0;
pub const VIRTIO_BLK_S_IOERR: u32 = 1;
pub const VIRTIO_BLK_S_UNSUPP: u32 = 2;
pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3;
pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4;
pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5;
pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6;
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;
pub type __le32 = __u32;
pub type __le64 = __u64;
pub type __virtio16 = __u16;
pub type __virtio32 = __u32;
pub type __virtio64 = __u64;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_blk_config {
    pub capacity: __virtio64,
    pub size_max: __virtio32,
    pub seg_max: __virtio32,
    pub geometry: virtio_blk_config_virtio_blk_geometry,
    pub blk_size: __virtio32,
    pub physical_block_exp: __u8,
    pub alignment_offset: __u8,
    pub min_io_size: __virtio16,
    pub opt_io_size: __virtio32,
    pub wce: __u8,
    pub unused: __u8,
    pub num_queues: __virtio16,
    pub max_discard_sectors: __virtio32,
    pub max_discard_seg: __virtio32,
    pub discard_sector_alignment: __virtio32,
    pub max_write_zeroes_sectors: __virtio32,
    pub max_write_zeroes_seg: __virtio32,
    pub write_zeroes_may_unmap: __u8,
    pub unused1: [__u8; 3usize],
    pub max_secure_erase_sectors: __virtio32,
    pub max_secure_erase_seg: __virtio32,
    pub secure_erase_sector_alignment: __virtio32,
    pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_blk_config_virtio_blk_geometry {
    pub cylinders: __virtio16,
    pub heads: __u8,
    pub sectors: __u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_config_virtio_blk_geometry"]
        [::std::mem::size_of::<virtio_blk_config_virtio_blk_geometry>() - 4usize];
    ["Alignment of virtio_blk_config_virtio_blk_geometry"]
        [::std::mem::align_of::<virtio_blk_config_virtio_blk_geometry>() - 2usize];
    ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"]
        [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize];
    ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"]
        [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize];
    ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"]
        [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_blk_config_virtio_blk_zoned_characteristics {
    pub zone_sectors: __virtio32,
    pub max_open_zones: __virtio32,
    pub max_active_zones: __virtio32,
    pub max_append_sectors: __virtio32,
    pub write_granularity: __virtio32,
    pub model: __u8,
    pub unused2: [__u8; 3usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"]
        [::std::mem::size_of::<virtio_blk_config_virtio_blk_zoned_characteristics>() - 24usize];
    ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"]
        [::std::mem::align_of::<virtio_blk_config_virtio_blk_zoned_characteristics>() - 4usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        zone_sectors
    )
        - 0usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        max_open_zones
    )
        - 4usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        max_active_zones
    )
        - 8usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        max_append_sectors
    )
        - 12usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        write_granularity
    )
        - 16usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        model
    ) - 20usize];
    ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!(
        virtio_blk_config_virtio_blk_zoned_characteristics,
        unused2
    ) - 21usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_config"][::std::mem::size_of::<virtio_blk_config>() - 96usize];
    ["Alignment of virtio_blk_config"][::std::mem::align_of::<virtio_blk_config>() - 1usize];
    ["Offset of field: virtio_blk_config::capacity"]
        [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize];
    ["Offset of field: virtio_blk_config::size_max"]
        [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize];
    ["Offset of field: virtio_blk_config::seg_max"]
        [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize];
    ["Offset of field: virtio_blk_config::geometry"]
        [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize];
    ["Offset of field: virtio_blk_config::blk_size"]
        [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize];
    ["Offset of field: virtio_blk_config::physical_block_exp"]
        [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize];
    ["Offset of field: virtio_blk_config::alignment_offset"]
        [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize];
    ["Offset of field: virtio_blk_config::min_io_size"]
        [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize];
    ["Offset of field: virtio_blk_config::opt_io_size"]
        [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize];
    ["Offset of field: virtio_blk_config::wce"]
        [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize];
    ["Offset of field: virtio_blk_config::unused"]
        [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize];
    ["Offset of field: virtio_blk_config::num_queues"]
        [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize];
    ["Offset of field: virtio_blk_config::max_discard_sectors"]
        [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize];
    ["Offset of field: virtio_blk_config::max_discard_seg"]
        [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize];
    ["Offset of field: virtio_blk_config::discard_sector_alignment"]
        [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize];
    ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"]
        [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize];
    ["Offset of field: virtio_blk_config::max_write_zeroes_seg"]
        [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize];
    ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"]
        [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize];
    ["Offset of field: virtio_blk_config::unused1"]
        [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize];
    ["Offset of field: virtio_blk_config::max_secure_erase_sectors"]
        [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize];
    ["Offset of field: virtio_blk_config::max_secure_erase_seg"]
        [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize];
    ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"]
        [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize];
    ["Offset of field: virtio_blk_config::zoned"]
        [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_blk_outhdr {
    pub type_: __virtio32,
    pub ioprio: __virtio32,
    pub sector: __virtio64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_outhdr"][::std::mem::size_of::<virtio_blk_outhdr>() - 16usize];
    ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::<virtio_blk_outhdr>() - 8usize];
    ["Offset of field: virtio_blk_outhdr::type_"]
        [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize];
    ["Offset of field: virtio_blk_outhdr::ioprio"]
        [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize];
    ["Offset of field: virtio_blk_outhdr::sector"]
        [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct virtio_blk_zone_descriptor {
    pub z_cap: __virtio64,
    pub z_start: __virtio64,
    pub z_wp: __virtio64,
    pub z_type: __u8,
    pub z_state: __u8,
    pub reserved: [__u8; 38usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_zone_descriptor"]
        [::std::mem::size_of::<virtio_blk_zone_descriptor>() - 64usize];
    ["Alignment of virtio_blk_zone_descriptor"]
        [::std::mem::align_of::<virtio_blk_zone_descriptor>() - 8usize];
    ["Offset of field: virtio_blk_zone_descriptor::z_cap"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize];
    ["Offset of field: virtio_blk_zone_descriptor::z_start"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize];
    ["Offset of field: virtio_blk_zone_descriptor::z_wp"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize];
    ["Offset of field: virtio_blk_zone_descriptor::z_type"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize];
    ["Offset of field: virtio_blk_zone_descriptor::z_state"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize];
    ["Offset of field: virtio_blk_zone_descriptor::reserved"]
        [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize];
};
impl Default for virtio_blk_zone_descriptor {
    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)]
pub struct virtio_blk_zone_report {
    pub nr_zones: __virtio64,
    pub reserved: [__u8; 56usize],
    pub zones: __IncompleteArrayField<virtio_blk_zone_descriptor>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_zone_report"][::std::mem::size_of::<virtio_blk_zone_report>() - 64usize];
    ["Alignment of virtio_blk_zone_report"]
        [::std::mem::align_of::<virtio_blk_zone_report>() - 8usize];
    ["Offset of field: virtio_blk_zone_report::nr_zones"]
        [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize];
    ["Offset of field: virtio_blk_zone_report::reserved"]
        [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize];
    ["Offset of field: virtio_blk_zone_report::zones"]
        [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize];
};
impl Default for virtio_blk_zone_report {
    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, PartialEq)]
pub struct virtio_blk_discard_write_zeroes {
    pub sector: __le64,
    pub num_sectors: __le32,
    pub flags: __le32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_blk_discard_write_zeroes"]
        [::std::mem::size_of::<virtio_blk_discard_write_zeroes>() - 16usize];
    ["Alignment of virtio_blk_discard_write_zeroes"]
        [::std::mem::align_of::<virtio_blk_discard_write_zeroes>() - 8usize];
    ["Offset of field: virtio_blk_discard_write_zeroes::sector"]
        [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize];
    ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"]
        [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize];
    ["Offset of field: virtio_blk_discard_write_zeroes::flags"]
        [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_inhdr {
    pub errors: __virtio32,
    pub data_len: __virtio32,
    pub sense_len: __virtio32,
    pub residual: __virtio32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_inhdr"][::std::mem::size_of::<virtio_scsi_inhdr>() - 16usize];
    ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::<virtio_scsi_inhdr>() - 4usize];
    ["Offset of field: virtio_scsi_inhdr::errors"]
        [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize];
    ["Offset of field: virtio_scsi_inhdr::data_len"]
        [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize];
    ["Offset of field: virtio_scsi_inhdr::sense_len"]
        [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize];
    ["Offset of field: virtio_scsi_inhdr::residual"]
        [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize];
};
