-/* $OpenBSD: ieee80211_input.c,v 1.238 2021/09/03 12:39:43 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.239 2021/10/11 09:02:01 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
if (updateprot && ic->ic_updateprot != NULL)
ic->ic_updateprot(ic);
+ /*
+ * Check if 40MHz channel mode has changed since last beacon.
+ */
+ if (htop && (ic->ic_bss->ni_flags & IEEE80211_NODE_HT) &&
+ (ic->ic_htcaps & IEEE80211_HTCAP_CBW20_40)) {
+ uint8_t chw_last, chw, sco_last, sco;
+ chw_last = (ic->ic_bss->ni_htop0 & IEEE80211_HTOP0_CHW);
+ chw = (ni->ni_htop0 & IEEE80211_HTOP0_CHW);
+ sco_last =
+ ((ic->ic_bss->ni_htop0 & IEEE80211_HTOP0_SCO_MASK)
+ >> IEEE80211_HTOP0_SCO_SHIFT);
+ sco = ((ni->ni_htop0 & IEEE80211_HTOP0_SCO_MASK) >>
+ IEEE80211_HTOP0_SCO_SHIFT);
+ ic->ic_bss->ni_htop0 = ni->ni_htop0;
+ if (chw_last != chw || sco_last != sco) {
+ if (ic->ic_updatechan != NULL)
+ ic->ic_updatechan(ic);
+ }
+ } else if (htop)
+ ic->ic_bss->ni_htop0 = ni->ni_htop0;
+
/*
* Check if AP short slot time setting has changed
* since last beacon and give the driver a chance to
-/* $OpenBSD: ieee80211_var.h,v 1.106 2021/10/11 09:01:06 stsp Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.107 2021/10/11 09:02:01 stsp Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
void (*ic_ampdu_rx_stop)(struct ieee80211com *,
struct ieee80211_node *, u_int8_t);
void (*ic_updateprot)(struct ieee80211com *);
+ void (*ic_updatechan)(struct ieee80211com *);
int (*ic_bgscan_start)(struct ieee80211com *);
struct timeout ic_bgscan_timeout;
uint32_t ic_bgscan_fail;