diff options
-rw-r--r-- | sys/net80211/_ieee80211.h | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 1f369c4..24da6ff 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -152,6 +152,8 @@ struct ieee80211_channel { (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) #define IEEE80211_IS_CHAN_G(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) +#define IEEE80211_IS_CHAN_ANYG(_c) \ + (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) #define IEEE80211_IS_CHAN_T(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) #define IEEE80211_IS_CHAN_108G(_c) \ diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index dc098a0..eca1241 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2062,9 +2062,9 @@ static void ieee80211_node_leave_11g(struct ieee80211com *ic, struct ieee80211_node *ni) { - KASSERT(ic->ic_curmode == IEEE80211_MODE_11G || - ic->ic_curmode == IEEE80211_MODE_TURBO_G, - ("not in 11g, curmode %x", ic->ic_curmode)); + KASSERT(IEEE80211_IS_CHAN_ANYG(ni->ni_chan), + ("not in 11g, bss %u:0x%x, curmode %u", ni->ni_chan->ic_freq, + ni->ni_chan->ic_flags, ic->ic_curmode)); /* * If a long slot station do the slot time bookkeeping. @@ -2152,8 +2152,7 @@ ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni) ni->ni_associd = 0; ic->ic_sta_assoc--; - if (ic->ic_curmode == IEEE80211_MODE_11G || - ic->ic_curmode == IEEE80211_MODE_TURBO_G) + if (IEEE80211_IS_CHAN_ANYG(ic->ic_bss->ni_chan)) ieee80211_node_leave_11g(ic, ni); /* * Cleanup station state. In particular clear various |