Skip to content

Commit

Permalink
pci epf use epc_node link to epc
Browse files Browse the repository at this point in the history
Signed-off-by: lipengfei28 <[email protected]>
  • Loading branch information
lipengfei28 authored and xiaoxiang781216 committed Sep 27, 2024
1 parent 06a5103 commit aa3568f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/pci/pci_epc.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ int pci_epc_add_epf(FAR struct pci_epc_ctrl_s *epc,
epf->funcno = funcno;
epf->epc = epc;

list_add_tail(&epc->epf, &epf->node);
list_add_tail(&epc->epf, &epf->epc_node);

out:
nxmutex_unlock(&epc->lock);
Expand Down Expand Up @@ -798,7 +798,7 @@ void pci_epc_linkup(FAR struct pci_epc_ctrl_s *epc)
}

nxmutex_lock(&epc->lock);
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node)
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node)
{
nxmutex_lock(&epf->lock);
if (epf->event_ops && epf->event_ops->link_up)
Expand Down Expand Up @@ -839,7 +839,7 @@ void pci_epc_linkdown(FAR struct pci_epc_ctrl_s *epc)
}

nxmutex_lock(&epc->lock);
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node)
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node)
{
nxmutex_lock(&epf->lock);
if (epf->event_ops && epf->event_ops->link_down)
Expand Down Expand Up @@ -880,7 +880,7 @@ void pci_epc_init_notify(FAR struct pci_epc_ctrl_s *epc)
}

nxmutex_lock(&epc->lock);
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node)
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node)
{
nxmutex_lock(&epf->lock);
if (epf->event_ops && epf->event_ops->core_init)
Expand Down Expand Up @@ -921,7 +921,7 @@ void pci_epc_bme_notify(FAR struct pci_epc_ctrl_s *epc)
}

nxmutex_lock(&epc->lock);
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node)
list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node)
{
nxmutex_lock(&epf->lock);
if (epf->event_ops && epf->event_ops->bme)
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pci_epf.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ int pci_epf_register_driver(FAR struct pci_epf_driver_s *drv)
continue;
}

epc = pci_get_epc(epf->name);
epc = pci_get_epc(epf->epc_name);
if (epc == NULL)
{
ret = -ENODEV;
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/pci/pci_epf.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ struct pci_epf_device_s
FAR struct pci_epf_driver_s *driver;
FAR const struct pci_epf_device_id_s *id;
struct list_node node;
struct list_node epc_node;

/* Mutex to protect against concurrent access of pci_epf_ops_s */

Expand Down

0 comments on commit aa3568f

Please sign in to comment.