Skip to content

Commit acd2886

Browse files
damien-lemoalLorenzo Pieralisi
authored andcommitted
misc: pci_endpoint_test: Use INTX instead of LEGACY
In the root complex pci endpoint test function driver, change macros and functions names using the term "legacy" to use "intx" instead to match the term used in the PCI specifications. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 5b0fbad commit acd2886

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

drivers/misc/pci_endpoint_test.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
#define DRV_MODULE_NAME "pci-endpoint-test"
2929

3030
#define IRQ_TYPE_UNDEFINED -1
31-
#define IRQ_TYPE_LEGACY 0
31+
#define IRQ_TYPE_INTX 0
3232
#define IRQ_TYPE_MSI 1
3333
#define IRQ_TYPE_MSIX 2
3434

3535
#define PCI_ENDPOINT_TEST_MAGIC 0x0
3636

3737
#define PCI_ENDPOINT_TEST_COMMAND 0x4
38-
#define COMMAND_RAISE_LEGACY_IRQ BIT(0)
38+
#define COMMAND_RAISE_INTX_IRQ BIT(0)
3939
#define COMMAND_RAISE_MSI_IRQ BIT(1)
4040
#define COMMAND_RAISE_MSIX_IRQ BIT(2)
4141
#define COMMAND_READ BIT(3)
@@ -183,8 +183,8 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
183183
bool res = true;
184184

185185
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);
188188
if (irq < 0)
189189
dev_err(dev, "Failed to get Legacy interrupt\n");
190190
break;
@@ -244,7 +244,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
244244

245245
fail:
246246
switch (irq_type) {
247-
case IRQ_TYPE_LEGACY:
247+
case IRQ_TYPE_INTX:
248248
dev_err(dev, "Failed to request IRQ %d for Legacy\n",
249249
pci_irq_vector(pdev, i));
250250
break;
@@ -291,15 +291,15 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
291291
return true;
292292
}
293293

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)
295295
{
296296
u32 val;
297297

298298
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE,
299-
IRQ_TYPE_LEGACY);
299+
IRQ_TYPE_INTX);
300300
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_NUMBER, 0);
301301
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
302-
COMMAND_RAISE_LEGACY_IRQ);
302+
COMMAND_RAISE_INTX_IRQ);
303303
val = wait_for_completion_timeout(&test->irq_raised,
304304
msecs_to_jiffies(1000));
305305
if (!val)
@@ -385,7 +385,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test,
385385
if (use_dma)
386386
flags |= FLAG_USE_DMA;
387387

388-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
388+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
389389
dev_err(dev, "Invalid IRQ type option\n");
390390
goto err;
391391
}
@@ -521,7 +521,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test,
521521
if (use_dma)
522522
flags |= FLAG_USE_DMA;
523523

524-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
524+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
525525
dev_err(dev, "Invalid IRQ type option\n");
526526
goto err;
527527
}
@@ -621,7 +621,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test,
621621
if (use_dma)
622622
flags |= FLAG_USE_DMA;
623623

624-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
624+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
625625
dev_err(dev, "Invalid IRQ type option\n");
626626
goto err;
627627
}
@@ -691,7 +691,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test,
691691
struct pci_dev *pdev = test->pdev;
692692
struct device *dev = &pdev->dev;
693693

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) {
695695
dev_err(dev, "Invalid IRQ type option\n");
696696
return false;
697697
}
@@ -737,8 +737,8 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
737737
goto ret;
738738
ret = pci_endpoint_test_bar(test, bar);
739739
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);
742742
break;
743743
case PCITEST_MSI:
744744
case PCITEST_MSIX:
@@ -801,7 +801,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
801801
test->irq_type = IRQ_TYPE_UNDEFINED;
802802

803803
if (no_msi)
804-
irq_type = IRQ_TYPE_LEGACY;
804+
irq_type = IRQ_TYPE_INTX;
805805

806806
data = (struct pci_endpoint_test_data *)ent->driver_data;
807807
if (data) {

include/uapi/linux/pcitest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#define __UAPI_LINUX_PCITEST_H
1212

1313
#define PCITEST_BAR _IO('P', 0x1)
14-
#define PCITEST_LEGACY_IRQ _IO('P', 0x2)
14+
#define PCITEST_INTX_IRQ _IO('P', 0x2)
15+
#define PCITEST_LEGACY_IRQ PCITEST_INTX_IRQ
1516
#define PCITEST_MSI _IOW('P', 0x3, int)
1617
#define PCITEST_WRITE _IOW('P', 0x4, unsigned long)
1718
#define PCITEST_READ _IOW('P', 0x5, unsigned long)

0 commit comments

Comments
 (0)