PERFORCE change 140577 for review
Andrew Thompson
thompsa at FreeBSD.org
Fri Apr 25 06:03:38 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=140577
Change 140577 by thompsa at thompsa_burger on 2008/04/25 06:02:37
Sync to HEAD.
Affected files ...
.. //depot/projects/vap/sys/dev/malo/if_malo.c#8 edit
Differences ...
==== //depot/projects/vap/sys/dev/malo/if_malo.c#8 (text+ko) ====
@@ -157,8 +157,8 @@
/*
* Read/Write shorthands for accesses to BAR 0. Note that all BAR 1
- * operations are done in the "hal" and there should be no reference to
- * them here.
+ * operations are done in the "hal" except getting H/W MAC address at
+ * malo_attach and there should be no reference to them here.
*/
static uint32_t
malo_bar0_read4(struct malo_softc *sc, bus_size_t off)
@@ -175,6 +175,12 @@
bus_space_write_4(sc->malo_io0t, sc->malo_io0h, off, val);
}
+static uint8_t
+malo_bar1_read1(struct malo_softc *sc, bus_size_t off)
+{
+ return bus_space_read_1(sc->malo_io1t, sc->malo_io1h, off);
+}
+
int
malo_attach(uint16_t devid, struct malo_softc *sc)
{
@@ -197,6 +203,16 @@
if_initname(ifp, device_get_name(sc->malo_dev),
device_get_unit(sc->malo_dev));
+ /*
+ * NB: get mac address from hardware directly here before we set DMAs
+ * for HAL because we don't want to disturb operations of HAL at BAR 1.
+ */
+ for (i = 0; i < IEEE80211_ADDR_LEN; i++) {
+ /* XXX remove a magic number but we don't have documents. */
+ ic->ic_myaddr[i] = malo_bar1_read1(sc, 0xa528 + i);
+ DELAY(1000);
+ }
+
mh = malo_hal_attach(sc->malo_dev, devid,
sc->malo_io1h, sc->malo_io1t, sc->malo_dmat);
if (mh == NULL) {
More information about the p4-projects
mailing list