Skip to content

Commit 7c3b54c

Browse files
floatiouskwilczynski
authored andcommitted
PCI: endpoint: pci-epf-test: Expose supported IRQ types in CAPS register
Expose the supported IRQ types in the CAPS register. This way, the host side driver (drivers/misc/pci_endpoint_test.c) can know which IRQ types that the endpoint supports. The host side driver will make use of this information in a follow-up commit. Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e55c678 commit 7c3b54c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
#define TIMER_RESOLUTION 1
4646

4747
#define CAP_UNALIGNED_ACCESS BIT(0)
48+
#define CAP_MSI BIT(1)
49+
#define CAP_MSIX BIT(2)
50+
#define CAP_INTX BIT(3)
4851

4952
static struct workqueue_struct *kpcitest_workqueue;
5053

@@ -753,6 +756,15 @@ static void pci_epf_test_set_capabilities(struct pci_epf *epf)
753756
if (epc->ops->align_addr)
754757
caps |= CAP_UNALIGNED_ACCESS;
755758

759+
if (epf_test->epc_features->msi_capable)
760+
caps |= CAP_MSI;
761+
762+
if (epf_test->epc_features->msix_capable)
763+
caps |= CAP_MSIX;
764+
765+
if (epf_test->epc_features->intx_capable)
766+
caps |= CAP_INTX;
767+
756768
reg->caps = cpu_to_le32(caps);
757769
}
758770

0 commit comments

Comments
 (0)