Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Mar 2015 06:05:01 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280802 - head/sys/dev/ath
Message-ID:  <201503290605.t2T6513V010877@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Mar 29 06:05:00 2015
New Revision: 280802
URL: https://svnweb.freebsd.org/changeset/base/280802

Log:
  Fix a long-standing bug with the early MAC address initialisation path,
  which showed up after I started changing addresses this early.
  
  It turns out that there's some other malarky going on behind the scenes
  in the HAL and merely setting the net80211/ifp mac address this early
  isn't enough.  If the MAC is set from kenv at attach time, the HAL
  also needs to be programmed early.
  
  Without this, the VAP wouldn't work enough for finishing association -
  probe requests would be fine as they're broadcast, but association
  request would fail.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Sun Mar 29 03:16:52 2015	(r280801)
+++ head/sys/dev/ath/if_ath.c	Sun Mar 29 06:05:00 2015	(r280802)
@@ -1204,8 +1204,12 @@ ath_attach(u_int16_t devid, struct ath_s
 	sc->sc_hasveol = ath_hal_hasveol(ah);
 
 	/* get mac address from kenv first, then hardware */
-	if (ath_fetch_mac_kenv(sc, macaddr) < 0)
+	if (ath_fetch_mac_kenv(sc, macaddr) == 0) {
+		/* Tell the HAL now about the new MAC */
+		ath_hal_setmac(ah, macaddr);
+	} else {
 		ath_hal_getmac(ah, macaddr);
+	}
 
 	if (sc->sc_hasbmask)
 		ath_hal_getbssidmask(ah, sc->sc_hwbssidmask);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503290605.t2T6513V010877>