Struct devices::pci::ac97::Ac97Dev

source ·
pub struct Ac97Dev {
    config_regs: PciConfiguration,
    pci_address: Option<PciAddress>,
    irq_evt: Option<IrqLevelEvent>,
    bus_master: Ac97BusMaster,
    mixer: Ac97Mixer,
    backend: Ac97Backend,
}

Fields§

§config_regs: PciConfiguration§pci_address: Option<PciAddress>§irq_evt: Option<IrqLevelEvent>§bus_master: Ac97BusMaster§mixer: Ac97Mixer§backend: Ac97Backend

Implementations§

Return the minijail policy file path for the current Ac97Dev.

Creates an ‘Ac97Dev’ that uses the given GuestMemory and starts with all registers at default values.

Creates an Ac97Dev with suitable audio server inside based on Ac97Parameters. If it fails to create Ac97Dev with the given back-end, it’ll fallback to the null audio device.

Trait Implementations§

Returns a label suitable for debug output.
Allocate and return an unique bus, device and function number for this device. May be called multiple times; on subsequent calls, the device should return the same address it returned from the first call.
Assign a legacy PCI IRQ to this device. The device may write to irq_evt to trigger an interrupt. When irq_resample_evt is signaled, the device should re-assert irq_evt if necessary.
Allocates the needed IO BAR space using the allocate function which takes a size and returns an address. Returns a Vec of BarRange{addr, size, prefetchable}.
Returns the configuration of a base address register, if present.
Reads from a PCI configuration register. Read more
Writes to a PCI configuration register. Read more
A vector of device-specific file descriptors that must be kept open after jailing. Must be called before the process is jailed.
Reads from a BAR region mapped in to the device. Read more
Writes to a BAR region mapped in to the device. Read more
Preferred PCI address for this device, if any.
Preferred IRQ for this device. The device may request a specific pin and IRQ number by returning a Fixed value. If a device does not support INTx# interrupts at all, it should return None. Otherwise, an appropriate IRQ will be allocated automatically. The device’s assign_irq function will be called with its assigned IRQ either way.
Allocates the needed device BAR space. Returns a Vec of BarRange{addr, size, prefetchable}. Unlike MMIO BARs (see allocate_io_bars), device BARs are not expected to incur VM exits Read more
Register any capabilties specified by the device.
Gets a reference to the API client for sending VmMemoryRequest. Any devices that uses ioevents must provide this.
Reads from a virtual config register. Read more
Writes to a virtual config register. Read more
Invoked when the device is sandboxed.
Construct customized acpi method, and return the AML code and shared memory
Invoked when the device is destroyed
Get the removed children devices under pci bridge
Get the pci bus generated by this pci device
if device is a pci brdige, configure pci bridge window
if device is a pci bridge, configure subordinate bus number
Indicates whether the device supports IOMMU
Sets the IOMMU for the device if supports_iommu()
Save the device state in an image that can be restored.
Load a saved snapshot of an image.
Stop all threads related to the device. Sleep should be idempotent.
Create/Resume all threads related to the device. Wake should be idempotent.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.