summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2008-10-14 20:28:42 +0000
committermarius <marius@FreeBSD.org>2008-10-14 20:28:42 +0000
commit5854d5bf4f648b16ad411e6e515f762ad67c773c (patch)
treee417a60ac158c529ad1fb72cede9b98e1f9455ae /sys
parent660ef1bcc42db77da56807b150a4a60a32f75d6d (diff)
downloadFreeBSD-src-5854d5bf4f648b16ad411e6e515f762ad67c773c.zip
FreeBSD-src-5854d5bf4f648b16ad411e6e515f762ad67c773c.tar.gz
Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9)
in order to get rid of the bus space handle and tag in the softc. MFC after: 1 month
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bge/if_bge.c4
-rw-r--r--sys/dev/bge/if_bgereg.h9
2 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 1eb5f88..2553a32 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2377,11 +2377,7 @@ bge_attach(device_t dev)
goto fail;
}
- sc->bge_btag = rman_get_bustag(sc->bge_res);
- sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
-
/* Save ASIC rev. */
-
sc->bge_chipid =
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
BGE_PCIMISCCTL_ASICREV;
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 4e1980c..b10da2e 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -1896,8 +1896,7 @@ struct bge_rcb {
};
#define RCB_WRITE_4(sc, rcb, offset, val) \
- bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \
- rcb + offsetof(struct bge_rcb, offset), val)
+ bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val)
#define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags))
#define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001
@@ -2394,10 +2393,10 @@ struct bge_gib {
*/
#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->bge_btag, sc->bge_bhandle, reg, val)
+ bus_write_4(sc->bge_res, reg, val)
#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->bge_btag, sc->bge_bhandle, reg)
+ bus_read_4(sc->bge_res, reg)
#define BGE_SETBIT(sc, reg, x) \
CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | (x)))
@@ -2522,8 +2521,6 @@ struct bge_softc {
device_t bge_dev;
struct mtx bge_mtx;
device_t bge_miibus;
- bus_space_handle_t bge_bhandle;
- bus_space_tag_t bge_btag;
void *bge_intrhand;
struct resource *bge_irq;
struct resource *bge_res;
OpenPOWER on IntegriCloud