View | Details | Raw Unified | Return to bug 213207
Collapse All | Expand All

(-)sys/dev/ath/if_ath.c (-2 / +21 lines)
Lines 1466-1479 Link Here
1466
	struct ath_vap *avp;
1466
	struct ath_vap *avp;
1467
	struct ieee80211vap *vap;
1467
	struct ieee80211vap *vap;
1468
	uint8_t mac[IEEE80211_ADDR_LEN];
1468
	uint8_t mac[IEEE80211_ADDR_LEN];
1469
	int needbeacon, error;
1469
	int needbeacon, setmacaddr, error;
1470
	enum ieee80211_opmode ic_opmode;
1470
	enum ieee80211_opmode ic_opmode;
1471
1471
1472
	avp = malloc(sizeof(struct ath_vap), M_80211_VAP, M_WAITOK | M_ZERO);
1472
	avp = malloc(sizeof(struct ath_vap), M_80211_VAP, M_WAITOK | M_ZERO);
1473
	needbeacon = 0;
1473
	needbeacon = 0;
1474
	IEEE80211_ADDR_COPY(mac, mac0);
1474
	setmacaddr = 0;
1475
1475
1476
	ATH_LOCK(sc);
1476
	ATH_LOCK(sc);
1477
	ath_hal_getmac(sc->sc_ah, mac);
1478
	if ((flags & IEEE80211_CLONE_MACADDR) != 0 &&
1479
	    !IEEE80211_ADDR_EQ(mac, mac0)) {
1480
		if (sc->sc_nvaps != 0) {
1481
			device_printf(sc->sc_dev,
1482
			    "MAC address change request will be ignored\n");
1483
			/* XXX goto bad? */
1484
		} else {
1485
			/*
1486
			 * NB: delay MAC address change in case
1487
			 * if vap setup fails
1488
			 */
1489
			IEEE80211_ADDR_COPY(mac, mac0);
1490
			setmacaddr = 1;
1491
		}
1492
	}
1493
1477
	ic_opmode = opmode;		/* default to opmode of new vap */
1494
	ic_opmode = opmode;		/* default to opmode of new vap */
1478
	switch (opmode) {
1495
	switch (opmode) {
1479
	case IEEE80211_M_STA:
1496
	case IEEE80211_M_STA:
Lines 1700-1705 Link Here
1700
		 */
1717
		 */
1701
		sc->sc_swbmiss = 1;
1718
		sc->sc_swbmiss = 1;
1702
	}
1719
	}
1720
	if (setmacaddr)
1721
		ath_hal_setmac(sc->sc_ah, mac0);
1703
	ATH_UNLOCK(sc);
1722
	ATH_UNLOCK(sc);
1704
1723
1705
	/* complete setup */
1724
	/* complete setup */

Return to bug 213207