diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 30de51fcd68c..26938da8f438 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -25,6 +25,51 @@ | |||
25 | 25 | ||
26 | static int pci_msi_enable = 1; | 26 | static int pci_msi_enable = 1; |
27 | 27 | ||
28 | /* Arch hooks */ | ||
29 | |||
30 | int __attribute__ ((weak)) | ||
31 | arch_msi_check_device(struct pci_dev *dev, int nvec, int type) | ||
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | int __attribute__ ((weak)) | ||
37 | arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | int __attribute__ ((weak)) | ||
43 | arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
44 | { | ||
45 | struct msi_desc *entry; | ||
46 | int ret; | ||
47 | |||
48 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
49 | ret = arch_setup_msi_irq(dev, entry); | ||
50 | if (ret) | ||
51 | return ret; | ||
52 | } | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq) | ||
58 | { | ||
59 | return; | ||
60 | } | ||
61 | |||
62 | void __attribute__ ((weak)) | ||
63 | arch_teardown_msi_irqs(struct pci_dev *dev) | ||
64 | { | ||
65 | struct msi_desc *entry; | ||
66 | |||
67 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
68 | if (entry->irq != 0) | ||
69 | arch_teardown_msi_irq(entry->irq); | ||
70 | } | ||
71 | } | ||
72 | |||
28 | static void msi_set_enable(struct pci_dev *dev, int enable) | 73 | static void msi_set_enable(struct pci_dev *dev, int enable) |
29 | { | 74 | { |
30 | int pos; | 75 | int pos; |
@@ -682,49 +727,3 @@ void pci_msi_init_pci_dev(struct pci_dev *dev) | |||
682 | { | 727 | { |
683 | INIT_LIST_HEAD(&dev->msi_list); | 728 | INIT_LIST_HEAD(&dev->msi_list); |
684 | } | 729 | } |
685 | |||
686 | |||
687 | /* Arch hooks */ | ||
688 | |||
689 | int __attribute__ ((weak)) | ||
690 | arch_msi_check_device(struct pci_dev* dev, int nvec, int type) | ||
691 | { | ||
692 | return 0; | ||
693 | } | ||
694 | |||
695 | int __attribute__ ((weak)) | ||
696 | arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry) | ||
697 | { | ||
698 | return 0; | ||
699 | } | ||
700 | |||
701 | int __attribute__ ((weak)) | ||
702 | arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
703 | { | ||
704 | struct msi_desc *entry; | ||
705 | int ret; | ||
706 | |||
707 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
708 | ret = arch_setup_msi_irq(dev, entry); | ||
709 | if (ret) | ||
710 | return ret; | ||
711 | } | ||
712 | |||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq) | ||
717 | { | ||
718 | return; | ||
719 | } | ||
720 | |||
721 | void __attribute__ ((weak)) | ||
722 | arch_teardown_msi_irqs(struct pci_dev *dev) | ||
723 | { | ||
724 | struct msi_desc *entry; | ||
725 | |||
726 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
727 | if (entry->irq != 0) | ||
728 | arch_teardown_msi_irq(entry->irq); | ||
729 | } | ||
730 | } | ||