class FakePciProtocolInternal
Defined at line 26 of file ../../src/devices/pci/testing/protocol/internal.h
Public Members
static const uint8_t kPciExpressCapabilitySize
Public Methods
void FakePciProtocolInternal ()
Defined at line 20 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetBar (uint32_t bar_id, pci_bar_t * out_res)
Defined at line 28 of file ../../src/devices/pci/testing/protocol/internal.cc
void ~FakePciProtocolInternal ()
Defined at line 31 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciReadConfig8 (uint16_t offset, uint8_t * out_value)
Defined at line 42 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciReadConfig16 (uint16_t offset, uint16_t * out_value)
Defined at line 46 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciReadConfig32 (uint16_t offset, uint32_t * out_value)
Defined at line 50 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciWriteConfig8 (uint16_t offset, uint8_t value)
Defined at line 54 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciWriteConfig16 (uint16_t offset, uint16_t value)
Defined at line 56 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciAckInterrupt ()
Defined at line 59 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciWriteConfig32 (uint16_t offset, uint32_t value)
Defined at line 60 of file ../../src/devices/pci/testing/protocol/internal.h
zx_status_t PciMapInterrupt (uint32_t which_irq, zx::interrupt * out_handle)
Defined at line 63 of file ../../src/devices/pci/testing/protocol/internal.cc
void PciGetInterruptModes (fuchsia_hardware_pci::wire::InterruptModes * modes)
Defined at line 93 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciSetInterruptMode (fuchsia_hardware_pci::InterruptMode mode, uint32_t requested_irq_count)
Defined at line 110 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciSetBusMastering (bool enable)
Defined at line 162 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciResetDevice ()
Defined at line 167 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetDeviceInfo (pci_device_info_t * out_info)
Defined at line 172 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetFirstCapability (uint8_t id, uint8_t * out_offset)
Defined at line 186 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetNextCapability (uint8_t id, uint8_t offset, uint8_t * out_offset)
Defined at line 190 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetFirstExtendedCapability (uint16_t id, uint16_t * out_offset)
Defined at line 195 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetNextExtendedCapability (uint16_t id, uint16_t offset, uint16_t * out_offset)
Defined at line 200 of file ../../src/devices/pci/testing/protocol/internal.cc
zx_status_t PciGetBti (uint32_t index, zx::bti * out_bti)
Defined at line 205 of file ../../src/devices/pci/testing/protocol/internal.cc
Protected Methods
fuchsia_hardware_pci::InterruptMode irq_mode ()
Defined at line 103 of file ../../src/devices/pci/testing/protocol/internal.h
uint32_t irq_cnt ()
Defined at line 104 of file ../../src/devices/pci/testing/protocol/internal.h
std::array<FakeBar, 6> & bars ()
Defined at line 105 of file ../../src/devices/pci/testing/protocol/internal.h
std::vector<FakeCapability> & capabilities ()
Defined at line 106 of file ../../src/devices/pci/testing/protocol/internal.h
uint32_t reset_cnt ()
Defined at line 108 of file ../../src/devices/pci/testing/protocol/internal.h
std::optional<bool> bus_master_en ()
Defined at line 109 of file ../../src/devices/pci/testing/protocol/internal.h
fuchsia_hardware_pci::wire::DeviceInfo & info ()
Defined at line 110 of file ../../src/devices/pci/testing/protocol/internal.h
zx::vmo & config ()
Defined at line 111 of file ../../src/devices/pci/testing/protocol/internal.h
void AddCapabilityInternal (uint8_t capability_id, uint8_t position, uint8_t size)
Capabilities are the hardest part to implement because if a device expects a capability
at a given address in configuration space then it's possible they will want to write to it.
Additionally, vendor capabilities are of a variable size which is read from the capability
at runtime. To further complicate things, particular devices will have registers in their
configuration space that the device may be expected to use but which are not exposed
through any PCI base address register mechanism. This makes it risky to lay out a
capability wherever we wish for fear it may overlap with one of these spaces. For this
reason we do no validation of the capability's setup in configuration space besides writing
the capability id and next pointer. The test author is responsible for setting up the
layout of the capabilities as necessary to match their device, but we can provide helper
methods to ensure they're doing it properly.
Defined at line 212 of file ../../src/devices/pci/testing/protocol/internal.cc
void AddCapabilityInternal (fuchsia_hardware_pci::CapabilityId capability_id, uint8_t position, uint8_t size)
Defined at line 247 of file ../../src/devices/pci/testing/protocol/internal.cc
zx::interrupt & AddInterrupt (fuchsia_hardware_pci::InterruptMode mode)
Defined at line 252 of file ../../src/devices/pci/testing/protocol/internal.cc
fuchsia_hardware_pci::wire::DeviceInfo SetDeviceInfoInternal (fuchsia_hardware_pci::wire::DeviceInfo new_info)
Defined at line 283 of file ../../src/devices/pci/testing/protocol/internal.cc
void reset ()
Defined at line 302 of file ../../src/devices/pci/testing/protocol/internal.cc