zyd, run, ural: do not corrupt MAC address

Do not use ic_macaddr as a storage for current BSSID;
it may be reused in vap creation procedure;
similar to r288619.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5513
This commit is contained in:
Andriy Voskoboinyk 2016-03-03 20:06:16 +00:00
parent 467f437b43
commit ae132f1122
6 changed files with 15 additions and 11 deletions

View File

@ -2141,8 +2141,8 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
run_set_txpreamble(sc);
run_set_basicrates(sc);
ni = ieee80211_ref_node(vap->iv_bss);
IEEE80211_ADDR_COPY(ic->ic_macaddr, ni->ni_bssid);
run_set_bssid(sc, ni->ni_bssid);
IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid);
run_set_bssid(sc, sc->sc_bssid);
ieee80211_free_node(ni);
run_enable_tsf_sync(sc);
@ -4811,8 +4811,7 @@ run_scan_end(struct ieee80211com *ic)
RUN_LOCK(sc);
run_enable_tsf_sync(sc);
/* XXX keep local copy */
run_set_bssid(sc, ic->ic_macaddr);
run_set_bssid(sc, sc->sc_bssid);
RUN_UNLOCK(sc);

View File

@ -248,6 +248,8 @@ struct run_softc {
uint8_t rvp_bmap;
uint8_t sc_detached;
uint8_t sc_bssid[IEEE80211_ADDR_LEN];
union {
struct run_rx_radiotap_header th;
uint8_t pad[64];

View File

@ -706,8 +706,8 @@ ural_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
ural_update_slot(sc);
ural_set_txpreamble(sc);
ural_set_basicrates(sc, ic->ic_bsschan);
IEEE80211_ADDR_COPY(ic->ic_macaddr, ni->ni_bssid);
ural_set_bssid(sc, ic->ic_macaddr);
IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid);
ural_set_bssid(sc, sc->sc_bssid);
}
if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
@ -1582,7 +1582,7 @@ ural_scan_end(struct ieee80211com *ic)
RAL_LOCK(sc);
ural_enable_tsf_sync(sc);
ural_set_bssid(sc, ic->ic_macaddr);
ural_set_bssid(sc, sc->sc_bssid);
RAL_UNLOCK(sc);
}

View File

@ -97,7 +97,7 @@ struct ural_softc {
uint32_t asic_rev;
uint8_t rf_rev;
struct usb_xfer *sc_xfer[URAL_N_TRANSFER];
struct usb_xfer *sc_xfer[URAL_N_TRANSFER];
struct ural_tx_data tx_data[RAL_TX_LIST_COUNT];
ural_txdhead tx_q;
@ -113,6 +113,8 @@ struct ural_softc {
u_int sc_detached:1,
sc_running:1;
uint8_t sc_bssid[IEEE80211_ADDR_LEN];
struct {
uint8_t val;
uint8_t reg;

View File

@ -609,8 +609,8 @@ zyd_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
/* make data LED blink upon Tx */
zyd_write32_m(sc, sc->sc_fwbase + ZYD_FW_LINK_STATUS, 1);
IEEE80211_ADDR_COPY(ic->ic_macaddr, vap->iv_bss->ni_bssid);
zyd_set_bssid(sc, ic->ic_macaddr);
IEEE80211_ADDR_COPY(sc->sc_bssid, vap->iv_bss->ni_bssid);
zyd_set_bssid(sc, sc->sc_bssid);
break;
default:
break;
@ -2860,7 +2860,7 @@ zyd_scan_end(struct ieee80211com *ic)
ZYD_LOCK(sc);
/* restore previous bssid */
zyd_set_bssid(sc, ic->ic_macaddr);
zyd_set_bssid(sc, sc->sc_bssid);
ZYD_UNLOCK(sc);
}

View File

@ -1291,6 +1291,7 @@ struct zyd_softc {
uint8_t sc_ofdm36_cal[14];
uint8_t sc_ofdm48_cal[14];
uint8_t sc_ofdm54_cal[14];
uint8_t sc_bssid[IEEE80211_ADDR_LEN];
struct mtx sc_mtx;
struct zyd_tx_data tx_data[ZYD_TX_LIST_CNT];