|
@@ -374,16 +374,29 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
|
|
|
#endif
|
|
|
|
|
|
/*
|
|
|
- * Swizzle the device pin each time we cross a bridge.
|
|
|
- * This might update pin and returns the slot number.
|
|
|
+ * Swizzle the device pin each time we cross a bridge. If a platform does
|
|
|
+ * not provide a swizzle function, we perform the standard PCI swizzling.
|
|
|
+ *
|
|
|
+ * The default swizzling walks up the bus tree one level at a time, applying
|
|
|
+ * the standard swizzle function at each step, stopping when it finds the PCI
|
|
|
+ * root bus. This will return the slot number of the bridge device on the
|
|
|
+ * root bus and the interrupt pin on that device which should correspond
|
|
|
+ * with the downstream device interrupt.
|
|
|
+ *
|
|
|
+ * Platforms may override this, in which case the slot and pin returned
|
|
|
+ * depend entirely on the platform code. However, please note that the
|
|
|
+ * PCI standard swizzle is implemented on plug-in cards and Cardbus based
|
|
|
+ * PCI extenders, so it can not be ignored.
|
|
|
*/
|
|
|
static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin)
|
|
|
{
|
|
|
struct pci_sys_data *sys = dev->sysdata;
|
|
|
- int slot = 0, oldpin = *pin;
|
|
|
+ int slot, oldpin = *pin;
|
|
|
|
|
|
if (sys->swizzle)
|
|
|
slot = sys->swizzle(dev, pin);
|
|
|
+ else
|
|
|
+ slot = pci_common_swizzle(dev, pin);
|
|
|
|
|
|
if (debug_pci)
|
|
|
printk("PCI: %s swizzling pin %d => pin %d slot %d\n",
|