Lines Matching refs:cap
18 static void ReadVirtioCap(pci_protocol_t* pci, uint8_t offset, virtio_pci_cap& cap) { in ReadVirtioCap() argument
19 pci_config_read8(pci, cap_field(offset, cap_vndr), &cap.cap_vndr); in ReadVirtioCap()
20 pci_config_read8(pci, cap_field(offset, cap_next), &cap.cap_next); in ReadVirtioCap()
21 pci_config_read8(pci, cap_field(offset, cap_len), &cap.cap_len); in ReadVirtioCap()
22 pci_config_read8(pci, cap_field(offset, cfg_type), &cap.cfg_type); in ReadVirtioCap()
23 pci_config_read8(pci, cap_field(offset, bar), &cap.bar); in ReadVirtioCap()
24 pci_config_read32(pci, cap_field(offset, offset), &cap.offset); in ReadVirtioCap()
25 pci_config_read32(pci, cap_field(offset, length), &cap.length); in ReadVirtioCap()
101 virtio_pci_cap_t cap; in Init() local
103 ReadVirtioCap(&pci_, off, cap); in Init()
104 switch (cap.cfg_type) { in Init()
106 CommonCfgCallbackLocked(cap); in Init()
113 NotifyCfgCallbackLocked(cap); in Init()
116 IsrCfgCallbackLocked(cap); in Init()
119 DeviceCfgCallbackLocked(cap); in Init()
122 PciCfgCallbackLocked(cap); in Init()
202 void PciModernBackend::CommonCfgCallbackLocked(const virtio_pci_cap_t& cap) { in CommonCfgCallbackLocked() argument
203 zxlogf(TRACE, "%s: common cfg found in bar %u offset %#x\n", tag(), cap.bar, cap.offset); in CommonCfgCallbackLocked()
204 if (MapBar(cap.bar) != ZX_OK) { in CommonCfgCallbackLocked()
210 auto addr = reinterpret_cast<uintptr_t>(bar_[cap.bar]->get()) + cap.offset; in CommonCfgCallbackLocked()
216 void PciModernBackend::NotifyCfgCallbackLocked(const virtio_pci_cap_t& cap) { in NotifyCfgCallbackLocked() argument
217 zxlogf(TRACE, "%s: notify cfg found in bar %u offset %#x\n", tag(), cap.bar, cap.offset); in NotifyCfgCallbackLocked()
218 if (MapBar(cap.bar) != ZX_OK) { in NotifyCfgCallbackLocked()
222 notify_base_ = reinterpret_cast<uintptr_t>(bar_[cap.bar]->get()) + cap.offset; in NotifyCfgCallbackLocked()
225 void PciModernBackend::IsrCfgCallbackLocked(const virtio_pci_cap_t& cap) { in IsrCfgCallbackLocked() argument
226 zxlogf(TRACE, "%s: isr cfg found in bar %u offset %#x\n", tag(), cap.bar, cap.offset); in IsrCfgCallbackLocked()
227 if (MapBar(cap.bar) != ZX_OK) { in IsrCfgCallbackLocked()
233 reinterpret_cast<uintptr_t>(bar_[cap.bar]->get()) + cap.offset); in IsrCfgCallbackLocked()
236 void PciModernBackend::DeviceCfgCallbackLocked(const virtio_pci_cap_t& cap) { in DeviceCfgCallbackLocked() argument
237 zxlogf(TRACE, "%s: device cfg found in bar %u offset %#x\n", tag(), cap.bar, cap.offset); in DeviceCfgCallbackLocked()
238 if (MapBar(cap.bar) != ZX_OK) { in DeviceCfgCallbackLocked()
242 device_cfg_ = reinterpret_cast<uintptr_t>(bar_[cap.bar]->get()) + cap.offset; in DeviceCfgCallbackLocked()
245 void PciModernBackend::PciCfgCallbackLocked(const virtio_pci_cap_t& cap) { in PciCfgCallbackLocked() argument