Skip to content

Commit 1013faa

Browse files
lipengfei28xiaoxiang781216
authored andcommitted
pci: epf test default a function
Signed-off-by: lipengfei28 <[email protected]>
1 parent 581d667 commit 1013faa

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

drivers/pci/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,12 @@ config PCI_EPF_TEST
100100
---help---
101101
pci epf test driver
102102

103+
config PCI_EPF_TEST_FUNC_COUNT
104+
int "EPC Function Number"
105+
default 1
106+
range 1 8
107+
---help---
108+
This option set the epc's function number
109+
103110
endif # PCI_ENDPOINT
104111

drivers/pci/pci_epf_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838
#include <nuttx/pci/pci_ids.h>
3939
#include <nuttx/pci/pci.h>
4040
#include <nuttx/wqueue.h>
41+
#include <nuttx/nuttx.h>
4142

4243
/****************************************************************************
4344
* Pre-processor Definitions
4445
****************************************************************************/
4546

46-
#define PCI_EPF_TEST_FUNCTIONS 2
47-
4847
#define PCI_EPF_TEST_IRQ_TYPE_LEGACY 0
4948
#define PCI_EPF_TEST_IRQ_TYPE_MSI 1
5049
#define PCI_EPF_TEST_IRQ_TYPE_MSIX 2
@@ -716,14 +715,14 @@ int pci_register_epf_test_device(FAR const char *epc_name)
716715
int ret;
717716
int i;
718717

719-
epf = kmm_zalloc(sizeof(*epf) * PCI_EPF_TEST_FUNCTIONS);
718+
epf = kmm_zalloc(sizeof(*epf) * CONFIG_PCI_EPF_TEST_FUNC_COUNT);
720719
if (NULL == epf)
721720
{
722721
pcierr("create epf error\n");
723722
return -ENOMEM;
724723
}
725724

726-
for (i = 0; i < PCI_EPF_TEST_FUNCTIONS; i++)
725+
for (i = 0; i < CONFIG_PCI_EPF_TEST_FUNC_COUNT; i++)
727726
{
728727
epf[i].name = g_pci_epf_test_name[i];
729728
epf[i].epc_name = epc_name;

0 commit comments

Comments
 (0)