diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -960,15 +960,6 @@ return (0); } -static int -passthru_cfgread_default(struct passthru_softc *sc, - struct pci_devinst *pi __unused, int coff, int bytes, uint32_t *rv) -{ - *rv = read_config(&sc->psc_sel, coff, bytes); - - return (0); -} - int passthru_cfgread_emulate(struct passthru_softc *sc __unused, struct pci_devinst *pi __unused, int coff __unused, int bytes __unused, @@ -987,7 +978,9 @@ if (sc->psc_pcir_rhandler[coff] != NULL) return (sc->psc_pcir_rhandler[coff](sc, pi, coff, bytes, rv)); - return (passthru_cfgread_default(sc, pi, coff, bytes, rv)); + *rv = read_config(&sc->psc_sel, coff, bytes); + + return (0); } static int @@ -1020,15 +1013,6 @@ return (0); } -static int -passthru_cfgwrite_default(struct passthru_softc *sc, struct pci_devinst *pi, - int coff, int bytes, uint32_t val) -{ - write_config(&sc->psc_sel, coff, bytes, val); - - return (0); -} - int passthru_cfgwrite_emulate(struct passthru_softc *sc __unused, struct pci_devinst *pi __unused, int coff __unused, int bytes __unused, @@ -1093,7 +1077,9 @@ if (sc->psc_pcir_whandler[coff] != NULL) return (sc->psc_pcir_whandler[coff](sc, pi, coff, bytes, val)); - return (passthru_cfgwrite_default(sc, pi, coff, bytes, val)); + write_config(&sc->psc_sel, coff, bytes, val); + + return (0); } static void