fixup-ev64120.c 848 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <linux/pci.h>
  2. #include <linux/init.h>
  3. int pci_range_ck(unsigned char bus, unsigned char dev)
  4. {
  5. if (((bus == 0) || (bus == 1)) && (dev >= 6) && (dev <= 8))
  6. return 0;
  7. return -1;
  8. }
  9. /*
  10. * After detecting all agents over the PCI , this function is called
  11. * in order to give an interrupt number for each PCI device starting
  12. * from IRQ 20. It does also enables master for each device.
  13. */
  14. void __devinit pcibios_fixup_bus(struct pci_bus *bus)
  15. {
  16. unsigned int irq = 20;
  17. struct pci_bus *current_bus = bus;
  18. struct pci_dev *dev;
  19. struct list_head *devices_link;
  20. list_for_each(devices_link, &(current_bus->devices)) {
  21. dev = pci_dev_b(devices_link);
  22. if (dev != NULL) {
  23. dev->irq = irq++;
  24. /* Assign an interrupt number for the device */
  25. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
  26. pcibios_set_master(dev);
  27. }
  28. }
  29. }