Lines Matching refs:devfn
26 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
28 static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
34 if (bus == 0 && devfn == 0)
41 u8 bus, u8 devfn, int offset)
43 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset);
46 static inline int is_root_port(int busno, int devfn)
48 return ((busno == 0) && (PCI_FUNC(devfn) < 4) &&
49 ((PCI_SLOT(devfn) == 16) || (PCI_SLOT(devfn) == 17)));
58 static int workaround_5945(struct pci_bus *bus, unsigned int devfn,
66 if (!is_root_port(bus->number, devfn) || !is_5945_reg(offset))
71 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset & ~0x3);
78 dummy = pa_pxp_cfg_addr(hose, bus->number, devfn, 0x10);
156 static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
166 if (!pa_pxp_offset_valid(bus->number, devfn, offset))
169 if (workaround_5945(bus, devfn, offset, len, val))
172 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
195 static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
205 if (!pa_pxp_offset_valid(bus->number, devfn, offset))
208 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
293 return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn, offset);