[][src]Struct vfio_bindings::bindings::vfio::vfio_irq_set

#[repr(C)]
pub struct vfio_irq_set {
    pub argsz: __u32,
    pub flags: __u32,
    pub index: __u32,
    pub start: __u32,
    pub count: __u32,
    pub data: __IncompleteArrayField<__u8>,
}

VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)

Set signaling, masking, and unmasking of interrupts. Caller provides struct vfio_irq_set with all fields set. 'start' and 'count' indicate the range of subindexes being specified.

The DATA flags specify the type of data provided. If DATA_NONE, the operation performs the specified action immediately on the specified interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]: flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.

DATA_BOOL allows sparse support for the same on arrays of interrupts. For example, to mask interrupts [0,1] and [0,3] (but not [0,2]): flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3, data = {1,0,1}

DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd. A value of -1 can be used to either de-assign interrupts if already assigned or skip un-assigned interrupts. For example, to set an eventfd to be trigger for interrupts [0,0] and [0,2]: flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3, data = {fd1, -1, fd2} If index [0,1] is previously set, two count = 1 ioctls calls would be required to set [0,0] and [0,2] without changing [0,1].

Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER to perform kernel level interrupt loopback testing from userspace (ie. simulate hardware triggering).

Setting of an event triggering mechanism to userspace for ACTION_TRIGGER enables the interrupt index for the device. Individual subindex interrupts can be disabled using the -1 value for DATA_EVENTFD or the index can be disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.

Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while ACTION_TRIGGER specifies kernel->user signaling.

Fields

argsz: __u32flags: __u32index: __u32start: __u32count: __u32data: __IncompleteArrayField<__u8>

Trait Implementations

impl Default for vfio_irq_set[src]

impl Debug for vfio_irq_set[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]