-/* $OpenBSD: ieee80211_node.c,v 1.125 2017/12/12 13:58:19 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.126 2018/02/06 22:14:52 phessler Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
#ifndef IEEE80211_STA_ONLY
nnodes++;
if ((ic->ic_flags & IEEE80211_F_HTON) && cache_timeout) {
- if ((ni->ni_rxmcs[0] & 0xff) == 0) {
+ if (!ieee80211_node_supports_ht(ni)) {
nonht++;
if (ni->ni_state == IEEE80211_STA_ASSOC)
nonhtassoc++;
#ifndef IEEE80211_STA_ONLY
nnodes--;
if ((ic->ic_flags & IEEE80211_F_HTON) && cache_timeout) {
- if ((ni->ni_rxmcs[0] & 0xff) == 0) {
+ if (!ieee80211_node_supports_ht(ni)) {
nonht--;
if (ni->ni_state == IEEE80211_STA_ASSOC)
nonhtassoc--;
-/* $OpenBSD: ieee80211_node.h,v 1.71 2018/02/06 09:04:45 phessler Exp $ */
+/* $OpenBSD: ieee80211_node.h,v 1.72 2018/02/06 22:14:52 phessler Exp $ */
/* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */
/*-
*ni = NULL; /* guard against use */
}
+/*
+ * Check if the peer supports HT.
+ * Require at least one of the mandatory MCS.
+ * MCS 0-7 are mandatory but some APs have particular MCS disabled.
+ */
+static inline int
+ieee80211_node_supports_ht(struct ieee80211_node *ni)
+{
+ return (ni->ni_rxmcs[0] & 0xff);
+}
+
struct ieee80211com;
typedef void ieee80211_iter_func(void *, struct ieee80211_node *);
-/* $OpenBSD: ieee80211_proto.c,v 1.82 2018/02/05 08:44:13 stsp Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.83 2018/02/06 22:14:52 phessler Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
* Require at least one of the mandatory MCS.
* MCS 0-7 are mandatory but some APs have particular MCS disabled.
*/
- if ((ni->ni_rxmcs[0] & 0xff) == 0) {
+ if (!ieee80211_node_supports_ht(ni)) {
ic->ic_stats.is_ht_nego_no_mandatory_mcs++;
return;
}