diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -954,8 +954,6 @@ struct resource *regs_res; int msix_rid; struct resource *msix_res; - bus_space_handle_t bh; - bus_space_tag_t bt; bus_size_t mmio_len; int udbs_rid; struct resource *udbs_res; @@ -1266,7 +1264,7 @@ { if (hw_off_limits(sc)) MPASS(curthread == sc->reset_thread); - return bus_space_read_4(sc->bt, sc->bh, reg); + return bus_read_4(sc->regs_res, reg); } static inline void @@ -1274,7 +1272,7 @@ { if (hw_off_limits(sc)) MPASS(curthread == sc->reset_thread); - bus_space_write_4(sc->bt, sc->bh, reg, val); + bus_write_4(sc->regs_res, reg, val); } static inline uint64_t @@ -1283,10 +1281,10 @@ if (hw_off_limits(sc)) MPASS(curthread == sc->reset_thread); #ifdef __LP64__ - return bus_space_read_8(sc->bt, sc->bh, reg); + return bus_read_8(sc->regs_res, reg); #else - return (uint64_t)bus_space_read_4(sc->bt, sc->bh, reg) + - ((uint64_t)bus_space_read_4(sc->bt, sc->bh, reg + 4) << 32); + return (uint64_t)bus_read_4(sc->regs_res, reg) + + ((uint64_t)bus_read_4(sc->regs_res, reg + 4) << 32); #endif } @@ -1297,10 +1295,10 @@ if (hw_off_limits(sc)) MPASS(curthread == sc->reset_thread); #ifdef __LP64__ - bus_space_write_8(sc->bt, sc->bh, reg, val); + bus_write_8(sc->regs_res, reg, val); #else - bus_space_write_4(sc->bt, sc->bh, reg, val); - bus_space_write_4(sc->bt, sc->bh, reg + 4, val>> 32); + bus_write_4(sc->regs_res, reg, val); + bus_write_4(sc->regs_res, reg + 4, val>> 32); #endif } diff --git a/sys/dev/cxgbe/t4_iov.c b/sys/dev/cxgbe/t4_iov.c --- a/sys/dev/cxgbe/t4_iov.c +++ b/sys/dev/cxgbe/t4_iov.c @@ -54,8 +54,6 @@ int pf; int regs_rid; struct resource *regs_res; - bus_space_handle_t bh; - bus_space_tag_t bt; }; struct { @@ -147,7 +145,7 @@ t4iov_read_reg(struct t4iov_softc *sc, uint32_t reg) { - return bus_space_read_4(sc->bt, sc->bh, reg); + return bus_read_4(sc->regs_res, reg); } static int t4iov_attach_child(device_t dev); @@ -255,8 +253,6 @@ device_printf(dev, "cannot map registers.\n"); return (ENXIO); } - sc->bt = rman_get_bustag(sc->regs_res); - sc->bh = rman_get_bushandle(sc->regs_res); pl_rev = t4iov_read_reg(sc, A_PL_REV); whoami = t4iov_read_reg(sc, A_PL_WHOAMI); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2699,8 +2699,8 @@ { /* This is a t4_write_reg without the hw_off_limits check. */ MPASS(sc->error_flags & HW_OFF_LIMITS); - bus_space_write_4(sc->bt, sc->bh, A_PL_RST, - F_PIORSTMODE | F_PIORST | F_AUTOPCIEPAUSE); + bus_write_4(sc->regs_res, A_PL_RST, + F_PIORSTMODE | F_PIORST | F_AUTOPCIEPAUSE); pause("pl_rst", 1 * hz); /* Wait 1s for reset */ return (0); } @@ -4067,8 +4067,6 @@ device_printf(sc->dev, "cannot map registers.\n"); return (ENXIO); } - sc->bt = rman_get_bustag(sc->regs_res); - sc->bh = rman_get_bushandle(sc->regs_res); sc->mmio_len = rman_get_size(sc->regs_res); setbit(&sc->doorbells, DOORBELL_KDB);