diff options
Diffstat (limited to 'drivers/vfio/pci/vfio_pci.c')
-rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 8189cb6a86af..05afe883f038 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -70,7 +70,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) | |||
70 | pci_write_config_word(pdev, PCI_COMMAND, cmd); | 70 | pci_write_config_word(pdev, PCI_COMMAND, cmd); |
71 | } | 71 | } |
72 | 72 | ||
73 | msix_pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX); | 73 | msix_pos = pdev->msix_cap; |
74 | if (msix_pos) { | 74 | if (msix_pos) { |
75 | u16 flags; | 75 | u16 flags; |
76 | u32 table; | 76 | u32 table; |
@@ -78,8 +78,8 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev) | |||
78 | pci_read_config_word(pdev, msix_pos + PCI_MSIX_FLAGS, &flags); | 78 | pci_read_config_word(pdev, msix_pos + PCI_MSIX_FLAGS, &flags); |
79 | pci_read_config_dword(pdev, msix_pos + PCI_MSIX_TABLE, &table); | 79 | pci_read_config_dword(pdev, msix_pos + PCI_MSIX_TABLE, &table); |
80 | 80 | ||
81 | vdev->msix_bar = table & PCI_MSIX_FLAGS_BIRMASK; | 81 | vdev->msix_bar = table & PCI_MSIX_TABLE_BIR; |
82 | vdev->msix_offset = table & ~PCI_MSIX_FLAGS_BIRMASK; | 82 | vdev->msix_offset = table & PCI_MSIX_TABLE_OFFSET; |
83 | vdev->msix_size = ((flags & PCI_MSIX_FLAGS_QSIZE) + 1) * 16; | 83 | vdev->msix_size = ((flags & PCI_MSIX_FLAGS_QSIZE) + 1) * 16; |
84 | } else | 84 | } else |
85 | vdev->msix_bar = 0xFF; | 85 | vdev->msix_bar = 0xFF; |
@@ -183,7 +183,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type) | |||
183 | u8 pos; | 183 | u8 pos; |
184 | u16 flags; | 184 | u16 flags; |
185 | 185 | ||
186 | pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSI); | 186 | pos = vdev->pdev->msi_cap; |
187 | if (pos) { | 187 | if (pos) { |
188 | pci_read_config_word(vdev->pdev, | 188 | pci_read_config_word(vdev->pdev, |
189 | pos + PCI_MSI_FLAGS, &flags); | 189 | pos + PCI_MSI_FLAGS, &flags); |
@@ -194,7 +194,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type) | |||
194 | u8 pos; | 194 | u8 pos; |
195 | u16 flags; | 195 | u16 flags; |
196 | 196 | ||
197 | pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSIX); | 197 | pos = vdev->pdev->msix_cap; |
198 | if (pos) { | 198 | if (pos) { |
199 | pci_read_config_word(vdev->pdev, | 199 | pci_read_config_word(vdev->pdev, |
200 | pos + PCI_MSIX_FLAGS, &flags); | 200 | pos + PCI_MSIX_FLAGS, &flags); |