usb: effectively request all IRQ capabilities

Thanks @alex-ab for the remote help.
This commit is contained in:
Christian Helmuth 2015-06-14 18:29:46 +02:00
parent 7dd156c8b6
commit 1f62446b65

View File

@ -94,6 +94,15 @@ class Io_port
};
/**
* Virtual IRQ number (monotonically increasing)
*/
static unsigned virq_num()
{
static unsigned instance = 128;
return ++instance;
}
/**
* Scan PCI bus and probe for HCDs
*/
@ -139,8 +148,15 @@ class Pci_driver : public Genode::List<Pci_driver>::Element
_dev->dev.dma_mask = &dma_mask;
_dev->dev.coherent_dma_mask = ~0;
/* read interrupt line */
_dev->irq = client.config_read(IRQ, Device::ACCESS_8BIT);
/*
* We initialize the IRQ line with a virtual number to ensure that
* each device gets a unique number and, hence, requests its
* associated IRQ capability at the platform driver. Consequently,
* we give a away the questionable option to implement IRQ sharing
* locally and leave it to the platform driver, which just uses
* signalling anyway.
*/
_dev->irq = virq_num();
/* hide ourselfs in bus structure */
_dev->bus = (struct pci_bus *)this;