diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-12-30 16:49:35 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-12-30 16:49:35 +0000 |
commit | 970d07b7deaa4ce5c5028598f82c266d71ee3144 (patch) | |
tree | 298967031ca9a7629c11410c1fb419c154b00bd5 | |
parent | 6e1767106474ccafe56febf67fd548fe08ba75a1 (diff) |
Do not send (normal) packets before we reach the run state. Logic copied
from iwm(4), which also looks at the TX_MGMT_ONLY flag. We don't expect
that flag to be ever set for bwfm(4), but it shouldn't hurt and it keeps
things consistent across drivers.
This fixes issues with suspend/resume (including firmware crashes seen on
the M2 Macbook Air).
ok patrick@, stsp@
-rw-r--r-- | sys/dev/ic/bwfm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index b4f8c70d29e..56c8e2365b5 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.105 2022/06/30 19:57:40 stsp Exp $ */ +/* $OpenBSD: bwfm.c,v 1.106 2022/12/30 16:49:34 kettenis Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se> @@ -391,6 +391,7 @@ void bwfm_start(struct ifnet *ifp) { struct bwfm_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; struct mbuf *m; if (!(ifp->if_flags & IFF_RUNNING)) @@ -408,6 +409,10 @@ bwfm_start(struct ifnet *ifp) break; } + if (ic->ic_state != IEEE80211_S_RUN || + (ic->ic_xflags & IEEE80211_F_TX_MGMT_ONLY)) + break; + m = ifq_dequeue(&ifp->if_snd); if (m == NULL) break; |