Lines Matching refs:devfn

55 #define CONFIG_CMD(bus, devfn, where) \  argument
56 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
68 static inline int __query(const struct pci_bus *bus, unsigned int devfn) in __query() argument
71 return bus->number == 0 && (devfn == PCI_DEVFN(0, 0)); in __query()
74 (devfn == PCI_DEVFN(2, 0) || devfn == PCI_DEVFN(3, 0)); in __query()
82 static int pci_ampci_read_config_byte(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_byte() argument
87 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_byte()
91 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_byte()
94 if (__query(bus, devfn)) in pci_ampci_read_config_byte()
95 __pcidebug("=> %02hx", bus, devfn, where, value); in pci_ampci_read_config_byte()
102 static int pci_ampci_read_config_word(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_word() argument
107 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_word()
111 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_word()
114 if (__query(bus, devfn)) in pci_ampci_read_config_word()
115 __pcidebug("=> %04hx", bus, devfn, where, value); in pci_ampci_read_config_word()
122 static int pci_ampci_read_config_dword(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_dword() argument
127 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_dword()
131 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_dword()
134 if (__query(bus, devfn)) in pci_ampci_read_config_dword()
135 __pcidebug("=> %08x", bus, devfn, where, value); in pci_ampci_read_config_dword()
142 static int pci_ampci_write_config_byte(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_byte() argument
147 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_byte()
152 (devfn == PCI_DEVFN(2, 0) || devfn == PCI_DEVFN(3, 0)) in pci_ampci_write_config_byte()
154 __pcidebug("<= %02x", bus, devfn, where, value); in pci_ampci_write_config_byte()
155 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_byte()
162 static int pci_ampci_write_config_word(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_word() argument
167 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_word()
171 if (__query(bus, devfn)) in pci_ampci_write_config_word()
172 __pcidebug("<= %04hx", bus, devfn, where, value); in pci_ampci_write_config_word()
173 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_word()
180 static int pci_ampci_write_config_dword(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_dword() argument
185 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_dword()
189 if (__query(bus, devfn)) in pci_ampci_write_config_dword()
190 __pcidebug("<= %08x", bus, devfn, where, value); in pci_ampci_write_config_dword()
191 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_dword()
198 static int pci_ampci_read_config(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config() argument
203 return pci_ampci_read_config_byte(bus, devfn, where, val); in pci_ampci_read_config()
205 return pci_ampci_read_config_word(bus, devfn, where, val); in pci_ampci_read_config()
207 return pci_ampci_read_config_dword(bus, devfn, where, val); in pci_ampci_read_config()
214 static int pci_ampci_write_config(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config() argument
219 return pci_ampci_write_config_byte(bus, devfn, where, val); in pci_ampci_write_config()
221 return pci_ampci_write_config_word(bus, devfn, where, val); in pci_ampci_write_config()
223 return pci_ampci_write_config_dword(bus, devfn, where, val); in pci_ampci_write_config()