summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwx.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2021-10-12 10:46:58 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2021-10-12 10:46:58 +0000
commitb5a298219fd141154e6eb5602ebb29832921f6a2 (patch)
tree50d5d13c5bbd282fc904bda2f6f533fe86eeabb4 /sys/dev/pci/if_iwx.c
parent849f9724d6a27cfc38e5c25037bb0d1eaaab36de (diff)
Make our old BSSID available to iwx_newstate_task() when roaming.
ic_bss->ni_bssid has already been overwritten once we enter iwx_newstate_task() to perform the state transitions necessary for roaming to our new access point (RUN->AUTH->ASSOC->RUN). We do however use the BSSID in commands sent to firmware. Cache our BSSID in struct iwx_node such that firmware commands keep using the old BSSID while we are still tearing things down. Switch to the new BSSID only once we start back up in iwx_auth(). This should be consistent from the firmware's point of view. Same fix as committed for iwm(4) recently.
Diffstat (limited to 'sys/dev/pci/if_iwx.c')
-rw-r--r--sys/dev/pci/if_iwx.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c
index 273ce81ca41..ae0b27d1ad7 100644
--- a/sys/dev/pci/if_iwx.c
+++ b/sys/dev/pci/if_iwx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwx.c,v 1.117 2021/10/12 10:45:21 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.118 2021/10/12 10:46:57 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -5660,7 +5660,7 @@ iwx_add_sta_cmd(struct iwx_softc *sc, struct iwx_node *in, int update)
etheranyaddr);
else
IEEE80211_ADDR_COPY(&add_sta_cmd.addr,
- in->in_ni.ni_bssid);
+ in->in_macaddr);
}
add_sta_cmd.add_modify = update ? 1 : 0;
add_sta_cmd.station_flags_msk
@@ -6286,7 +6286,7 @@ iwx_mac_ctxt_cmd_common(struct iwx_softc *sc, struct iwx_node *in,
return;
}
- IEEE80211_ADDR_COPY(cmd->bssid_addr, ni->ni_bssid);
+ IEEE80211_ADDR_COPY(cmd->bssid_addr, in->in_macaddr);
iwx_ack_rates(sc, in, &cck_ack_rates, &ofdm_ack_rates);
cmd->cck_rates = htole32(cck_ack_rates);
cmd->ofdm_rates = htole32(ofdm_ack_rates);
@@ -6739,6 +6739,7 @@ iwx_auth(struct iwx_softc *sc)
return err;
}
in->in_phyctxt = &sc->sc_phyctxt[0];
+ IEEE80211_ADDR_COPY(in->in_macaddr, in->in_ni.ni_macaddr);
err = iwx_mac_ctxt_cmd(sc, in, IWX_FW_CTXT_ACTION_ADD, 0);
if (err) {
@@ -7708,7 +7709,7 @@ int
iwx_allow_mcast(struct iwx_softc *sc)
{
struct ieee80211com *ic = &sc->sc_ic;
- struct ieee80211_node *ni = ic->ic_bss;
+ struct iwx_node *in = (void *)ic->ic_bss;
struct iwx_mcast_filter_cmd *cmd;
size_t size;
int err;
@@ -7721,7 +7722,7 @@ iwx_allow_mcast(struct iwx_softc *sc)
cmd->port_id = 0;
cmd->count = 0;
cmd->pass_all = 1;
- IEEE80211_ADDR_COPY(cmd->bssid, ni->ni_bssid);
+ IEEE80211_ADDR_COPY(cmd->bssid, in->in_macaddr);
err = iwx_send_cmd_pdu(sc, IWX_MCAST_FILTER_CMD,
0, size, cmd);
@@ -7900,6 +7901,7 @@ iwx_stop(struct ifnet *ifp)
in->in_phyctxt = NULL;
in->in_flags = 0;
+ IEEE80211_ADDR_COPY(in->in_macaddr, etheranyaddr);
sc->sc_flags &= ~(IWX_FLAG_SCANNING | IWX_FLAG_BGSCAN);
sc->sc_flags &= ~IWX_FLAG_MAC_ACTIVE;