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