diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-01-04 23:34:07 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-01-04 23:34:07 +0000 |
commit | d566ab24ec34def31fdda0f587d9f758789b983d (patch) | |
tree | 9f019754ab9b3ad74d0e177e776add9fbb5bbe64 /sys | |
parent | 04d4bef7c1efe296d15982e73eac06ad628af09b (diff) |
Receiving an AUTH event means that we successfully authenticated, thus
we have to move to the "trying to" ASSOC state. When association has
finished we will receive an ASSOC event, so that we can move into the
RUN state. After that point we will receive ethernet packets and the
WPA2 handshake can occur. The SET_SSID event will now only be used to
bring us back into SCAN when it notes an error, as it often completes
after we have already done the WPA2 handshake and can not be used to
switch between the different states.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/bwfm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index c610fd5f8f1..400f064ccd5 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.24 2018/01/03 21:01:16 patrick Exp $ */ +/* $OpenBSD: bwfm.c,v 1.25 2018/01/04 23:34:06 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se> @@ -344,6 +344,7 @@ bwfm_init(struct ifnet *ifp) } evmask[BWFM_E_IF / 8] |= 1 << (BWFM_E_IF % 8); evmask[BWFM_E_LINK / 8] |= 1 << (BWFM_E_LINK % 8); + evmask[BWFM_E_AUTH / 8] |= 1 << (BWFM_E_AUTH % 8); evmask[BWFM_E_ASSOC / 8] |= 1 << (BWFM_E_ASSOC % 8); evmask[BWFM_E_SET_SSID / 8] |= 1 << (BWFM_E_SET_SSID % 8); evmask[BWFM_E_ESCAN_RESULT / 8] |= 1 << (BWFM_E_ESCAN_RESULT % 8); @@ -1467,14 +1468,18 @@ bwfm_rx_event(struct bwfm_softc *sc, char *buf, size_t len) break; } case BWFM_E_SET_SSID: + if (ntohl(e->msg.status) != BWFM_E_STATUS_SUCCESS) + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); + break; + case BWFM_E_AUTH: if (ntohl(e->msg.status) == BWFM_E_STATUS_SUCCESS) - ieee80211_new_state(ic, IEEE80211_S_RUN, -1); + ieee80211_new_state(ic, IEEE80211_S_ASSOC, -1); else ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); break; case BWFM_E_ASSOC: if (ntohl(e->msg.status) == BWFM_E_STATUS_SUCCESS) - ieee80211_new_state(ic, IEEE80211_S_ASSOC, -1); + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); else ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); break; |