Skip to content

Commit

Permalink
pci: add pci endpoint test driver
Browse files Browse the repository at this point in the history
Signed-off-by: yezhonghui <[email protected]>
  • Loading branch information
yezhonghui2024 authored and xiaoxiang781216 committed Sep 28, 2024
1 parent 9a84484 commit f6db814
Show file tree
Hide file tree
Showing 8 changed files with 903 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ if(CONFIG_PCI_ENDPOINT)
list(APPEND SRCS pci_epf_test.c)
endif() # CONFIG_PCI_EPF_TEST

if(CONFIG_PCI_EP_TEST)
list(APPEND SRCS pci_ep_test.c)
endif() # CONFIG_PCI_ENDPOINT_TEST

target_sources(drivers PRIVATE ${SRCS})

endif() # CONFIG_PCI_ENDPOINT
5 changes: 5 additions & 0 deletions drivers/pci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,10 @@ config PCI_EPF_TEST
---help---
pci epf test driver

config PCI_EP_TEST
bool "PCI endpoint test"
---help---
pci endpoint test driver

endif # PCI_ENDPOINT

4 changes: 4 additions & 0 deletions drivers/pci/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ ifeq ($(CONFIG_PCI_EPF_TEST),y)
CSRCS += pci_epf_test.c
endif

ifeq ($(CONFIG_PCI_EP_TEST),y)
CSRCS += pci_ep_test.c
endif

# Include PCI device driver build support

DEPPATH += --dep-path pci
Expand Down
8 changes: 8 additions & 0 deletions drivers/pci/pci_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ int pci_register_drivers(void)
}
#endif

#ifdef CONFIG_PCI_EP_TEST
ret = pci_register_ep_test_driver();
if (ret < 0)
{
pcierr("pci_register_ep_test_driver failed, ret=%d\n", ret);
}
#endif

/* Initialization e1000 driver */

#ifdef CONFIG_NET_E1000
Expand Down
12 changes: 12 additions & 0 deletions drivers/pci/pci_drivers.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,16 @@ int pci_register_qemu_epc_driver(void);
int pci_register_epf_test_driver(void);
#endif

/****************************************************************************
* Name: pci_register_ep_test_driver
*
* Description:
* Register endpoint test device pci driver
*
****************************************************************************/

#ifdef CONFIG_PCI_EP_TEST
int pci_register_ep_test_driver(void);
#endif

#endif /* __DRIVERS_PCI_PCI_DRIVERS_H */
Loading

0 comments on commit f6db814

Please sign in to comment.