diff --git a/sys/mips/atheros/ar71xx_pci.c b/sys/mips/atheros/ar71xx_pci.c index 345091a188aa..000860d904c5 100644 --- a/sys/mips/atheros/ar71xx_pci.c +++ b/sys/mips/atheros/ar71xx_pci.c @@ -513,8 +513,11 @@ ar71xx_pci_maxslots(device_t dev) static int ar71xx_pci_route_interrupt(device_t pcib, device_t device, int pin) { + if (pci_get_slot(device) < AR71XX_PCI_BASE_SLOT) + panic("%s: PCI slot %d is less then AR71XX_PCI_BASE_SLOT", + __func__, pci_get_slot(device)); - return (pin); + return (pci_get_slot(device) - AR71XX_PCI_BASE_SLOT); } static device_method_t ar71xx_pci_methods[] = { diff --git a/sys/mips/atheros/ar71xxreg.h b/sys/mips/atheros/ar71xxreg.h index c5765320749f..33ae55ce51aa 100644 --- a/sys/mips/atheros/ar71xxreg.h +++ b/sys/mips/atheros/ar71xxreg.h @@ -42,6 +42,10 @@ #define AR71XX_PCI_IRQ_START 0 #define AR71XX_PCI_IRQ_END 2 #define AR71XX_PCI_NIRQS 3 +/* + * PCI devices slots are starting from this number + */ +#define AR71XX_PCI_BASE_SLOT 17 /* PCI config registers */ #define AR71XX_PCI_LCONF_CMD 0x17010000