iPXE
Data Structures | Functions
pcibridge.h File Reference

PCI-to-PCI bridge. More...

#include <stdint.h>
#include <ipxe/list.h>
#include <ipxe/pci.h>

Go to the source code of this file.

Data Structures

struct  pci_bridge
 A PCI-to-PCI bridge. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
struct pci_bridgepcibridge_find (struct pci_device *pci)
 Find bridge attached to a PCI device. More...
 

Detailed Description

PCI-to-PCI bridge.

Definition in file pcibridge.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ pcibridge_find()

struct pci_bridge* pcibridge_find ( struct pci_device pci)

Find bridge attached to a PCI device.

Parameters
pciPCI device
Return values
bridgePCI bridge, or NULL

Definition at line 48 of file pcibridge.c.

48  {
49  unsigned int bus = PCI_BUS ( pci->busdevfn );
50  struct pci_bridge *bridge;
51 
52  /* Find matching bridge */
53  list_for_each_entry ( bridge, &pcibridges, list ) {
54  if ( bus == bridge->secondary )
55  return bridge;
56  }
57 
58  return NULL;
59 }
#define PCI_BUS(busdevfn)
Definition: pci.h:279
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:431
A PCI-to-PCI bridge.
Definition: pcibridge.h:17
uint8_t secondary
Secondary bus.
Definition: pcibridge.h:28
uint32_t busdevfn
Segment, bus, device, and function (bus:dev.fn) number.
Definition: pci.h:233
struct list_head list
List of bridges.
Definition: pcibridge.h:38
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
uint8_t bus
Bus.
Definition: edd.h:14

References bus, pci_device::busdevfn, pci_bridge::list, list_for_each_entry, NULL, pci_bridge::pci, PCI_BUS, and pci_bridge::secondary.

Referenced by ena_membase().