Lines Matching refs:devfn
25 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
27 static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
33 if (bus == 0 && devfn == 0)
40 u8 bus, u8 devfn, int offset)
42 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset);
45 static inline int is_root_port(int busno, int devfn)
47 return ((busno == 0) && (PCI_FUNC(devfn) < 4) &&
48 ((PCI_SLOT(devfn) == 16) || (PCI_SLOT(devfn) == 17)));
57 static int workaround_5945(struct pci_bus *bus, unsigned int devfn,
65 if (!is_root_port(bus->number, devfn) || !is_5945_reg(offset))
70 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset & ~0x3);
77 dummy = pa_pxp_cfg_addr(hose, bus->number, devfn, 0x10);
155 static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
165 if (!pa_pxp_offset_valid(bus->number, devfn, offset))
168 if (workaround_5945(bus, devfn, offset, len, val))
171 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
194 static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
204 if (!pa_pxp_offset_valid(bus->number, devfn, offset))
207 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
296 return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn, offset);