devman: detect acpi irq

git-svn-id: svn://kolibrios.org@1633 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2010-09-30 18:43:26 +00:00
parent d052c50a74
commit 4ccc803579
8 changed files with 562 additions and 7 deletions

View File

@@ -77,7 +77,7 @@ int pci_bus_read_config_word (struct pci_bus *bus, u32 devfn,
int pci_bus_read_config_dword (struct pci_bus *bus, u32 devfn,
int pos, u16 *value)
int pos, u32 *value)
{
if ( pos & 3)
return PCIBIOS_BAD_REGISTER_NUMBER;

View File

@@ -262,6 +262,31 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap)
return 0;
}
/**
* pci_swizzle_interrupt_pin - swizzle INTx for device behind bridge
* @dev: the PCI device
* @pin: the INTx pin (1=INTA, 2=INTB, 3=INTD, 4=INTD)
*
* Perform INTx swizzling for a device behind one level of bridge. This is
* required by section 9.1 of the PCI-to-PCI bridge specification for devices
* behind bridges on add-in cards. For devices with ARI enabled, the slot
* number is always 0 (see the Implementation Note in section 2.2.8.1 of
* the PCI Express Base Specification, Revision 2.1)
*/
u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin)
{
int slot;
// if (pci_ari_enabled(dev->bus))
// slot = 0;
// else
slot = PCI_SLOT(dev->devfn);
return (((pin - 1) + slot) % 4) + 1;
}
#if 0
u32 pci_probe = 0;

View File

@@ -875,9 +875,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
/* some broken boards return 0 or ~0 if a slot is empty: */
if (l == 0xffffffff || l == 0x00000000 ||
l == 0x0000ffff || l == 0xffff0000 ||
(l & 0xffff0000) == 0xffff0000 ||
(l & 0x0000ffff) == 0x0000ffff )
l == 0x0000ffff || l == 0xffff0000)
return NULL;
/* Configuration request Retry Status */