class Device
Defined at line 56 of file ../../src/devices/pci/drivers/pci/device.h
Forward declaration to avoid device.h
Public Methods
void AddRef ()
Bridge or DeviceImpl will need to implement refcounting
zx::result<uint32_t> QueryIrqMode (fuchsia_hardware_pci::InterruptMode mode)
These methods handle IRQ configuration and are generally called by the
PciProtocol methods, though they may be used to disable IRQs on
initialization as well.
Defined at line 24 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
pci_interrupt_modes_t GetInterruptModes ()
Defined at line 49 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t SetIrqMode (fuchsia_hardware_pci::InterruptMode mode, uint32_t irq_cnt)
Defined at line 65 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
template <typename V, typename R>
zx::result<V> ReadConfig (uint16_t offset)
Templated helpers to assist with differently sized protocol reads and writes.
TODO(91513): Move these back to a .cc after we no longer have both Banjo and FIDL callers for
them.
Defined at line 92 of file ../../src/devices/pci/drivers/pci/device.h
template <typename V, typename R>
zx_status_t WriteConfig (uint16_t offset, V value)
Defined at line 101 of file ../../src/devices/pci/drivers/pci/device.h
void Device (const Device & )
Disallow copying, assigning and moving.
Defined at line 125 of file ../../src/devices/pci/drivers/pci/device.h
void Device (Device && )
Disallow copying, assigning and moving.
Defined at line 125 of file ../../src/devices/pci/drivers/pci/device.h
zx_status_t Create (zx_device_t *parent,std::unique_ptr<Config> &&config,UpstreamNode *upstream,BusDeviceInterface *bdi,boolhas_acpi,boolhas_devicetree)
Create, but do not initialize, a device.
Defined at line 134 of file ../../src/devices/pci/drivers/pci/device.cc
void ~Device ()
Defined at line 120 of file ../../src/devices/pci/drivers/pci/device.cc
void Adopt ()
Bridge or DeviceImpl will need to implement refcounting
bool Release ()
Bridge or DeviceImpl will need to implement refcounting
Device & operator= (const Device & )
Disallow copying, assigning and moving.
Defined at line 125 of file ../../src/devices/pci/drivers/pci/device.h
Device & operator= (Device && )
Disallow copying, assigning and moving.
Defined at line 125 of file ../../src/devices/pci/drivers/pci/device.h
zx::result<zx::interrupt> MapInterrupt (uint32_t which_irq)
Defined at line 130 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t DisableInterrupts ()
Defined at line 105 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
fbl::Mutex * dev_lock ()
Defined at line 168 of file ../../src/devices/pci/drivers/pci/device.h
UpstreamNode * upstream ()
Defined at line 169 of file ../../src/devices/pci/drivers/pci/device.h
bool plugged_in ()
Defined at line 171 of file ../../src/devices/pci/drivers/pci/device.h
bool disabled ()
Defined at line 172 of file ../../src/devices/pci/drivers/pci/device.h
bool quirks_done ()
Defined at line 173 of file ../../src/devices/pci/drivers/pci/device.h
bool has_acpi ()
Defined at line 174 of file ../../src/devices/pci/drivers/pci/device.h
bool has_devicetree ()
Defined at line 175 of file ../../src/devices/pci/drivers/pci/device.h
bool is_bridge ()
Defined at line 176 of file ../../src/devices/pci/drivers/pci/device.h
bool is_pcie ()
Defined at line 177 of file ../../src/devices/pci/drivers/pci/device.h
uint16_t vendor_id ()
Defined at line 178 of file ../../src/devices/pci/drivers/pci/device.h
uint16_t device_id ()
Defined at line 179 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t class_id ()
Defined at line 180 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t subclass ()
Defined at line 181 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t prog_if ()
Defined at line 182 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t rev_id ()
Defined at line 183 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t bus_id ()
Defined at line 184 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t dev_id ()
Defined at line 185 of file ../../src/devices/pci/drivers/pci/device.h
uint8_t func_id ()
Defined at line 186 of file ../../src/devices/pci/drivers/pci/device.h
uint16_t segment_group ()
Defined at line 187 of file ../../src/devices/pci/drivers/pci/device.h
uint32_t bar_count ()
Defined at line 188 of file ../../src/devices/pci/drivers/pci/device.h
const Capabilities & capabilities ()
Defined at line 189 of file ../../src/devices/pci/drivers/pci/device.h
uint32_t legacy_vector ()
Defined at line 191 of file ../../src/devices/pci/drivers/pci/device.h
const zx::msi & msi_allocation ()
Defined at line 195 of file ../../src/devices/pci/drivers/pci/device.h
uint32_t packed_addr ()
A packed version of the BDF addr used for BTI identifiers by the IOMMU implementation.
Defined at line 198 of file ../../src/devices/pci/drivers/pci/device.h
zx_status_t ModifyCmd (uint16_t clr_bits, uint16_t set_bits)
Modify bits in the device's command register (in the device config space),
clearing the bits specified by clr_bits and setting the bits specified by set
bits. Specifically, the operation will be applied as...
WR(cmd, (RD(cmd)
&
~clr) | set)
Parameters
Returns
A zx_status_t indicating success or failure of the operation.
Defined at line 333 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t SetBusMastering (bool enabled)
Enable or disable bus mastering in a device's configuration.
Parameters
Returns
A zx_status_t indicating success or failure of the operation.
Defined at line 380 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t EnablePio (bool enabled)
Enable or disable PIO access in a device's configuration.
Parameters
Returns
A zx_status_t indicating success or failure of the operation.
zx_status_t EnableMmio (bool enabled)
Enable or disable MMIO access in a device's configuration.
Parameters
Returns
A zx_status_t indicating success or failure of the operation.
const std::unique_ptr<Config> & config ()
TODO(cja): port void SetQuirksDone() __TA_REQUIRES(dev_lock_) { quirks_done_ = true; }
Defined at line 166 of file ../../src/devices/pci/drivers/pci/device.h
void Unplug ()
Requests a device unplug itself from its UpstreamNode and the Bus list.
Defined at line 703 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t EnableLegacy ()
Defined at line 229 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t EnableMsi (uint32_t irq_cnt)
Defined at line 250 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t EnableMsix (uint32_t irq_cnt)
Defined at line 286 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t DisableLegacy ()
Defined at line 316 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
void DisableMsiCommon ()
Defined at line 361 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t DisableMsi ()
Defined at line 363 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t DisableMsix ()
Defined at line 377 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t SignalLegacyIrq (zx_instant_boot_t timestamp)
Signals the device's zx::interrupt, effectively triggering an interrupt for the device
driver.
Defined at line 190 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx_status_t AckLegacyIrq ()
Legacy IRQs are automatically re-armed via ZX_VIRTUAL_INTERRUPT_UNTRIGGERED;
AckLegacyIrq is a no-op.
Defined at line 194 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
void EnableLegacyIrq ()
Defined at line 205 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
void DisableLegacyIrq ()
Defined at line 210 of file ../../src/devices/pci/drivers/pci/device_irqs.cc
zx::result<PowerManagementCapability::PowerState> GetPowerState ()
Defined at line 694 of file ../../src/devices/pci/drivers/pci/device.cc
void DdkRelease ()
DDK device lifecycle methods
Defined at line 719 of file ../../src/devices/pci/drivers/pci/device.cc
void DdkUnbind (ddk::UnbindTxn txn)
Defined at line 717 of file ../../src/devices/pci/drivers/pci/device.cc
void Bind (fidl::ServerEnd<fuchsia_hardware_pci::Device> request)
Defined at line 729 of file ../../src/devices/pci/drivers/pci/device.cc
void GetDeviceInfo (GetDeviceInfoCompleter::Sync & completer)
fidl::WireServer
<fuchsia
_hardware_pci::Device> implementations
Defined at line 733 of file ../../src/devices/pci/drivers/pci/device.cc
void GetBar (GetBarRequestView request, GetBarCompleter::Sync & completer)
Defined at line 746 of file ../../src/devices/pci/drivers/pci/device.cc
void SetBusMastering (SetBusMasteringRequestView request, SetBusMasteringCompleter::Sync & completer)
Defined at line 792 of file ../../src/devices/pci/drivers/pci/device.cc
void ResetDevice (ResetDeviceCompleter::Sync & completer)
Defined at line 805 of file ../../src/devices/pci/drivers/pci/device.cc
void AckInterrupt (AckInterruptCompleter::Sync & completer)
Defined at line 810 of file ../../src/devices/pci/drivers/pci/device.cc
void MapInterrupt (MapInterruptRequestView request, MapInterruptCompleter::Sync & completer)
Defined at line 820 of file ../../src/devices/pci/drivers/pci/device.cc
void SetInterruptMode (SetInterruptModeRequestView request, SetInterruptModeCompleter::Sync & completer)
Defined at line 831 of file ../../src/devices/pci/drivers/pci/device.cc
void GetInterruptModes (GetInterruptModesCompleter::Sync & completer)
Defined at line 845 of file ../../src/devices/pci/drivers/pci/device.cc
Irqs & irqs ()
Provide Irq information to the Bus for handling situations with no ack.
Defined at line 267 of file ../../src/devices/pci/drivers/pci/device.h
std::array<std::optional<Bar>, pci::kMaxBarCount> & bars ()
Info about the BARs computed and cached during the initial setup/probe,
indexed by starting BAR register index.
Defined at line 270 of file ../../src/devices/pci/drivers/pci/device.h
BusDeviceInterface * bdi ()
Defined at line 273 of file ../../src/devices/pci/drivers/pci/device.h
void ReadConfig8 (ReadConfig8RequestView request, ReadConfig8Completer::Sync & completer)
Defined at line 853 of file ../../src/devices/pci/drivers/pci/device.cc
void ReadConfig16 (ReadConfig16RequestView request, ReadConfig16Completer::Sync & completer)
Defined at line 864 of file ../../src/devices/pci/drivers/pci/device.cc
void ReadConfig32 (ReadConfig32RequestView request, ReadConfig32Completer::Sync & completer)
Defined at line 875 of file ../../src/devices/pci/drivers/pci/device.cc
void WriteConfig8 (WriteConfig8RequestView request, WriteConfig8Completer::Sync & completer)
Defined at line 886 of file ../../src/devices/pci/drivers/pci/device.cc
void WriteConfig16 (WriteConfig16RequestView request, WriteConfig16Completer::Sync & completer)
Defined at line 897 of file ../../src/devices/pci/drivers/pci/device.cc
void WriteConfig32 (WriteConfig32RequestView request, WriteConfig32Completer::Sync & completer)
Defined at line 909 of file ../../src/devices/pci/drivers/pci/device.cc
void GetCapabilities (GetCapabilitiesRequestView request, GetCapabilitiesCompleter::Sync & completer)
Defined at line 921 of file ../../src/devices/pci/drivers/pci/device.cc
void GetExtendedCapabilities (GetExtendedCapabilitiesRequestView request, GetExtendedCapabilitiesCompleter::Sync & completer)
Defined at line 937 of file ../../src/devices/pci/drivers/pci/device.cc
void GetBti (GetBtiRequestView request, GetBtiCompleter::Sync & completer)
Defined at line 953 of file ../../src/devices/pci/drivers/pci/device.cc
Protected Methods
void Device (zx_device_t *parent,std::unique_ptr<Config> &&config,UpstreamNode *upstream,BusDeviceInterface *bdi,boolis_bridge,boolhas_acpi,boolhas_devicetree)
Devices need to exist in both the top level bus driver class, as well
as in a list for roots/bridges to track their downstream children. These
traits facilitate that for us.
Defined at line 109 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t Init ()
Defined at line 140 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t InitLocked ()
Defined at line 193 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t InitInterrupts ()
Defined at line 158 of file ../../src/devices/pci/drivers/pci/device.cc
uint16_t ReadCmdLocked ()
Read the value of the Command register, requires the dev_lock.
Defined at line 287 of file ../../src/devices/pci/drivers/pci/device.h
void AssignCmdLocked (uint16_t value)
Defined at line 293 of file ../../src/devices/pci/drivers/pci/device.h
bool IoEnabled ()
Defined at line 297 of file ../../src/devices/pci/drivers/pci/device.h
bool MmioEnabled ()
Defined at line 298 of file ../../src/devices/pci/drivers/pci/device.h
void ModifyCmdLocked (uint16_t clr_bits, uint16_t set_bits)
Defined at line 351 of file ../../src/devices/pci/drivers/pci/device.cc
zx_status_t ProbeCapabilities ()
Parse PCI Standard Capabilities starting with the pointer in the PCI
config header.
Defined at line 314 of file ../../src/devices/pci/drivers/pci/device_caps.cc
zx_status_t ParseCapabilities ()
Defined at line 144 of file ../../src/devices/pci/drivers/pci/device_caps.cc
zx_status_t ParseExtendedCapabilities ()
Defined at line 232 of file ../../src/devices/pci/drivers/pci/device_caps.cc
Records
Friends
class Root
class Bridge
class UpstreamNode