Lines Matching refs:coff
163 static void pci_cfgrw(int in, int bus, int slot, int func, int coff,
167 CFGWRITE(struct pci_devinst *pi, int coff, uint32_t val, int bytes) in CFGWRITE() argument
171 pci_set_cfgdata8(pi, coff, val); in CFGWRITE()
173 pci_set_cfgdata16(pi, coff, val); in CFGWRITE()
175 pci_set_cfgdata32(pi, coff, val); in CFGWRITE()
179 CFGREAD(struct pci_devinst *pi, int coff, int bytes) in CFGREAD() argument
183 return (pci_get_cfgdata8(pi, coff)); in CFGREAD()
185 return (pci_get_cfgdata16(pi, coff)); in CFGREAD()
187 return (pci_get_cfgdata32(pi, coff)); in CFGREAD()
191 is_pcir_bar(int coff) in is_pcir_bar() argument
193 return (coff >= PCIR_BAR(0) && coff < PCIR_BAR(PCI_BARMAX + 1)); in is_pcir_bar()
197 is_pcir_bios(int coff) in is_pcir_bios() argument
199 return (coff >= PCIR_BIOS && coff < PCIR_BIOS + 4); in is_pcir_bios()
1471 int bus, slot, func, coff, in; in pci_emul_ecfg_handler() local
1473 coff = addr & 0xfff; in pci_emul_ecfg_handler()
1480 pci_cfgrw(in, bus, slot, func, coff, bytes, (uint32_t *)val); in pci_emul_ecfg_handler()
2237 pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes) in pci_emul_cmdsts_write() argument
2251 rshift = (coff & 0x3) * 8; in pci_emul_cmdsts_write()
2254 old = CFGREAD(pi, coff, bytes); in pci_emul_cmdsts_write()
2257 CFGWRITE(pi, coff, new, bytes); /* update config */ in pci_emul_cmdsts_write()
2263 pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, in pci_cfgrw() argument
2284 (coff & (bytes - 1)) != 0) { in pci_cfgrw()
2294 if (coff >= PCI_REGMAX + 1) { in pci_cfgrw()
2303 if (coff <= PCI_REGMAX + 4) in pci_cfgrw()
2317 needcfg = pe->pe_cfgread(pi, coff, bytes, valp); in pci_cfgrw()
2323 *valp = CFGREAD(pi, coff, bytes); in pci_cfgrw()
2325 pci_emul_hdrtype_fixup(bus, slot, coff, bytes, valp); in pci_cfgrw()
2329 (*pe->pe_cfgwrite)(pi, coff, bytes, *valp) == 0) in pci_cfgrw()
2335 if (is_pcir_bar(coff) || is_pcir_bios(coff)) { in pci_cfgrw()
2340 if (bytes != 4 || (coff & 0x3) != 0) in pci_cfgrw()
2343 if (is_pcir_bar(coff)) { in pci_cfgrw()
2344 idx = (coff - PCIR_BAR(0)) / 4; in pci_cfgrw()
2345 } else if (is_pcir_bios(coff)) { in pci_cfgrw()
2349 coff); in pci_cfgrw()
2413 pci_set_cfgdata32(pi, coff, bar); in pci_cfgrw()
2415 } else if (pci_emul_iscap(pi, coff)) { in pci_cfgrw()
2416 pci_emul_capwrite(pi, coff, bytes, *valp, 0, 0); in pci_cfgrw()
2417 } else if (coff >= PCIR_COMMAND && coff < PCIR_REVID) { in pci_cfgrw()
2418 pci_emul_cmdsts_write(pi, coff, *valp, bytes); in pci_cfgrw()
2420 CFGWRITE(pi, coff, *valp, bytes); in pci_cfgrw()
2462 int coff; in pci_emul_cfgdata() local
2466 coff = cfgoff + (port - CONF1_DATA_PORT); in pci_emul_cfgdata()
2468 pci_cfgrw(in, cfgbus, cfgslot, cfgfunc, coff, bytes, eax); in pci_emul_cfgdata()