msi.c 974 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/msi.h>
  11. #include <asm/machdep.h>
  12. int arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
  13. {
  14. if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {
  15. pr_debug("msi: Platform doesn't provide MSI callbacks.\n");
  16. return -ENOSYS;
  17. }
  18. if (ppc_md.msi_check_device) {
  19. pr_debug("msi: Using platform check routine.\n");
  20. return ppc_md.msi_check_device(dev, nvec, type);
  21. }
  22. return 0;
  23. }
  24. int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
  25. {
  26. return ppc_md.setup_msi_irqs(dev, nvec, type);
  27. }
  28. void arch_teardown_msi_irqs(struct pci_dev *dev)
  29. {
  30. ppc_md.teardown_msi_irqs(dev);
  31. }