/* automatically generated by rust-bindgen 0.71.1 */

pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32;
pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96;
pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32;
pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96;
pub const VIRTIO_SCSI_F_INOUT: u32 = 0;
pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1;
pub const VIRTIO_SCSI_F_CHANGE: u32 = 2;
pub const VIRTIO_SCSI_F_T10_PI: u32 = 3;
pub const VIRTIO_SCSI_S_OK: u32 = 0;
pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1;
pub const VIRTIO_SCSI_S_ABORTED: u32 = 2;
pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3;
pub const VIRTIO_SCSI_S_RESET: u32 = 4;
pub const VIRTIO_SCSI_S_BUSY: u32 = 5;
pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6;
pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7;
pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8;
pub const VIRTIO_SCSI_S_FAILURE: u32 = 9;
pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10;
pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11;
pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12;
pub const VIRTIO_SCSI_T_TMF: u32 = 0;
pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1;
pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2;
pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0;
pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1;
pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2;
pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3;
pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4;
pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5;
pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6;
pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7;
pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648;
pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0;
pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1;
pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2;
pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3;
pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0;
pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1;
pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2;
pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0;
pub const VIRTIO_SCSI_S_ORDERED: u32 = 1;
pub const VIRTIO_SCSI_S_HEAD: u32 = 2;
pub const VIRTIO_SCSI_S_ACA: u32 = 3;
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 __virtio16 = __u16;
pub type __virtio32 = __u32;
pub type __virtio64 = __u64;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_cmd_req {
    pub lun: [__u8; 8usize],
    pub tag: __virtio64,
    pub task_attr: __u8,
    pub prio: __u8,
    pub crn: __u8,
    pub cdb: [__u8; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::<virtio_scsi_cmd_req>() - 51usize];
    ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::<virtio_scsi_cmd_req>() - 1usize];
    ["Offset of field: virtio_scsi_cmd_req::lun"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize];
    ["Offset of field: virtio_scsi_cmd_req::tag"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize];
    ["Offset of field: virtio_scsi_cmd_req::task_attr"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize];
    ["Offset of field: virtio_scsi_cmd_req::prio"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize];
    ["Offset of field: virtio_scsi_cmd_req::crn"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize];
    ["Offset of field: virtio_scsi_cmd_req::cdb"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_cmd_req_pi {
    pub lun: [__u8; 8usize],
    pub tag: __virtio64,
    pub task_attr: __u8,
    pub prio: __u8,
    pub crn: __u8,
    pub pi_bytesout: __virtio32,
    pub pi_bytesin: __virtio32,
    pub cdb: [__u8; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::<virtio_scsi_cmd_req_pi>() - 59usize];
    ["Alignment of virtio_scsi_cmd_req_pi"]
        [::std::mem::align_of::<virtio_scsi_cmd_req_pi>() - 1usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::lun"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::tag"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::prio"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::crn"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize];
    ["Offset of field: virtio_scsi_cmd_req_pi::cdb"]
        [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize];
};
#[repr(C, packed)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct virtio_scsi_cmd_resp {
    pub sense_len: __virtio32,
    pub resid: __virtio32,
    pub status_qualifier: __virtio16,
    pub status: __u8,
    pub response: __u8,
    pub sense: [__u8; 96usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::<virtio_scsi_cmd_resp>() - 108usize];
    ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::<virtio_scsi_cmd_resp>() - 1usize];
    ["Offset of field: virtio_scsi_cmd_resp::sense_len"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize];
    ["Offset of field: virtio_scsi_cmd_resp::resid"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize];
    ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize];
    ["Offset of field: virtio_scsi_cmd_resp::status"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize];
    ["Offset of field: virtio_scsi_cmd_resp::response"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize];
    ["Offset of field: virtio_scsi_cmd_resp::sense"]
        [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize];
};
impl Default for virtio_scsi_cmd_resp {
    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, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_ctrl_tmf_req {
    pub type_: __virtio32,
    pub subtype: __virtio32,
    pub lun: [__u8; 8usize],
    pub tag: __virtio64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_ctrl_tmf_req"]
        [::std::mem::size_of::<virtio_scsi_ctrl_tmf_req>() - 24usize];
    ["Alignment of virtio_scsi_ctrl_tmf_req"]
        [::std::mem::align_of::<virtio_scsi_ctrl_tmf_req>() - 1usize];
    ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize];
    ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize];
    ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize];
    ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_ctrl_tmf_resp {
    pub response: __u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_ctrl_tmf_resp"]
        [::std::mem::size_of::<virtio_scsi_ctrl_tmf_resp>() - 1usize];
    ["Alignment of virtio_scsi_ctrl_tmf_resp"]
        [::std::mem::align_of::<virtio_scsi_ctrl_tmf_resp>() - 1usize];
    ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_ctrl_an_req {
    pub type_: __virtio32,
    pub lun: [__u8; 8usize],
    pub event_requested: __virtio32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::<virtio_scsi_ctrl_an_req>() - 16usize];
    ["Alignment of virtio_scsi_ctrl_an_req"]
        [::std::mem::align_of::<virtio_scsi_ctrl_an_req>() - 1usize];
    ["Offset of field: virtio_scsi_ctrl_an_req::type_"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize];
    ["Offset of field: virtio_scsi_ctrl_an_req::lun"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize];
    ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_ctrl_an_resp {
    pub event_actual: __virtio32,
    pub response: __u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_ctrl_an_resp"]
        [::std::mem::size_of::<virtio_scsi_ctrl_an_resp>() - 5usize];
    ["Alignment of virtio_scsi_ctrl_an_resp"]
        [::std::mem::align_of::<virtio_scsi_ctrl_an_resp>() - 1usize];
    ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize];
    ["Offset of field: virtio_scsi_ctrl_an_resp::response"]
        [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_event {
    pub event: __virtio32,
    pub lun: [__u8; 8usize],
    pub reason: __virtio32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_event"][::std::mem::size_of::<virtio_scsi_event>() - 16usize];
    ["Alignment of virtio_scsi_event"][::std::mem::align_of::<virtio_scsi_event>() - 1usize];
    ["Offset of field: virtio_scsi_event::event"]
        [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize];
    ["Offset of field: virtio_scsi_event::lun"]
        [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize];
    ["Offset of field: virtio_scsi_event::reason"]
        [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize];
};
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct virtio_scsi_config {
    pub num_queues: __virtio32,
    pub seg_max: __virtio32,
    pub max_sectors: __virtio32,
    pub cmd_per_lun: __virtio32,
    pub event_info_size: __virtio32,
    pub sense_size: __virtio32,
    pub cdb_size: __virtio32,
    pub max_channel: __virtio16,
    pub max_target: __virtio16,
    pub max_lun: __virtio32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of virtio_scsi_config"][::std::mem::size_of::<virtio_scsi_config>() - 36usize];
    ["Alignment of virtio_scsi_config"][::std::mem::align_of::<virtio_scsi_config>() - 1usize];
    ["Offset of field: virtio_scsi_config::num_queues"]
        [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize];
    ["Offset of field: virtio_scsi_config::seg_max"]
        [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize];
    ["Offset of field: virtio_scsi_config::max_sectors"]
        [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize];
    ["Offset of field: virtio_scsi_config::cmd_per_lun"]
        [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize];
    ["Offset of field: virtio_scsi_config::event_info_size"]
        [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize];
    ["Offset of field: virtio_scsi_config::sense_size"]
        [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize];
    ["Offset of field: virtio_scsi_config::cdb_size"]
        [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize];
    ["Offset of field: virtio_scsi_config::max_channel"]
        [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize];
    ["Offset of field: virtio_scsi_config::max_target"]
        [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize];
    ["Offset of field: virtio_scsi_config::max_lun"]
        [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize];
};
