summaryrefslogtreecommitdiff
path: root/sys/dev/bm
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2008-10-30 04:01:11 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2008-10-30 04:01:11 +0000
commitdde77cd76b9a456f0d1274ab18ccdb28fbaa7bc9 (patch)
treec7c35088012f2c42149cea75e461f037f440c23f /sys/dev/bm
parent212a6f8281f0da052815432f109f93ee19bc06f1 (diff)
downloadsrc-test2-dde77cd76b9a456f0d1274ab18ccdb28fbaa7bc9.tar.gz
src-test2-dde77cd76b9a456f0d1274ab18ccdb28fbaa7bc9.zip
Notes
Diffstat (limited to 'sys/dev/bm')
-rw-r--r--sys/dev/bm/if_bm.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/bm/if_bm.c b/sys/dev/bm/if_bm.c
index 9f881e6345f1..b9bddb52a213 100644
--- a/sys/dev/bm/if_bm.c
+++ b/sys/dev/bm/if_bm.c
@@ -488,9 +488,9 @@ bm_attach(device_t dev)
return (ENXIO);
}
- error = dbdma_allocate_channel(sc->sc_txdmar, bus_get_dma_tag(dev),
+ error = dbdma_allocate_channel(sc->sc_txdmar, 0, bus_get_dma_tag(dev),
BM_MAX_DMA_COMMANDS, &sc->sc_txdma);
- error += dbdma_allocate_channel(sc->sc_rxdmar, bus_get_dma_tag(dev),
+ error += dbdma_allocate_channel(sc->sc_rxdmar, 0, bus_get_dma_tag(dev),
BM_MAX_DMA_COMMANDS, &sc->sc_rxdma);
if (error) {
@@ -1119,21 +1119,25 @@ bm_chip_setup(struct bm_softc *sc)
{
uint16_t reg;
uint16_t *eaddr_sect;
- char hrow_path[128];
- ihandle_t hrow_ih;
+ char path[128];
+ ihandle_t bmac_ih;
eaddr_sect = (uint16_t *)(sc->sc_enaddr);
- /* Enable BMAC cell */
- OF_package_to_path(OF_parent(ofw_bus_get_node(sc->sc_dev)),
- hrow_path, sizeof(hrow_path));
- hrow_ih = OF_open(hrow_path);
- if (hrow_ih == -1) {
+ /*
+ * Enable BMAC cell by opening and closing its OF node. This enables
+ * the cell in macio as a side effect. We should probably directly
+ * twiddle the FCR bits, but we lack a good interface for this at the
+ * present time.
+ */
+
+ OF_package_to_path(ofw_bus_get_node(sc->sc_dev), path, sizeof(path));
+ bmac_ih = OF_open(path);
+ if (bmac_ih == -1) {
device_printf(sc->sc_dev,
"Enabling BMAC cell failed! Hoping it's already active.\n");
} else {
- OF_call_method("enable-enet", hrow_ih, 0, 0);
- OF_close(hrow_ih);
+ OF_close(bmac_ih);
}
/* Reset chip */