The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bc2b10a5931442bb39653cd8d5712b2d7195cf46
commit bc2b10a5931442bb39653cd8d5712b2d7195cf46 Author: John Baldwin <[email protected]> AuthorDate: 2025-12-09 15:46:55 +0000 Commit: John Baldwin <[email protected]> CommitDate: 2025-12-09 15:47:35 +0000 cxgbe: Stop using bus_space_tag/handle directly Reviewed by: np, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D53030 --- sys/dev/cxgbe/adapter.h | 18 ++++++++---------- sys/dev/cxgbe/t4_iov.c | 6 +----- sys/dev/cxgbe/t4_main.c | 6 ++---- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 38875b535067..24a482b74dfb 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -963,8 +963,6 @@ struct adapter { 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; @@ -1276,7 +1274,7 @@ t4_read_reg(struct adapter *sc, uint32_t reg) { 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 @@ -1284,7 +1282,7 @@ t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val) { 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 @@ -1293,10 +1291,10 @@ t4_read_reg64(struct adapter *sc, uint32_t reg) 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 } @@ -1307,10 +1305,10 @@ t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val) 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 index 452ebaaf0172..9ccf63fd6516 100644 --- a/sys/dev/cxgbe/t4_iov.c +++ b/sys/dev/cxgbe/t4_iov.c @@ -54,8 +54,6 @@ struct t4iov_softc { int pf; int regs_rid; struct resource *regs_res; - bus_space_handle_t bh; - bus_space_tag_t bt; }; struct { @@ -147,7 +145,7 @@ static inline uint32_t 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); @@ -249,8 +247,6 @@ t4iov_attach(device_t dev) 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 index 5e02b47da8d9..3237c6649713 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2660,8 +2660,8 @@ reset_adapter_with_pl_rst(struct adapter *sc) { /* 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); } @@ -3997,8 +3997,6 @@ t4_map_bars_0_and_4(struct adapter *sc) 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);
