From owner-p4-projects@FreeBSD.ORG Fri Apr 25 06:03:38 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0FFC9106567B; Fri, 25 Apr 2008 06:03:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C38EA106564A for ; Fri, 25 Apr 2008 06:03:37 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A8C6B8FC18 for ; Fri, 25 Apr 2008 06:03:37 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m3P63bjM087920 for ; Fri, 25 Apr 2008 06:03:37 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3P63bS3087918 for perforce@freebsd.org; Fri, 25 Apr 2008 06:03:37 GMT (envelope-from thompsa@freebsd.org) Date: Fri, 25 Apr 2008 06:03:37 GMT Message-Id: <200804250603.m3P63bS3087918@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 140577 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 06:03:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=140577 Change 140577 by thompsa@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) {