diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 923c0285784e..751071a77ec2 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1220,8 +1220,6 @@ sn_activate(device_t dev) sn_deactivate(dev); return ENOMEM; } - sc->bst = rman_get_bustag(sc->port_res); - sc->bsh = rman_get_bushandle(sc->port_res); return (0); } diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c index 034f51a70456..5c0d4eeeac3e 100644 --- a/sys/dev/sn/if_sn_pccard.c +++ b/sys/dev/sn/if_sn_pccard.c @@ -271,8 +271,6 @@ sn_pccard_megahertz_activate(device_t dev) sn_deactivate(dev); return ENOMEM; } - sc->bst = rman_get_bustag(sc->port_res); - sc->bsh = rman_get_bushandle(sc->port_res); return 0; } diff --git a/sys/dev/sn/if_snvar.h b/sys/dev/sn/if_snvar.h index 048f23a41fc0..79fc6e81b9c3 100644 --- a/sys/dev/sn/if_snvar.h +++ b/sys/dev/sn/if_snvar.h @@ -32,8 +32,6 @@ struct sn_softc { struct ifnet *ifp; - bus_space_tag_t bst; - bus_space_handle_t bsh; struct mtx sc_mtx; int pages_wanted; /* Size of outstanding MMU ALLOC */ int intr_mask; /* Most recently set interrupt mask */ @@ -55,20 +53,20 @@ void sn_intr(void *); int sn_activate(device_t); void sn_deactivate(device_t); -#define CSR_READ_1(sc, off) (bus_space_read_1((sc)->bst, (sc)->bsh, off)) -#define CSR_READ_2(sc, off) (bus_space_read_2((sc)->bst, (sc)->bsh, off)) +#define CSR_READ_1(sc, off) (bus_read_1((sc)->port_res, off)) +#define CSR_READ_2(sc, off) (bus_read_2((sc)->port_res, off)) #define CSR_WRITE_1(sc, off, val) \ - bus_space_write_1(sc->bst, sc->bsh, off, val) + bus_write_1((sc)->port_res, off, val) #define CSR_WRITE_2(sc, off, val) \ - bus_space_write_2(sc->bst, sc->bsh, off, val) + bus_write_2((sc)->port_res, off, val) #define CSR_WRITE_MULTI_1(sc, off, addr, count) \ - bus_space_write_multi_1(sc->bst, sc->bsh, off, addr, count) + bus_write_multi_1((sc)->port_res, off, addr, count) #define CSR_WRITE_MULTI_2(sc, off, addr, count) \ - bus_space_write_multi_2(sc->bst, sc->bsh, off, addr, count) + bus_write_multi_2((sc)->port_res, off, addr, count) #define CSR_READ_MULTI_1(sc, off, addr, count) \ - bus_space_read_multi_1(sc->bst, sc->bsh, off, addr, count) + bus_read_multi_1((sc)->port_res, off, addr, count) #define CSR_READ_MULTI_2(sc, off, addr, count) \ - bus_space_read_multi_2(sc->bst, sc->bsh, off, addr, count) + bus_read_multi_2((sc)->port_res, off, addr, count) #define SN_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define SN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) diff --git a/sys/dev/tl/if_tl.c b/sys/dev/tl/if_tl.c index f1a3db8b59c6..2d23b5ee2705 100644 --- a/sys/dev/tl/if_tl.c +++ b/sys/dev/tl/if_tl.c @@ -1170,9 +1170,6 @@ tl_attach(dev) goto fail; } - sc->tl_btag = rman_get_bustag(sc->tl_res); - sc->tl_bhandle = rman_get_bushandle(sc->tl_res); - #ifdef notdef /* * The ThunderLAN manual suggests jacking the PCI latency diff --git a/sys/dev/tl/if_tlreg.h b/sys/dev/tl/if_tlreg.h index f04b52bda59c..46a79865b5b6 100644 --- a/sys/dev/tl/if_tlreg.h +++ b/sys/dev/tl/if_tlreg.h @@ -112,8 +112,6 @@ struct tl_softc { struct ifnet *tl_ifp; device_t tl_dev; struct ifmedia ifmedia; /* media info */ - bus_space_handle_t tl_bhandle; - bus_space_tag_t tl_btag; void *tl_intrhand; struct resource *tl_irq; struct resource *tl_res; @@ -493,19 +491,13 @@ struct tl_stats { /* * register space access macros */ -#define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->tl_btag, sc->tl_bhandle, reg, val) -#define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->tl_btag, sc->tl_bhandle, reg, val) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->tl_btag, sc->tl_bhandle, reg, val) +#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->tl_res, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->tl_res, reg, val) +#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->tl_res, reg, val) -#define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->tl_btag, sc->tl_bhandle, reg) -#define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->tl_btag, sc->tl_bhandle, reg) -#define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->tl_btag, sc->tl_bhandle, reg) +#define CSR_READ_4(sc, reg) bus_read_4(sc->tl_res, reg) +#define CSR_READ_2(sc, reg) bus_read_2(sc->tl_res, reg) +#define CSR_READ_1(sc, reg) bus_read_1(sc->tl_res, reg) #define CMD_PUT(sc, x) CSR_WRITE_4(sc, TL_HOSTCMD, x) #define CMD_SET(sc, x) \ diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index a2457695e8e4..830be208e6c8 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -945,9 +945,6 @@ vge_attach(dev) goto fail; } - sc->vge_btag = rman_get_bustag(sc->vge_res); - sc->vge_bhandle = rman_get_bushandle(sc->vge_res); - /* Allocate interrupt */ rid = 0; sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, diff --git a/sys/dev/vge/if_vgevar.h b/sys/dev/vge/if_vgevar.h index aab52281b7f9..b19ed3fde083 100644 --- a/sys/dev/vge/if_vgevar.h +++ b/sys/dev/vge/if_vgevar.h @@ -100,8 +100,6 @@ struct vge_list_data { struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; - bus_space_handle_t vge_bhandle; /* bus space handle */ - bus_space_tag_t vge_btag; /* bus space tag */ struct resource *vge_res; struct resource *vge_irq; void *vge_intrhand; @@ -134,20 +132,20 @@ struct vge_softc { * register space access macros */ #define CSR_WRITE_STREAM_4(sc, reg, val) \ - bus_space_write_stream_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_stream_4(sc->vge_res, reg, val) #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_4(sc->vge_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_2(sc->vge_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_1(sc->vge_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_4(sc->vge_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_2(sc->vge_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_1(sc->vge_res, reg) #define CSR_SETBIT_1(sc, reg, x) \ CSR_WRITE_1(sc, reg, CSR_READ_1(sc, reg) | (x)) diff --git a/sys/dev/wb/if_wb.c b/sys/dev/wb/if_wb.c index d90159535056..9c2f468405f5 100644 --- a/sys/dev/wb/if_wb.c +++ b/sys/dev/wb/if_wb.c @@ -804,9 +804,6 @@ wb_attach(dev) goto fail; } - sc->wb_btag = rman_get_bustag(sc->wb_res); - sc->wb_bhandle = rman_get_bushandle(sc->wb_res); - /* Allocate interrupt */ rid = 0; sc->wb_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, diff --git a/sys/dev/wb/if_wbreg.h b/sys/dev/wb/if_wbreg.h index c5315c4efcb5..ce7f46a97078 100644 --- a/sys/dev/wb/if_wbreg.h +++ b/sys/dev/wb/if_wbreg.h @@ -365,8 +365,6 @@ struct wb_softc { struct ifnet *wb_ifp; /* interface info */ device_t wb_dev; device_t wb_miibus; - bus_space_handle_t wb_bhandle; - bus_space_tag_t wb_btag; struct resource *wb_res; struct resource *wb_irq; void *wb_intrhand; @@ -388,19 +386,13 @@ struct wb_softc { /* * register space access macros */ -#define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->wb_btag, sc->wb_bhandle, reg, val) -#define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->wb_btag, sc->wb_bhandle, reg, val) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->wb_btag, sc->wb_bhandle, reg, val) +#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->wb_res, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->wb_res, reg, val) +#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->wb_res, reg, val) -#define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->wb_btag, sc->wb_bhandle, reg) -#define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->wb_btag, sc->wb_bhandle, reg) -#define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->wb_btag, sc->wb_bhandle, reg) +#define CSR_READ_4(sc, reg) bus_read_4(sc->wb_res, reg) +#define CSR_READ_2(sc, reg) bus_read_2(sc->wb_res, reg) +#define CSR_READ_1(sc, reg) bus_read_1(sc->wb_res, reg) #define WB_TIMEOUT 1000