From patchwork Wed Jun 19 12:49:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iPcljIqy"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THNB6fCMz9s6w for ; Wed, 19 Jun 2019 17:56:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JmNsbMRbvWtFkfXTjHEevoRTjb3iGpLACpltPfHMTT4=; b=iPcljIqyY9IZwW C7umZGf6WAFFJkseAvNqW6KByHbngQrLObCpe2DxF5yiG4r2Z5F2aY9nkx9wR9zkTJP90VnlJcKIP 6cOyEFA0y7PRCrpMA6OL5UEEAMAv7R5F0mQoinqKMS6SdmalSt8nlBi9jK3lyiYc+vNNRW7slG+4r ogRe2TqOEvWBLBT1pASWI4MkyooLg4ngob/XQMtTEgDzzqbtY7lu6GIed026gYVRKjTWWV5SAt5Y/ Mt5kM0rkfEyBl1o3/EqrDGlIKdKDUojQnjFrUsMumcfVGNe+sWEFUjIEhifh4q7lEMX/qbbJaGdR9 ulJ56a6/G7wWd8lgU+sA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSh-0006f9-Dh; Wed, 19 Jun 2019 07:56:55 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSd-0006ZZ-HR for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:56:53 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:56:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537302" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:56:50 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 1/6] AP: Add initial support for 6GHz band Date: Wed, 19 Jun 2019 15:49:11 +0300 Message-Id: <20190619124916.14150-2-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005651_637746_2CEEBA06 X-CRM114-Status: GOOD ( 19.51 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add support for new hardware mode for 6GHz band. 6GHz operation is defined in "Draft IEEE P802.11ax/D4.1". 6GHz band adds 131-135 operating classes that define channels in frequency range from 5940MHz to 7105MHz. Signed-off-by: Andrei Otcheretianski --- hostapd/config_file.c | 2 + hostapd/hostapd.conf | 7 ++- src/ap/hw_features.c | 3 ++ src/common/defs.h | 1 + src/common/hw_features_common.c | 84 +++++++++++++++++++++++++++++++++ src/common/hw_features_common.h | 1 + src/common/ieee802_11_common.c | 23 +++++++++ wlantest/Makefile | 1 + 8 files changed, 121 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index c4106c1283..21671721c0 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3154,6 +3154,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->hw_mode = HOSTAPD_MODE_IEEE80211G; else if (os_strcmp(pos, "ad") == 0) conf->hw_mode = HOSTAPD_MODE_IEEE80211AD; + else if (os_strcmp(pos, "ax") == 0) + conf->hw_mode = HOSTAPD_MODE_IEEE80211AX; else if (os_strcmp(pos, "any") == 0) conf->hw_mode = HOSTAPD_MODE_IEEE80211ANY; else { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 71e577a89c..a25d3f0092 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -147,7 +147,8 @@ ssid=test # Operation mode (a = IEEE 802.11a (5 GHz), b = IEEE 802.11b (2.4 GHz), # g = IEEE 802.11g (2.4 GHz), ad = IEEE 802.11ad (60 GHz); a/g options are used # with IEEE 802.11n (HT), too, to specify band). For IEEE 802.11ac (VHT), this -# needs to be set to hw_mode=a. When using ACS (see channel parameter), a +# needs to be set to hw_mode=a. For IEEE 802.11ax (HE) on 6-7 GHz this needs +# to be set to hw_mode=ax. When using ACS (see channel parameter), a # special value "any" can be used to indicate that any support band can be used. # This special case is currently supported only with drivers with which # offloaded ACS is used. @@ -800,6 +801,10 @@ wmm_ac_vo_acm=0 #he_rts_threshold=0 # HE operating channel information; see matching vht_* parameters for details. +# On 6GHz band (hw_mode=ax) the center freq calculation starts from 5.940 offset. +# For example idx=3 would result in 5955MHz center frequency. In addition, +# he_oper_chwidth is ignored, and the channel width is derived from the +# configured center frequencies (See IEEE802.11ax/D4.1 Annex E) #he_oper_chwidth #he_oper_centr_freq_seg0_idx #he_oper_centr_freq_seg1_idx diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index c1f19e26b5..4ba4cc7437 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -158,6 +158,7 @@ int hostapd_prepare_rates(struct hostapd_iface *iface, basic_rates = iface->conf->basic_rates; else switch (mode->mode) { case HOSTAPD_MODE_IEEE80211A: + case HOSTAPD_MODE_IEEE80211AX: /* same as 5GHz */ basic_rates = basic_rates_a; break; case HOSTAPD_MODE_IEEE80211B: @@ -934,6 +935,8 @@ const char * hostapd_hw_mode_txt(int mode) return "IEEE 802.11g"; case HOSTAPD_MODE_IEEE80211AD: return "IEEE 802.11ad"; + case HOSTAPD_MODE_IEEE80211AX: + return "IEEE 802.11ax"; default: return "UNKNOWN"; } diff --git a/src/common/defs.h b/src/common/defs.h index 4faf1c8601..c6bb7c0286 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -348,6 +348,7 @@ enum hostapd_hw_mode { HOSTAPD_MODE_IEEE80211G, HOSTAPD_MODE_IEEE80211A, HOSTAPD_MODE_IEEE80211AD, + HOSTAPD_MODE_IEEE80211AX, HOSTAPD_MODE_IEEE80211ANY, NUM_HOSTAPD_MODES }; diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index 3fdbf893d2..9996ef2bf7 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -358,6 +358,25 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode, } +int center_idx_to_width_6ghz(u8 idx) +{ + /* channels: 1, 5, 9, 13... */ + if ((idx & 0x3) == 0x1) + return 0; /* 20mhz */ + /* channels 3, 11, 19... */ + if ((idx & 0x7) == 0x3) + return 1; /* 40mhz */ + /* channels 7, 23, 39.. */ + if ((idx & 0xf) == 0x7) + return 2; /* 80mhz */ + /* channels 15, 47, 79...*/ + if ((idx & 0x1f) == 0xf) + return 3; /* 160mhz */ + + return -1; +} + + int hostapd_set_freq_params(struct hostapd_freq_params *data, enum hostapd_hw_mode mode, int freq, int channel, int ht_enabled, @@ -381,6 +400,71 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, data->center_freq2 = 0; data->bandwidth = sec_channel_offset ? 40 : 20; + if (mode == HOSTAPD_MODE_IEEE80211AX) { + if (!data->he_enabled) { + wpa_printf(MSG_ERROR, + "Can't set 6GHz mode - HE isn't enabled"); + return -1; + } + + if (center_idx_to_width_6ghz(channel) != 0) { + wpa_printf(MSG_ERROR, + "Invalid control channel for 6Ghz band"); + return -1; + } + + if (!center_segment0) { + if (center_segment1) { + wpa_printf(MSG_ERROR, + "Center0 freq isn't set"); + return -1; + } + + data->center_freq1 = data->freq; + data->bandwidth = 20; + } else { + int freq1, freq2 = 0; + int bw = center_idx_to_width_6ghz(center_segment0); + + if (bw < 0 ) { + wpa_printf(MSG_ERROR, + "Invalid center channel idx for 6GHz"); + return -1; + } + + freq1 = ieee80211_chan_to_freq(NULL, 131, + center_segment0); + if (freq1 < 0) { + wpa_printf(MSG_ERROR, + "Invalid center0 freq. for 6GHz"); + return -1; + } + + if (center_segment1) { + if (center_idx_to_width_6ghz(center_segment1) != 2 || + bw != 2) { + wpa_printf(MSG_ERROR, + "6GHz 80+80 configuration doesn't use valid 80MHz channels"); + return -1; + } + + freq2 = ieee80211_chan_to_freq(NULL, 131, + center_segment1); + if (freq2 < 0) { + wpa_printf(MSG_ERROR, + "Invalid center1 freq. for UHB"); + return -1; + } + } + + data->bandwidth = (1 << (u8)bw) * 20; + data->center_freq1 = freq1; + data->center_freq2 = freq2; + } + + return 0; + } + if (data->vht_enabled) switch (oper_chwidth) { case CHANWIDTH_USE_HT: if (center_segment1 || diff --git a/src/common/hw_features_common.h b/src/common/hw_features_common.h index 2d2a539943..c75a79746a 100644 --- a/src/common/hw_features_common.h +++ b/src/common/hw_features_common.h @@ -45,5 +45,6 @@ u32 num_chan_to_bw(int num_chans); int chan_bw_allowed(const struct hostapd_channel_data *chan, u32 bw, int ht40_plus, int pri); int chan_pri_allowed(const struct hostapd_channel_data *chan); +int center_idx_to_width_6ghz(u8 idx); #endif /* HW_FEATURES_COMMON_H */ diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index a081f87cc2..8096e17409 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -15,6 +15,7 @@ #include "qca-vendor.h" #include "ieee802_11_defs.h" #include "ieee802_11_common.h" +#include "hw_features_common.h" static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, @@ -882,6 +883,19 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq, return HOSTAPD_MODE_IEEE80211AD; } + if (freq > 5940 && freq <= 7105) { + int bw; + u8 idx = (freq - 5940) / 5; + + bw = center_idx_to_width_6ghz(idx); + if (bw < 0) + return NUM_HOSTAPD_MODES; + + *channel = idx; + *op_class = 131 + bw; + return HOSTAPD_MODE_IEEE80211AX; + } + return NUM_HOSTAPD_MODES; } @@ -1161,6 +1175,14 @@ static int ieee80211_chan_to_freq_global(u8 op_class, u8 chan) if (chan < 36 || chan > 128) return -1; return 5000 + 5 * chan; + case 131: /* UHB channels, 20 mhz: 1, 5, 9.. */ + case 132: /* UHB channels, 40 mhz: 3, 11, 19.. */ + case 133: /* UHB channels, 80 mhz: 7, 23, 39.. */ + case 134: /* UHB channels, 160 mhz: 15, 47, 79.. */ + case 135: /* UHB channels, 80+80 mhz: 7, 23, 39.. */ + if (chan < 1 || chan > 233) + return -1; + return 5940 + chan * 5; case 180: /* 60 GHz band, channels 1..4 */ if (chan < 1 || chan > 4) return -1; @@ -1590,6 +1612,7 @@ const struct oper_class_map global_op_class[] = { { HOSTAPD_MODE_IEEE80211A, 128, 36, 161, 4, BW80, P2P_SUPP }, { HOSTAPD_MODE_IEEE80211A, 129, 50, 114, 16, BW160, P2P_SUPP }, { HOSTAPD_MODE_IEEE80211A, 130, 36, 161, 4, BW80P80, P2P_SUPP }, + { HOSTAPD_MODE_IEEE80211AX, 131, 1, 233, 4, BW20, NO_P2P_SUPP }, { HOSTAPD_MODE_IEEE80211AD, 180, 1, 4, 1, BW2160, P2P_SUPP }, { -1, 0, 0, 0, 0, BW20, NO_P2P_SUPP } }; diff --git a/wlantest/Makefile b/wlantest/Makefile index 4195a24dd1..8d5e69dd66 100644 --- a/wlantest/Makefile +++ b/wlantest/Makefile @@ -54,6 +54,7 @@ CFLAGS += -DCONFIG_FILS OBJS += ../src/common/ieee802_11_common.o OBJS += ../src/common/wpa_common.o +OBJS += ../src/common/hw_features_common.o OBJS += ../src/radius/radius.o OBJS += ../src/rsn_supp/wpa_ie.o From patchwork Wed Jun 19 12:49:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cOKkghC4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THNP6Pvdz9s6w for ; Wed, 19 Jun 2019 17:57:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HyjKvZzl0/N7tQruw9G821TVdclRVtvM9J7pHgafCpI=; b=cOKkghC4G6zH8w CnwbAykBtqnb92vLSVXZQEk/t3KbyJRkFgsexL9kQeAii1IpgiLb4I4WDb2WDOQ4iRd3FjwjYewr8 pv4/KfaCUcOEKqNIJLnhfE4pWhB3SEeNasaHHv53B2p0Fy7WGOY3dvdOjd0CqO23akR1dtr9slinW /GKM/eMxCXyCQnrL42MfWBXrvi6sk2Rkp2OzdFW/xfoYdjF4t/Ajk+fYFXNNEZS20Fx1dJ0ybA5RV eIztICi7Hn1VFFQcZ9/mFrJCTWGi1NL2CWBWD75DTNjZWNYlhSDhpJQs2sUB6J/X4AryW3qJ8W1kZ HegZoI2LcfcVg+auvzmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSs-0006tE-CU; Wed, 19 Jun 2019 07:57:06 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSg-0006ZZ-Nn for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:56:55 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:56:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537320" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:56:53 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 2/6] driver_nl80211: Support 6Ghz channels Date: Wed, 19 Jun 2019 15:49:12 +0300 Message-Id: <20190619124916.14150-3-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005654_792886_C0927DAC X-CRM114-Status: UNSURE ( 8.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Andrei Otcheretianski --- src/drivers/driver_nl80211_capa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index ab9b19f393..be7db5f4d6 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -1738,6 +1738,9 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes, } } else if (modes[m].channels[0].freq > 50000) modes[m].mode = HOSTAPD_MODE_IEEE80211AD; + else if (modes[m].channels[0].freq > 5940 && + modes[m].channels[0].freq <= 7105) + modes[m].mode = HOSTAPD_MODE_IEEE80211AX; else modes[m].mode = HOSTAPD_MODE_IEEE80211A; } @@ -2129,6 +2132,8 @@ static const char * modestr(enum hostapd_hw_mode mode) return "802.11g"; case HOSTAPD_MODE_IEEE80211A: return "802.11a"; + case HOSTAPD_MODE_IEEE80211AX: + return "802.11ax"; case HOSTAPD_MODE_IEEE80211AD: return "802.11ad"; default: From patchwork Wed Jun 19 12:49:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sQmtouoi"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THNf2bmnz9s3l for ; Wed, 19 Jun 2019 17:57:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=f5EweZHV1x/1cpmHYFjkOcRtmABgTWD6EZmeIYnjhSE=; b=sQmtouoiCKB3n4 0648FwwWyIVjtB0mpp+TwMEzC5DtDXwhGlNenrimi0AYhm2bWql4UqzwmHJuip8Pd0YY5zAzxq4SE WgjVTAQHeFOfojPFEYsz0z/Wzsyfdz8tM9x2h5WJkr+X344ng7VzY+aSZFSVY8EAZO80xYtL+ttuv 4xUXvIjotvi8riwfoXlTItyLAfavoy003daezqGxhA/OSK09Xwxl27PQ+xDecd8ommtcpB0XtetIV pL+PVriubMJ669Y19x2U7gkVPslhL4/irDwXCA0DNB6iI9+X/UtD3qV5XwydHanIZQFWZ5MRWnJxA 2lFGtUkBNIRGjehepK/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVT4-000793-09; Wed, 19 Jun 2019 07:57:18 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSi-0006ZZ-QQ for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:56:58 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:56:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537326" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:56:55 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 3/6] AP: Publish only HE capabilities and operation IEs on 6GHz band Date: Wed, 19 Jun 2019 15:49:13 +0300 Message-Id: <20190619124916.14150-4-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005657_062022_CB4ED861 X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When operating on 6GHz band, add "6 GHz Operation Information" inside the HE operation IE and don't publish HT/VHT IEs. Signed-off-by: Andrei Otcheretianski --- src/ap/beacon.c | 4 +++- src/ap/ieee802_11_he.c | 22 ++++++++++++++++++++-- src/ap/ieee802_11_ht.c | 11 ++++++++--- src/ap/ieee802_11_vht.c | 6 +++++- src/common/ieee802_11_defs.h | 4 ++++ 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 1838c1c843..c1aeb03a3d 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -498,7 +498,9 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, #endif /* CONFIG_FST */ #ifdef CONFIG_IEEE80211AC - if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) { + if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac && + hapd->iface->current_mode && + hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211AX) { pos = hostapd_eid_vht_capabilities(hapd, pos, 0); pos = hostapd_eid_vht_operation(hapd, pos); pos = hostapd_eid_txpower_envelope(hapd, pos); diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index ba22a174a3..9fc769ec33 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -17,6 +17,7 @@ #include "sta_info.h" #include "ieee802_11.h" #include "dfs.h" +#include "common/hw_features_common.h" static u8 ieee80211_he_ppet_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) { @@ -135,6 +136,9 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) if (!hapd->iface->current_mode) return eid; + if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AX) + oper_size += 5; + *pos++ = WLAN_EID_EXTENSION; *pos++ = 1 + oper_size; *pos++ = WLAN_EID_EXT_HE_OPERATION; @@ -163,9 +167,23 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) /* TODO: conditional MaxBSSID Indicator subfield */ - oper->he_oper_params = host_to_le32(params); + pos += 6; /* skip the fixed part */ + + if (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AX) { + u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf); + + if (!seg0) + seg0 = hapd->iconf->channel; - pos += oper_size; + params |= HE_OPERATION_6GHZ_OPER_INFO; + *pos++ = hapd->iconf->channel; + *pos++ = center_idx_to_width_6ghz(seg0); + *pos++ = seg0; + *pos++ = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf); + *pos++ = 6; /* TODO: what should be set here? */ + } + + oper->he_oper_params = host_to_le32(params); return pos; } diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c index 214855dccb..89241cf9e1 100644 --- a/src/ap/ieee802_11_ht.c +++ b/src/ap/ieee802_11_ht.c @@ -27,7 +27,8 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) u8 *pos = eid; if (!hapd->iconf->ieee80211n || !hapd->iface->current_mode || - hapd->conf->disable_11n) + hapd->conf->disable_11n || + hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AX) return eid; *pos++ = WLAN_EID_HT_CAP; @@ -84,7 +85,9 @@ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid) struct ieee80211_ht_operation *oper; u8 *pos = eid; - if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n) + if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n || + !hapd->iface->current_mode || + hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AX) return eid; *pos++ = WLAN_EID_HT_OPERATION; @@ -113,7 +116,9 @@ u8 * hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid) u8 sec_ch; if (!hapd->cs_freq_params.channel || - !hapd->cs_freq_params.sec_channel_offset) + !hapd->cs_freq_params.sec_channel_offset || + !hapd->iface->current_mode || + hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AX) return eid; if (hapd->cs_freq_params.sec_channel_offset == -1) diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c index 269345fbf8..8b060b12ea 100644 --- a/src/ap/ieee802_11_vht.c +++ b/src/ap/ieee802_11_vht.c @@ -26,7 +26,7 @@ u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid, u32 nsts) struct hostapd_hw_modes *mode = hapd->iface->current_mode; u8 *pos = eid; - if (!mode) + if (!mode || mode->mode == HOSTAPD_MODE_IEEE80211AX) return eid; if (mode->mode == HOSTAPD_MODE_IEEE80211G && hapd->conf->vendor_vht && @@ -75,6 +75,10 @@ u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_vht_operation *oper; u8 *pos = eid; + struct hostapd_hw_modes *mode = hapd->iface->current_mode; + + if (!mode || mode->mode == HOSTAPD_MODE_IEEE80211AX) + return eid; *pos++ = WLAN_EID_VHT_OPERATION; *pos++ = sizeof(*oper); diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index b0aa913bbc..a1e11c7143 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2174,6 +2174,10 @@ struct ieee80211_spatial_reuse { BIT(10) | BIT(11) | \ BIT(12) | BIT(13))) #define HE_OPERATION_RTS_THRESHOLD_OFFSET 4 +#define HE_OPERATION_VHT_OPER_INFO ((u32) BIT(14)) +#define HE_OPERATION_COHOSTED_BSS ((u32) BIT(15)) +#define HE_OPERATION_ER_SU_DISABLE ((u32) BIT(16)) +#define HE_OPERATION_6GHZ_OPER_INFO ((u32) BIT(17)) #define HE_OPERATION_BSS_COLOR_MASK ((u32) (BIT(24) | BIT(25) | \ BIT(26) | BIT(27) | \ BIT(28) | BIT(29))) From patchwork Wed Jun 19 12:49:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qS+mCwaF"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THPT6DV7z9s6w for ; Wed, 19 Jun 2019 17:58:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=E+EStkWZqyEquHUujN0adRBZLdhjgUl7wjWvPkvy6QU=; b=qS+mCwaFZd/BxI YS09Btfh1XUE7JG+nx9W0EXgeeMPzqUGzmlTzN1gWbu2ASlGjbp+9tS7VsdogOEYNRz/kfKONwcTx 091yWPoW4+uKcYYDzBcEQGzJpJHUc6Ldzr9rwYmaz3QJl/e9pyE4n60wDjoNrxNVdRMZ8xu0Z35+U bUsB0a/LLUdaQwGL3J807AkpQznHAzEJQUWkiEqoAItKqNT88BWRv9fV3RDizMcw7XPmNpFrPqm+c xRlBjZlGLI0kF3QOzZJOKTqM6A/RjVT7OgZNqNxm2WTvlAB8pfbgGf5EMaFX5eUYmSMemAcPCF+F6 O5FYcRE221llNeu1fr7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVTm-0007j4-21; Wed, 19 Jun 2019 07:58:02 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSl-0006ZZ-Az for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:57:00 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:56:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537334" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:56:57 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 4/6] AP: Simplify "i" definition in hostapd_config_free_bss() Date: Wed, 19 Jun 2019 15:49:14 +0300 Message-Id: <20190619124916.14150-5-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005659_444518_EED315DD X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Declare the variable only once and reuse it instead of openning unneeded scopes. Signed-off-by: Andrei Otcheretianski --- src/ap/ap_config.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 48d09bcf9d..5f0f2e0da7 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -593,6 +593,8 @@ static void hostapd_dpp_controller_conf_free(struct dpp_controller_conf *conf) void hostapd_config_free_bss(struct hostapd_bss_config *conf) { + size_t i; + if (conf == NULL) return; @@ -685,12 +687,8 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) os_free(conf->model_description); os_free(conf->model_url); os_free(conf->upc); - { - unsigned int i; - - for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++) - wpabuf_free(conf->wps_vendor_ext[i]); - } + for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++) + wpabuf_free(conf->wps_vendor_ext[i]); wpabuf_free(conf->wps_nfc_dh_pubkey); wpabuf_free(conf->wps_nfc_dh_privkey); wpabuf_free(conf->wps_nfc_dev_pw); @@ -716,7 +714,6 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) os_free(conf->hs20_operating_class); os_free(conf->hs20_icons); if (conf->hs20_osu_providers) { - size_t i; for (i = 0; i < conf->hs20_osu_providers_count; i++) { struct hs20_osu_provider *p; size_t j; @@ -734,8 +731,6 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) os_free(conf->hs20_osu_providers); } if (conf->hs20_operator_icon) { - size_t i; - for (i = 0; i < conf->hs20_operator_icon_count; i++) os_free(conf->hs20_operator_icon[i]); os_free(conf->hs20_operator_icon); From patchwork Wed Jun 19 12:49:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LeHJ9JRv"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THPm0yBNz9s6w for ; Wed, 19 Jun 2019 17:58:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ARVIMfbCvVn4RFeC50Eer7ihbTv8sLHtfipkHJQYJug=; b=LeHJ9JRvi8+b9Q QrdEWjHmA//7FL52pr5W4aztLGUSmHGgI8lvIj3Qb0ZI0gVG52sxNBCJZ4yN1M1/Q5wbQxPwsdWz1 rqZigMBdcT7E31t04oiMXkLoL2EwUaaQimGG9b6CbQ+kQviDkOJFKaPq0GpjXZ7JKbPUIqcgH2HOK 0uXpogRnpY2PbH0HuiUjER8B3nSJgiHSKiXFtqJ9P3InX7DmrgDeADjkHXQekCrpONByjQ0BOI2H/ r+HIaiQPhyG0LEsOankfJig+cfpsv34YTBUjFiIrEOVbSpHMZIJMxLo8RTtUykaXL/Ws/3xdbIFYf 1B5xpJO89FVAQYxvvKjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVU0-0007w4-2d; Wed, 19 Jun 2019 07:58:16 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSo-0006ZZ-3v for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:57:04 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:57:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537351" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:57:01 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 5/6] AP: Add support for co-located AP configuration Date: Wed, 19 Jun 2019 15:49:15 +0300 Message-Id: <20190619124916.14150-6-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005702_229794_E367A51B X-CRM114-Status: GOOD ( 18.52 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add configuration option to indicate co-located interfaces. When this configuration is set, the AP will publish Reduced Neighbor Report accordingly. It is possible to configure multiple co-located interfaces. Signed-off-by: Andrei Otcheretianski --- hostapd/Makefile | 1 + hostapd/config_file.c | 24 ++++++++++++ hostapd/hostapd.conf | 6 +++ src/ap/ap_config.c | 4 ++ src/ap/ap_config.h | 6 +++ src/ap/beacon.c | 74 ++++++++++++++++++++++++++++++++++++ src/ap/hostapd.c | 7 ++++ src/common/ieee802_11_defs.h | 15 ++++++++ wpa_supplicant/Makefile | 1 + 9 files changed, 138 insertions(+) diff --git a/hostapd/Makefile b/hostapd/Makefile index a8d77fed36..fbf0ee8535 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -157,6 +157,7 @@ OBJS_c += ../src/utils/wpa_debug.o OBJS += ../src/utils/wpabuf.o OBJS += ../src/utils/os_$(CONFIG_OS).o OBJS += ../src/utils/ip_addr.o +OBJS += ../src/utils/crc32.o OBJS += ../src/common/ieee802_11_common.o OBJS += ../src/common/wpa_common.o diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 21671721c0..322afe9115 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2411,6 +2411,27 @@ fail: } #endif /* CONFIG_SAE */ +static int parse_coloc_iface(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char **n; + + if (bss->n_coloc_ifaces >= MAX_COLOC_IFACES_NUM) + return -1; + + n = os_realloc_array(bss->coloc_ifaces, + bss->n_coloc_ifaces + 1, sizeof(char *)); + if (!n) + return -1; + + bss->coloc_ifaces = n; + bss->coloc_ifaces[bss->n_coloc_ifaces] = os_strdup(pos); + if (!bss->coloc_ifaces[bss->n_coloc_ifaces]) + return -1; + bss->n_coloc_ifaces++; + + return 0; +} #ifdef CONFIG_DPP2 static int hostapd_dpp_controller_parse(struct hostapd_bss_config *bss, @@ -4557,6 +4578,9 @@ static int hostapd_config_fill(struct hostapd_config *conf, } bss->mka_psk_set |= MKA_PSK_SET_CKN; #endif /* CONFIG_MACSEC */ + } else if (os_strcmp(buf, "co_located_iface") == 0) { + if (parse_coloc_iface(bss, pos, line) < 0) + return 1; } else { wpa_printf(MSG_ERROR, "Line %d: unknown configuration item '%s'", diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index a25d3f0092..ae33f0d5d9 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -2666,3 +2666,9 @@ own_ip_addr=127.0.0.1 #bss=wlan0_1 #bssid=00:13:10:95:fe:0b # ... + +# Co-located interfaces +# A list of co-located APs. These APs will be reported in Reduced Neighbor +# Report element in probe responses and beacons. +#co_located_iface=wlan1 +#co_located_iface=wlan2 diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 5f0f2e0da7..b371f87f99 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -788,6 +788,10 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) } #endif /* CONFIG_AIRTIME_POLICY */ + for (i = 0; i < conf->n_coloc_ifaces; i++) + os_free(conf->coloc_ifaces[i]); + os_free(conf->coloc_ifaces); + os_free(conf); } diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index fc6524c9e9..09e787b4c7 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -88,6 +88,7 @@ typedef enum hostap_security_policy { struct hostapd_ssid { u8 ssid[SSID_MAX_LEN]; size_t ssid_len; + u32 short_ssid; unsigned int ssid_set:1; unsigned int utf8_ssid:1; unsigned int wpa_passphrase_set:1; @@ -820,6 +821,11 @@ struct hostapd_bss_config { */ u8 mka_psk_set; #endif /* CONFIG_MACSEC */ + +#define MAX_COLOC_IFACES_NUM 16 + /* Array of colocated interfaces */ + char **coloc_ifaces; + size_t n_coloc_ifaces; }; /** diff --git a/src/ap/beacon.c b/src/ap/beacon.c index c1aeb03a3d..724e1d8ca5 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -365,6 +365,78 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) } +/* + * Add Reduced Neighbor Report element to Beacons and Probe Responses + */ +static u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid) +{ + u8 *pos = eid; +#ifdef CONFIG_FILS + u8 *len; + size_t i; + + if (!hapd->conf->n_coloc_ifaces || !hapd->iface->interfaces) + return eid; + + *pos++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; + len = pos++; + for (i = 0; i < hapd->conf->n_coloc_ifaces; i++) { + struct ieee80211_neighbor_ap_info *rnr; + struct hostapd_data *h = + hostapd_get_iface(hapd->iface->interfaces, + hapd->conf->coloc_ifaces[i]); + + if (!h || !h->started || !h->iface->current_mode || h == hapd) + continue; + + rnr = (struct ieee80211_neighbor_ap_info *)pos; + rnr->tbtt_info_hdr = 0; + if (h->conf->ssid.ssid_len == hapd->conf->ssid.ssid_len && + os_memcmp(h->conf->ssid.ssid, hapd->conf->ssid.ssid, + h->conf->ssid.ssid_len) == 0) { + rnr->tbtt_info_hdr |= RNR_TBTT_INFO_HDR_FILTERED; + /* TBTT offset + BSSID */ + rnr->tbtt_info_len = 7; + } else { + /* TBTT offset + BSSID + Short SSID */ + rnr->tbtt_info_len = 11; + } + rnr->tbtt_info_hdr |= RNR_TBTT_INFO_HDR_COLOC; + if (ieee80211_freq_to_channel_ext(h->iface->freq, + h->iconf->secondary_channel, + h->iconf->vht_oper_chwidth, + &rnr->op_class, + &rnr->channel) == + NUM_HOSTAPD_MODES) { + wpa_printf(MSG_DEBUG, + "Skipping colocated iface with invalid channel configuration (%s)", + hapd->conf->coloc_ifaces[i]); + /* It's safe to continue as pos isn't advanced yet */ + continue; + } + rnr->neighbor_ap_tbtt_offset = 255; /* Unknown */ + pos += sizeof(*rnr); + os_memcpy(pos, h->own_addr, ETH_ALEN); + pos += ETH_ALEN; + + /* Include Short SSID if needed */ + if (rnr->tbtt_info_len == 11) { + WPA_PUT_LE32(pos, h->conf->ssid.short_ssid); + pos += 4; + } + } + + *len = pos - eid - 2; + + /* don't add empty IE */ + if (*len == 0) + return eid; +#endif /* CONFIG_FILS */ + + return pos; +} + + static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len) @@ -508,6 +580,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AC */ + pos = hostapd_eid_rnr(hapd, pos); pos = hostapd_eid_fils_indic(hapd, pos, 0); #ifdef CONFIG_IEEE80211AX @@ -1224,6 +1297,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AC */ + tailpos = hostapd_eid_rnr(hapd, tailpos); tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0); #ifdef CONFIG_IEEE80211AX diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index c83fb2a464..5e886a44fd 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -10,6 +10,7 @@ #include "utils/common.h" #include "utils/eloop.h" +#include "utils/crc32.h" #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" @@ -1155,6 +1156,12 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } + /* + * Short SSID calculation is identical to FCS and it is defined in + * IEEE802.11-REVmd/D2.2 9.4.2.170.3 + */ + conf->ssid.short_ssid = crc32(conf->ssid.ssid, conf->ssid.ssid_len); + if (!hostapd_drv_none(hapd)) { wpa_printf(MSG_ERROR, "Using interface %s with hwaddr " MACSTR " and ssid \"%s\"", diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index a1e11c7143..30d81dade4 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2228,4 +2228,19 @@ struct ieee80211_he_mu_edca_parameter_set { /* DPP Public Action frame identifiers - OUI_WFA */ #define DPP_OUI_TYPE 0x1A +#define RNR_TBTT_INFO_HDR_FILTERED BIT(2) +#define RNR_TBTT_INFO_HDR_COLOC BIT(3) +#define RNR_TBTT_INFO_COUNT_OFFSET 4 + +struct ieee80211_neighbor_ap_info { + u8 tbtt_info_hdr; + u8 tbtt_info_len; + u8 op_class; + u8 channel; + /* The Neighbor AP TBTT Offset subfield is always present */ + u8 neighbor_ap_tbtt_offset; + /* Followed by the rest of the TBTT Information field contents */ + u8 data[0]; +} STRUCT_PACKED; + #endif /* IEEE802_11_DEFS_H */ diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 348f9015c2..ca83391174 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -891,6 +891,7 @@ OBJS += ../src/ap/utils.o OBJS += ../src/ap/authsrv.o OBJS += ../src/ap/ap_config.o OBJS += ../src/utils/ip_addr.o +OBJS += ../src/utils/crc32.o OBJS += ../src/ap/sta_info.o OBJS += ../src/ap/tkip_countermeasures.o OBJS += ../src/ap/ap_mlme.o From patchwork Wed Jun 19 12:49:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1118526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jxD9V8Tg"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45THQ05QtGz9s6w for ; Wed, 19 Jun 2019 17:58:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=k7OY9LAx6I8McwAx97Wv8gXRB8YyQs65GbEVpxP14U4=; b=jxD9V8Tgz/oBBV u/ybSv+LO5EmcPITpgGTQd+2HDNeBuQGgD2+wTX8RUEr1NDjRSi8jpNyqw71ACTxo8bB4783mWdQ7 6JYvi8ZjjJQeuZ6QQ6OmdcshVDyd9+V8dCKwnVeeLljBpwqpz8Pog7QYs3ye+p+jkbnLqvZAn+jmV e77FESweywuKexhswj22NKPLkSI8fa/dvpefla6doSDVRzmmkHI9c35HSe/hPY7YUvhgOH6XGpw7a PL96uQUVKaQ1OIL6HuonN9bOezsz0m4wo/SQvWeP7qZBPDZvaQ2Z5sAJ5JxZGvJj8EI1URLKZ5gkr GhWs5FtyEPgY2lcJBrkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdVUC-00088V-VO; Wed, 19 Jun 2019 07:58:29 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdVSq-0006ZZ-3D for hostap@lists.infradead.org; Wed, 19 Jun 2019 07:57:05 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 00:57:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="358537363" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.53]) by fmsmga006.fm.intel.com with ESMTP; 19 Jun 2019 00:57:02 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH 6/6] AP: Support Short SSID List element Date: Wed, 19 Jun 2019 15:49:16 +0300 Message-Id: <20190619124916.14150-7-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_005704_200818_E7E064C4 X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.151 listed in list.dnswl.org] 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org According to the Draft IEEE802.11ax/D4.1 (clause 11.1.4.3.4), AP should answer to probe requests if either SSID or Short SSID match and in addition it should also consider co-located BSSs. Signed-off-by: Andrei Otcheretianski --- src/ap/beacon.c | 58 +++++++++++++++++++++++++--------- src/common/ieee802_11_common.c | 4 +++ src/common/ieee802_11_common.h | 2 ++ src/common/ieee802_11_defs.h | 1 + 4 files changed, 50 insertions(+), 15 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 724e1d8ca5..01e93c4bf3 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -654,7 +654,9 @@ enum ssid_match_result { static enum ssid_match_result ssid_match(struct hostapd_data *hapd, const u8 *ssid, size_t ssid_len, const u8 *ssid_list, - size_t ssid_list_len) + size_t ssid_list_len, + const u8 *short_ssid_list, + size_t short_ssid_list_len) { const u8 *pos, *end; int wildcard = 0; @@ -665,20 +667,30 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, os_memcmp(ssid, hapd->conf->ssid.ssid, ssid_len) == 0) return EXACT_SSID_MATCH; - if (ssid_list == NULL) - return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; + if (ssid_list) { + pos = ssid_list; + end = ssid_list + ssid_list_len; + while (end - pos >= 2) { + if (2 + pos[1] > end - pos) + break; + if (pos[1] == 0) + wildcard = 1; + if (pos[1] == hapd->conf->ssid.ssid_len && + os_memcmp(pos + 2, hapd->conf->ssid.ssid, + pos[1]) == 0) + return EXACT_SSID_MATCH; + pos += 2 + pos[1]; + } + } - pos = ssid_list; - end = ssid_list + ssid_list_len; - while (end - pos >= 2) { - if (2 + pos[1] > end - pos) - break; - if (pos[1] == 0) - wildcard = 1; - if (pos[1] == hapd->conf->ssid.ssid_len && - os_memcmp(pos + 2, hapd->conf->ssid.ssid, pos[1]) == 0) - return EXACT_SSID_MATCH; - pos += 2 + pos[1]; + if (short_ssid_list) { + pos = short_ssid_list; + end = short_ssid_list + short_ssid_list_len; + while (end - pos >= 4) { + if (hapd->conf->ssid.short_ssid == WPA_GET_LE32(pos)) + return EXACT_SSID_MATCH; + pos += 4; + } } return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; @@ -943,7 +955,23 @@ void handle_probe_req(struct hostapd_data *hapd, #endif /* CONFIG_TAXONOMY */ res = ssid_match(hapd, elems.ssid, elems.ssid_len, - elems.ssid_list, elems.ssid_list_len); + elems.ssid_list, elems.ssid_list_len, + elems.short_ssid_list, elems.short_ssid_list_len); + for (i = 0; res == NO_SSID_MATCH && i < hapd->conf->n_coloc_ifaces; + i++) { + struct hostapd_data *h = + hostapd_get_iface(hapd->iface->interfaces, + hapd->conf->coloc_ifaces[i]); + + if (!h || !h->started || h == hapd) + continue; + + res = ssid_match(h, elems.ssid, elems.ssid_len, + elems.ssid_list, elems.ssid_list_len, + elems.short_ssid_list, + elems.short_ssid_list_len); + } + if (res == NO_SSID_MATCH) { if (!(mgmt->da[0] & 0x01)) { wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 8096e17409..a7fff371ae 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -283,6 +283,10 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen, elems->oci = pos; elems->oci_len = elen; break; + case WLAN_EID_EXT_SHORT_SSID_LIST: + elems->short_ssid_list = pos; + elems->short_ssid_list_len = elen; + break; default: if (show_errors) { wpa_printf(MSG_MSGDUMP, diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 9b045b41a3..5b44e8cddf 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -95,6 +95,7 @@ struct ieee802_11_elems { const u8 *multi_ap; const u8 *he_capabilities; const u8 *he_operation; + const u8 *short_ssid_list; u8 ssid_len; u8 supp_rates_len; @@ -145,6 +146,7 @@ struct ieee802_11_elems { u8 multi_ap_len; u8 he_capabilities_len; u8 he_operation_len; + u8 short_ssid_list_len; struct mb_ies_info mb_ies; }; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 30d81dade4..b9136d3d7a 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -470,6 +470,7 @@ #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 #define WLAN_EID_EXT_SPATIAL_REUSE 39 #define WLAN_EID_EXT_OCV_OCI 54 +#define WLAN_EID_EXT_SHORT_SSID_LIST 58 /* Extended Capabilities field */ #define WLAN_EXT_CAPAB_20_40_COEX 0