mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 09:46:20 +00:00
pci: support disabling msis
This commit is contained in:
parent
d9825cd708
commit
51b79d7da6
@ -162,13 +162,13 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
|
||||
Device_component(Device_config device_config, Genode::addr_t addr,
|
||||
Genode::Rpc_entrypoint *ep,
|
||||
Pci::Session_component * session,
|
||||
bool rewrite_irq_line)
|
||||
bool rewrite_irq_line, bool use_msi)
|
||||
:
|
||||
_device_config(device_config), _config_space(addr),
|
||||
_ep(ep), _session(session),
|
||||
_irq_line(_device_config.read(&_config_access, PCI_IRQ_LINE,
|
||||
Pci::Device::ACCESS_8BIT)),
|
||||
_irq_session(_disable_msi(_irq_line), _msi_cap() ? _config_space : ~0UL),
|
||||
_irq_session(_disable_msi(_irq_line), (!use_msi || !_msi_cap()) ? ~0UL : _config_space),
|
||||
_rewrite_irq_line(rewrite_irq_line),
|
||||
_slab_ioport(0, &_slab_ioport_block),
|
||||
_slab_iomem(0, &_slab_iomem_block)
|
||||
@ -237,7 +237,8 @@ class Pci::Device_component : public Genode::Rpc_object<Pci::Device>,
|
||||
Device_component(Genode::Rpc_entrypoint * ep,
|
||||
Pci::Session_component * session, unsigned irq)
|
||||
:
|
||||
_config_space(~0UL), _ep(ep), _session(session),
|
||||
_config_space(~0UL),
|
||||
_ep(ep), _session(session),
|
||||
_irq_line(irq),
|
||||
_irq_session(_irq_line, _config_space),
|
||||
_slab_ioport(0, &_slab_ioport_block),
|
||||
|
@ -160,7 +160,22 @@ namespace Pci {
|
||||
return ~0U;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Check whether msi usage was explicitly switched off
|
||||
*/
|
||||
bool msi_usage()
|
||||
{
|
||||
try {
|
||||
char mode[8];
|
||||
_policy.attribute("irq_mode").value(mode, sizeof(mode));
|
||||
if (!Genode::strcmp("nomsi", mode))
|
||||
return false;
|
||||
} catch (Genode::Xml_node::Nonexistent_attribute) { }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check device usage according to session policy
|
||||
*/
|
||||
bool permit_device(const char * name)
|
||||
@ -186,7 +201,7 @@ namespace Pci {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Check according session policy device usage
|
||||
*/
|
||||
bool permit_device(Genode::uint8_t b, Genode::uint8_t d,
|
||||
@ -504,7 +519,7 @@ namespace Pci {
|
||||
*/
|
||||
try {
|
||||
Device_component * dev = new (_device_slab) Device_component(config, config_space, _ep, this,
|
||||
!Genode::strcmp(_label.string(), "acpi_drv"));
|
||||
!Genode::strcmp(_label.string(), "acpi_drv"), msi_usage());
|
||||
|
||||
/* if more than one driver uses the device - warn about */
|
||||
if (bdf_in_use.get(Device_config::MAX_BUSES * bus +
|
||||
|
Loading…
x
Reference in New Issue
Block a user