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
This commit is contained in:
parent
1675bf71ae
commit
c00cf72245
@ -2377,11 +2377,7 @@ bge_attach(device_t dev)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->bge_btag = rman_get_bustag(sc->bge_res);
|
|
||||||
sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
|
|
||||||
|
|
||||||
/* Save ASIC rev. */
|
/* Save ASIC rev. */
|
||||||
|
|
||||||
sc->bge_chipid =
|
sc->bge_chipid =
|
||||||
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
|
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
|
||||||
BGE_PCIMISCCTL_ASICREV;
|
BGE_PCIMISCCTL_ASICREV;
|
||||||
|
@ -1896,8 +1896,7 @@ struct bge_rcb {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define RCB_WRITE_4(sc, rcb, offset, val) \
|
#define RCB_WRITE_4(sc, rcb, offset, val) \
|
||||||
bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \
|
bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val)
|
||||||
rcb + offsetof(struct bge_rcb, offset), val)
|
|
||||||
#define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags))
|
#define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags))
|
||||||
|
|
||||||
#define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001
|
#define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001
|
||||||
@ -2394,10 +2393,10 @@ struct bge_gib {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define CSR_WRITE_4(sc, reg, val) \
|
#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) \
|
#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) \
|
#define BGE_SETBIT(sc, reg, x) \
|
||||||
CSR_WRITE_4(sc, reg, (CSR_READ_4(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;
|
device_t bge_dev;
|
||||||
struct mtx bge_mtx;
|
struct mtx bge_mtx;
|
||||||
device_t bge_miibus;
|
device_t bge_miibus;
|
||||||
bus_space_handle_t bge_bhandle;
|
|
||||||
bus_space_tag_t bge_btag;
|
|
||||||
void *bge_intrhand;
|
void *bge_intrhand;
|
||||||
struct resource *bge_irq;
|
struct resource *bge_irq;
|
||||||
struct resource *bge_res;
|
struct resource *bge_res;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user