pci: epf test default a function

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
This commit is contained in:
lipengfei28 2025-08-13 11:18:43 +08:00 committed by Xiang Xiao
parent 581d667f72
commit 1013faac30
2 changed files with 10 additions and 4 deletions

View file

@ -100,5 +100,12 @@ config PCI_EPF_TEST
---help---
pci epf test driver
config PCI_EPF_TEST_FUNC_COUNT
int "EPC Function Number"
default 1
range 1 8
---help---
This option set the epc's function number
endif # PCI_ENDPOINT

View file

@ -38,13 +38,12 @@
#include <nuttx/pci/pci_ids.h>
#include <nuttx/pci/pci.h>
#include <nuttx/wqueue.h>
#include <nuttx/nuttx.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define PCI_EPF_TEST_FUNCTIONS 2
#define PCI_EPF_TEST_IRQ_TYPE_LEGACY 0
#define PCI_EPF_TEST_IRQ_TYPE_MSI 1
#define PCI_EPF_TEST_IRQ_TYPE_MSIX 2
@ -716,14 +715,14 @@ int pci_register_epf_test_device(FAR const char *epc_name)
int ret;
int i;
epf = kmm_zalloc(sizeof(*epf) * PCI_EPF_TEST_FUNCTIONS);
epf = kmm_zalloc(sizeof(*epf) * CONFIG_PCI_EPF_TEST_FUNC_COUNT);
if (NULL == epf)
{
pcierr("create epf error\n");
return -ENOMEM;
}
for (i = 0; i < PCI_EPF_TEST_FUNCTIONS; i++)
for (i = 0; i < CONFIG_PCI_EPF_TEST_FUNC_COUNT; i++)
{
epf[i].name = g_pci_epf_test_name[i];
epf[i].epc_name = epc_name;