diff options
author | Ian Campbell <ian.campbell@xensource.com> | 2007-01-22 17:10:27 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@xensource.com> | 2007-01-22 17:10:27 +0000 |
commit | e22738def91bffee104e7a45446a26746981cbd4 (patch) | |
tree | 4930ce0177574fff8953f75ce8b73c8e391829b8 /unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | |
parent | efa2dca17ae5e5807183e3da21e21cfec6776e4b (diff) | |
download | xen-e22738def91bffee104e7a45446a26746981cbd4.tar.gz xen-e22738def91bffee104e7a45446a26746981cbd4.tar.bz2 xen-e22738def91bffee104e7a45446a26746981cbd4.zip |
[PV-on-HVM] Make PV drivers on HVM kernels work on older kernels after
update to 2.6.18.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Diffstat (limited to 'unmodified_drivers/linux-2.6/platform-pci/platform-pci.c')
-rw-r--r-- | unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c index 321a166d05..7973f86820 100644 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c @@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); unsigned long *phys_to_machine_mapping; EXPORT_SYMBOL(phys_to_machine_mapping); -static int __init init_xen_info(void) +static int __devinit init_xen_info(void) { unsigned long shared_info_frame; struct xen_add_to_physmap xatp; @@ -194,14 +194,23 @@ static uint64_t get_callback_via(struct pci_dev *pdev) rid); return rid | IA64_CALLBACK_IRQ_RID; #else /* !__ia64__ */ + u8 pin; + if (pdev->irq < 16) return pdev->irq; /* ISA IRQ */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + pin = pdev->pin; +#else + pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); +#endif + /* We don't know the GSI. Specify the PCI INTx line instead. */ return (((uint64_t)0x01 << 56) | /* PCI INTx identifier */ ((uint64_t)pci_domain_nr(pdev->bus) << 32) | ((uint64_t)pdev->bus->number << 16) | ((uint64_t)(pdev->devfn & 0xff) << 8) | - ((uint64_t)(pdev->pin - 1) & 3)); + ((uint64_t)(pin - 1) & 3)); #endif } |