|
28 | 28 | #define DRV_MODULE_NAME "pci-endpoint-test" |
29 | 29 |
|
30 | 30 | #define IRQ_TYPE_UNDEFINED -1 |
31 | | -#define IRQ_TYPE_LEGACY 0 |
| 31 | +#define IRQ_TYPE_INTX 0 |
32 | 32 | #define IRQ_TYPE_MSI 1 |
33 | 33 | #define IRQ_TYPE_MSIX 2 |
34 | 34 |
|
35 | 35 | #define PCI_ENDPOINT_TEST_MAGIC 0x0 |
36 | 36 |
|
37 | 37 | #define PCI_ENDPOINT_TEST_COMMAND 0x4 |
38 | | -#define COMMAND_RAISE_LEGACY_IRQ BIT(0) |
| 38 | +#define COMMAND_RAISE_INTX_IRQ BIT(0) |
39 | 39 | #define COMMAND_RAISE_MSI_IRQ BIT(1) |
40 | 40 | #define COMMAND_RAISE_MSIX_IRQ BIT(2) |
41 | 41 | #define COMMAND_READ BIT(3) |
@@ -183,8 +183,8 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, |
183 | 183 | bool res = true; |
184 | 184 |
|
185 | 185 | switch (type) { |
186 | | - case IRQ_TYPE_LEGACY: |
187 | | - irq = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); |
| 186 | + case IRQ_TYPE_INTX: |
| 187 | + irq = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX); |
188 | 188 | if (irq < 0) |
189 | 189 | dev_err(dev, "Failed to get Legacy interrupt\n"); |
190 | 190 | break; |
@@ -244,7 +244,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) |
244 | 244 |
|
245 | 245 | fail: |
246 | 246 | switch (irq_type) { |
247 | | - case IRQ_TYPE_LEGACY: |
| 247 | + case IRQ_TYPE_INTX: |
248 | 248 | dev_err(dev, "Failed to request IRQ %d for Legacy\n", |
249 | 249 | pci_irq_vector(pdev, i)); |
250 | 250 | break; |
@@ -291,15 +291,15 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, |
291 | 291 | return true; |
292 | 292 | } |
293 | 293 |
|
294 | | -static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test) |
| 294 | +static bool pci_endpoint_test_intx_irq(struct pci_endpoint_test *test) |
295 | 295 | { |
296 | 296 | u32 val; |
297 | 297 |
|
298 | 298 | pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE, |
299 | | - IRQ_TYPE_LEGACY); |
| 299 | + IRQ_TYPE_INTX); |
300 | 300 | pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_NUMBER, 0); |
301 | 301 | pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND, |
302 | | - COMMAND_RAISE_LEGACY_IRQ); |
| 302 | + COMMAND_RAISE_INTX_IRQ); |
303 | 303 | val = wait_for_completion_timeout(&test->irq_raised, |
304 | 304 | msecs_to_jiffies(1000)); |
305 | 305 | if (!val) |
@@ -385,7 +385,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, |
385 | 385 | if (use_dma) |
386 | 386 | flags |= FLAG_USE_DMA; |
387 | 387 |
|
388 | | - if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { |
| 388 | + if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) { |
389 | 389 | dev_err(dev, "Invalid IRQ type option\n"); |
390 | 390 | goto err; |
391 | 391 | } |
@@ -521,7 +521,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, |
521 | 521 | if (use_dma) |
522 | 522 | flags |= FLAG_USE_DMA; |
523 | 523 |
|
524 | | - if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { |
| 524 | + if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) { |
525 | 525 | dev_err(dev, "Invalid IRQ type option\n"); |
526 | 526 | goto err; |
527 | 527 | } |
@@ -621,7 +621,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, |
621 | 621 | if (use_dma) |
622 | 622 | flags |= FLAG_USE_DMA; |
623 | 623 |
|
624 | | - if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { |
| 624 | + if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) { |
625 | 625 | dev_err(dev, "Invalid IRQ type option\n"); |
626 | 626 | goto err; |
627 | 627 | } |
@@ -691,7 +691,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, |
691 | 691 | struct pci_dev *pdev = test->pdev; |
692 | 692 | struct device *dev = &pdev->dev; |
693 | 693 |
|
694 | | - if (req_irq_type < IRQ_TYPE_LEGACY || req_irq_type > IRQ_TYPE_MSIX) { |
| 694 | + if (req_irq_type < IRQ_TYPE_INTX || req_irq_type > IRQ_TYPE_MSIX) { |
695 | 695 | dev_err(dev, "Invalid IRQ type option\n"); |
696 | 696 | return false; |
697 | 697 | } |
@@ -737,8 +737,8 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd, |
737 | 737 | goto ret; |
738 | 738 | ret = pci_endpoint_test_bar(test, bar); |
739 | 739 | break; |
740 | | - case PCITEST_LEGACY_IRQ: |
741 | | - ret = pci_endpoint_test_legacy_irq(test); |
| 740 | + case PCITEST_INTX_IRQ: |
| 741 | + ret = pci_endpoint_test_intx_irq(test); |
742 | 742 | break; |
743 | 743 | case PCITEST_MSI: |
744 | 744 | case PCITEST_MSIX: |
@@ -801,7 +801,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, |
801 | 801 | test->irq_type = IRQ_TYPE_UNDEFINED; |
802 | 802 |
|
803 | 803 | if (no_msi) |
804 | | - irq_type = IRQ_TYPE_LEGACY; |
| 804 | + irq_type = IRQ_TYPE_INTX; |
805 | 805 |
|
806 | 806 | data = (struct pci_endpoint_test_data *)ent->driver_data; |
807 | 807 | if (data) { |
|
0 commit comments