#define get_hypercall_stubs() (0)
#endif
- static int get_callback_irq(struct pci_dev *pdev)
+ static uint64_t get_callback_via(struct pci_dev *pdev)
{
#ifdef __ia64__
- int irq;
+ int irq, rid;
for (irq = 0; irq < 16; irq++) {
if (isa_irq_to_vector(irq) == pdev->irq)
return irq;
}
- return 0;
+ /* use Requester-ID as callback_irq */
+ /* RID: '<#bus(8)><#dev(5)><#func(3)>' (cf. PCI-Express spec) */
+ rid = ((pdev->bus->number & 0xff) << 8) | pdev->devfn;
+ printk(KERN_INFO DRV_NAME ":use Requester-ID(%04x) as callback irq\n",
+ rid);
+ return rid | IA64_CALLBACK_IRQ_RID;
#else /* !__ia64__ */
- return pdev->irq;
+ if (pdev->irq < 16)
+ return pdev->irq; /* ISA IRQ */
+ /* 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));
#endif
}