|
@@ -116,6 +116,7 @@ struct pci_endpoint_test {
|
|
|
struct completion irq_raised;
|
|
struct completion irq_raised;
|
|
|
int last_irq;
|
|
int last_irq;
|
|
|
int num_irqs;
|
|
int num_irqs;
|
|
|
|
|
+ int irq_type;
|
|
|
/* mutex to protect the ioctls */
|
|
/* mutex to protect the ioctls */
|
|
|
struct mutex mutex;
|
|
struct mutex mutex;
|
|
|
struct miscdevice miscdev;
|
|
struct miscdevice miscdev;
|
|
@@ -175,6 +176,7 @@ static void pci_endpoint_test_free_irq_vectors(struct pci_endpoint_test *test)
|
|
|
struct pci_dev *pdev = test->pdev;
|
|
struct pci_dev *pdev = test->pdev;
|
|
|
|
|
|
|
|
pci_free_irq_vectors(pdev);
|
|
pci_free_irq_vectors(pdev);
|
|
|
|
|
+ test->irq_type = IRQ_TYPE_UNDEFINED;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
|
|
static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
|
|
@@ -209,6 +211,8 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
|
|
|
irq = 0;
|
|
irq = 0;
|
|
|
res = false;
|
|
res = false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ test->irq_type = type;
|
|
|
test->num_irqs = irq;
|
|
test->num_irqs = irq;
|
|
|
|
|
|
|
|
return res;
|
|
return res;
|
|
@@ -348,6 +352,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, size_t size)
|
|
|
dma_addr_t orig_dst_phys_addr;
|
|
dma_addr_t orig_dst_phys_addr;
|
|
|
size_t offset;
|
|
size_t offset;
|
|
|
size_t alignment = test->alignment;
|
|
size_t alignment = test->alignment;
|
|
|
|
|
+ int irq_type = test->irq_type;
|
|
|
u32 src_crc32;
|
|
u32 src_crc32;
|
|
|
u32 dst_crc32;
|
|
u32 dst_crc32;
|
|
|
|
|
|
|
@@ -464,6 +469,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, size_t size)
|
|
|
dma_addr_t orig_phys_addr;
|
|
dma_addr_t orig_phys_addr;
|
|
|
size_t offset;
|
|
size_t offset;
|
|
|
size_t alignment = test->alignment;
|
|
size_t alignment = test->alignment;
|
|
|
|
|
+ int irq_type = test->irq_type;
|
|
|
u32 crc32;
|
|
u32 crc32;
|
|
|
|
|
|
|
|
if (size > SIZE_MAX - alignment)
|
|
if (size > SIZE_MAX - alignment)
|
|
@@ -543,6 +549,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, size_t size)
|
|
|
dma_addr_t orig_phys_addr;
|
|
dma_addr_t orig_phys_addr;
|
|
|
size_t offset;
|
|
size_t offset;
|
|
|
size_t alignment = test->alignment;
|
|
size_t alignment = test->alignment;
|
|
|
|
|
+ int irq_type = test->irq_type;
|
|
|
u32 crc32;
|
|
u32 crc32;
|
|
|
|
|
|
|
|
if (size > SIZE_MAX - alignment)
|
|
if (size > SIZE_MAX - alignment)
|
|
@@ -615,7 +622,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test,
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (irq_type == req_irq_type)
|
|
|
|
|
|
|
+ if (test->irq_type == req_irq_type)
|
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
pci_endpoint_test_release_irq(test);
|
|
pci_endpoint_test_release_irq(test);
|
|
@@ -627,12 +634,10 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test,
|
|
|
if (!pci_endpoint_test_request_irq(test))
|
|
if (!pci_endpoint_test_request_irq(test))
|
|
|
goto err;
|
|
goto err;
|
|
|
|
|
|
|
|
- irq_type = req_irq_type;
|
|
|
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
err:
|
|
err:
|
|
|
pci_endpoint_test_free_irq_vectors(test);
|
|
pci_endpoint_test_free_irq_vectors(test);
|
|
|
- irq_type = IRQ_TYPE_UNDEFINED;
|
|
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|