From patchwork Sat Oct 3 09:31:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 1376227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=HpFtnZSI; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.a=rsa-sha256 header.s=smtp header.b=AzAk/SQ7; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4C3M8K3VTsz9sSf for ; Sat, 3 Oct 2020 19:32:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=C768Fa2GI9nLB5BZ4QlzM8bAdNHJ3SS2jhmPbu6DZBI=; b=HpFtnZSIvSEKTw4cYD0Hvc5bTn kzdWT/QOQ9P4Va+uTCHl1G0wADjf7SqX5zjAbM+RoLSz7daN0OSS7/ETfuVbHCilsXXSY/UGSTgXJ C6Dlz5Fclf20B9S297Uq/cQnwXFwzuQLVkFCVcmJbcuakboJBF70nnf9ZY+5EFvuVAW0xfPPQSNtA PsrB5rzSD/ByUNxSBuFk1bw2xFdZPDo+3St8izhcl9lqiFA+tGAg7Gt46/5eD9E5fSsFz9VpYHGvt K0GKiGBp56TgjYaGUPb6UysnzXqmm5ax/HCLv+xwU0kKNpAgMXMyYdMG1s9FonxkoSIUoX+j0QjBT MTe5u9Fw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOdt3-0008Gz-Vr; Sat, 03 Oct 2020 09:31:30 +0000 Received: from z5.mailgun.us ([104.130.96.5]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOdt0-0008GF-LE for hostap@lists.infradead.org; Sat, 03 Oct 2020 09:31:27 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601717485; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=McjqpArvVLxaA5xX+tI1WPvAPlBOGW3W8IIE4s8xjCA=; b=AzAk/SQ7JtVLwcX9hSGuYUlGVD8pGJqQDAf00myeDGKyPwCuEG/C7jWyNIWDjMfhTZiYzHqZ ZmIbiUCLFnmrJ83keRBdVBcIa3l5XVZ9x7DC9MMj63fbnnXEk2567ik8msvfuVAcam9N1fOg 6yra8rFcxevbL9cISSJQZ31QOrU= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyJkMjNkOSIsICJob3N0YXBAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 5f7844ea83370fa1c1655ac4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 03 Oct 2020 09:31:22 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B2CF5C433C8; Sat, 3 Oct 2020 09:31:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED, BAYES_00, SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from rmanohar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rmanohar) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7F158C433CB; Sat, 3 Oct 2020 09:31:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7F158C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=rmanohar@codeaurora.org From: Rajkumar Manoharan To: j@w1.fi Subject: [PATCH 1/2] nl80211: Allow HE MCS rate selection for beacon frame Date: Sat, 3 Oct 2020 02:31:15 -0700 Message-Id: <1601717476-7674-1-git-send-email-rmanohar@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201003_053126_744842_B99BAC15 X-CRM114-Status: GOOD ( 18.49 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: hostap@lists.infradead.org, Rajkumar Manoharan MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Allow HE MCS rate to be used for beacon transmission when the driver advertises the support. Signed-off-by: Rajkumar Manoharan --- hostapd/config_file.c | 10 ++++++++++ hostapd/hostapd.conf | 2 ++ src/common/defs.h | 3 ++- src/drivers/driver.h | 10 ++++++---- src/drivers/driver_nl80211.c | 30 +++++++++++++++++++++++++++--- src/drivers/driver_nl80211_capa.c | 4 ++++ 6 files changed, 51 insertions(+), 8 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index f5e9d56c7042..826379e7563b 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3259,6 +3259,16 @@ static int hostapd_config_fill(struct hostapd_config *conf, } conf->rate_type = BEACON_RATE_VHT; conf->beacon_rate = val; + } else if (os_strncmp(pos, "he:", 3) == 0) { + val = atoi(pos + 3); + if (val < 0 || val > 11) { + wpa_printf(MSG_ERROR, + "Line %d: invalid beacon_rate HE-MCS %d", + line, val); + return 1; + } + conf->rate_type = BEACON_RATE_HE; + conf->beacon_rate = val; } else { val = atoi(pos); if (val < 10 || val > 10000) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 6255cc8fcb07..010bd6b0de17 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -279,6 +279,8 @@ fragm_threshold=-1 # beacon_rate=ht: # VHT: # beacon_rate=vht: +# HE: +# beacon_rate=he: # # For example, beacon_rate=10 for 1 Mbps or beacon_rate=60 for 6 Mbps (OFDM). #beacon_rate=10 diff --git a/src/common/defs.h b/src/common/defs.h index bbe3120de82f..f2dea89cda31 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -402,7 +402,8 @@ enum wpa_radio_work_band { enum beacon_rate_type { BEACON_RATE_LEGACY, BEACON_RATE_HT, - BEACON_RATE_VHT + BEACON_RATE_VHT, + BEACON_RATE_HE }; enum eap_proxy_sim_state { diff --git a/src/drivers/driver.h b/src/drivers/driver.h index e8defaba2118..7e44b2f710ee 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1256,14 +1256,14 @@ struct wpa_driver_ap_params { * * This parameter can be used to set a specific Beacon frame data rate * for the BSS. The interpretation of this value depends on the - * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS). If - * beacon_rate == 0 and rate_type == 0 (BEACON_RATE_LEGACY), the default - * Beacon frame data rate is used. + * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS, + * HE: HE-MCS). If beacon_rate == 0 and rate_type == 0 + * (BEACON_RATE_LEGACY), the default Beacon frame data rate is used. */ unsigned int beacon_rate; /** - * beacon_rate_type: Beacon data rate type (legacy/HT/VHT) + * beacon_rate_type: Beacon data rate type (legacy/HT/VHT/HE) */ enum beacon_rate_type rate_type; @@ -1933,6 +1933,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX 0x0000000000000001ULL /** Driver supports TX status reports for EAPOL frames through control port */ #define WPA_DRIVER_FLAGS2_CONTROL_PORT_TX_STATUS 0x0000000000000002ULL +/** Driver supports Beacon frame TX rate configuration (HE rates) */ +#define WPA_DRIVER_FLAGS2_BEACON_RATE_HE 0x0000000000000004ULL u64 flags2; #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \ diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index c435d54b5168..1ce16ce31902 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4160,7 +4160,8 @@ static int nl80211_set_mesh_config(void *priv, #endif /* CONFIG_MESH */ -static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags, +static int nl80211_put_beacon_rate(struct nl_msg *msg, + const u64 flags, const u64 flags2, struct wpa_driver_ap_params *params) { struct nlattr *bands, *band; @@ -4182,7 +4183,10 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags, band = nla_nest_start(msg, NL80211_BAND_2GHZ); break; case HOSTAPD_MODE_IEEE80211A: - band = nla_nest_start(msg, NL80211_BAND_5GHZ); + if (is_6ghz_freq(params->freq->freq)) + band = nla_nest_start(msg, NL80211_BAND_6GHZ); + else + band = nla_nest_start(msg, NL80211_BAND_5GHZ); break; case HOSTAPD_MODE_IEEE80211AD: band = nla_nest_start(msg, NL80211_BAND_60GHZ); @@ -4250,6 +4254,25 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags, wpa_printf(MSG_DEBUG, " * beacon_rate = VHT-MCS %u", params->beacon_rate); break; + case BEACON_RATE_HE: + if (!(flags2 & WPA_DRIVER_FLAGS2_BEACON_RATE_HE)) { + wpa_printf(MSG_INFO, + "nl80211: Driver does not support setting Beacon frame rate (HE)"); + return -1; + } + he_rate.mcs[0] = BIT(params->beacon_rate); + if (nla_put(msg, NL80211_TXRATE_LEGACY, 0, NULL)) + return -1; + if (nla_put(msg, NL80211_TXRATE_HT, 0, NULL)) + return -1; + if (nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate), + &vht_rate)) + return -1; + if (nla_put(msg, NL80211_TXRATE_HE, sizeof(he_rate), &he_rate)) + return -1; + wpa_printf(MSG_DEBUG, " * beacon_rate = HE-MCS %u", + params->beacon_rate); + break; } nla_nest_end(msg, band); @@ -4348,7 +4371,8 @@ static int wpa_driver_nl80211_set_ap(void *priv, nla_put(msg, NL80211_ATTR_BEACON_TAIL, params->tail_len, params->tail) || nl80211_put_beacon_int(msg, params->beacon_int) || - nl80211_put_beacon_rate(msg, drv->capa.flags, params) || + nl80211_put_beacon_rate(msg, drv->capa.flags, drv->capa.flags2, + params) || nl80211_put_dtim_period(msg, params->dtim_period) || nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid)) goto fail; diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 46f61fdbf925..c533f090ccfa 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -559,6 +559,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info, capa->flags |= WPA_DRIVER_FLAGS_BEACON_RATE_VHT; if (ext_feature_isset(ext_features, len, + NL80211_EXT_FEATURE_BEACON_RATE_HE)) + capa->flags2 |= WPA_DRIVER_FLAGS2_BEACON_RATE_HE; + + if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_SET_SCAN_DWELL)) capa->rrm_flags |= WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL; From patchwork Sat Oct 3 09:31:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 1376226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=z6WEi71L; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.a=rsa-sha256 header.s=smtp header.b=MQcdPAVB; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4C3M8F5yrvz9ryj for ; Sat, 3 Oct 2020 19:32:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To: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:List-Owner; bh=0LXcTpRI5n3YjAOLtM8oxnwNzwvYn0i/O1XIzdKZo+E=; b=z6WEi71L2ZxFnIbmCqKrkV8Eoi ZauUf91T9q5FNo2UHVDE+bm85htUsSXsa4jLIDizF29EVHbt0ZEgpY7vujMEr90GOtuTnioxr+Gt4 gwOJDhzBmLywGbL7TQfr7yUeU0YRGQIt51NUBwhwQlEEmniqA1KHINfkvYzPlEYTkaWix0jMnHNlc Amqs9LQhtq/E5DGiinpPM/ZJZMMdhrbUZ1TdSpIR1LnelRbAOXrtbCeoqHo4xYoQn5GVjPDl7cbDL nhX5GLp+iAwX8LUe3SMvWl6SGEllP7GEFrRu+R7nYPWBL8nycZ4P9lfnG39bjwXaxUnv6cHp48f8K 0JvZX1Ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOdt4-0008H7-Mr; Sat, 03 Oct 2020 09:31:30 +0000 Received: from z5.mailgun.us ([104.130.96.5]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOdt0-0008GG-LE for hostap@lists.infradead.org; Sat, 03 Oct 2020 09:31:27 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601717485; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=KSxu8fvKY/xlEUa8jfar6fLf17llaoMR2PUF1+anpeM=; b=MQcdPAVBZIVR/aPJ/eFpeGjQtirnOXVht63yyfsfRPLY1nTBT54WejIZ7K1YtB0lKQvUz/zW juaMPPf63P8BYD7iGBay4cSGYmjKPJ7ZVnAaN+1q1/Nwn6VmagjMKbMCw53pSx8iR7dSzSR/ eQRDJTlmZxv4z+7AROTCy7owbek= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyJkMjNkOSIsICJob3N0YXBAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 5f7844ed4fce93c117a6089d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 03 Oct 2020 09:31:25 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8050CC433C8; Sat, 3 Oct 2020 09:31:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED, BAYES_00, SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from rmanohar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rmanohar) by smtp.codeaurora.org (Postfix) with ESMTPSA id 99AA4C433CB; Sat, 3 Oct 2020 09:31:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 99AA4C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=rmanohar@codeaurora.org From: Rajkumar Manoharan To: j@w1.fi Subject: [PATCH 2/2] AP: Extend Spatial Reuse Parameter Set Date: Sat, 3 Oct 2020 02:31:16 -0700 Message-Id: <1601717476-7674-2-git-send-email-rmanohar@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601717476-7674-1-git-send-email-rmanohar@codeaurora.org> References: <1601717476-7674-1-git-send-email-rmanohar@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201003_053126_737132_1CD64EBB X-CRM114-Status: GOOD ( 20.46 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: hostap@lists.infradead.org, Rajkumar Manoharan MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Extend SPR element to support following fields and pass all information to kernel for driver use. * Non-SRG OBSS PD Max Offset * SRG BSS Color Bitmap * SRG Partial BSSID Bitmap Signed-off-by: Rajkumar Manoharan --- hostapd/config_file.c | 46 +++++++++++++++++++++++++++++++++++++++++++- hostapd/hostapd.conf | 16 ++++++++++++++- src/ap/ap_config.h | 4 ++-- src/ap/beacon.c | 8 +++++++- src/ap/ieee802_11_he.c | 5 +++++ src/drivers/driver.h | 25 ++++++++++++++++++++---- src/drivers/driver_nl80211.c | 30 ++++++++++++++++++++++------- 7 files changed, 118 insertions(+), 16 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 826379e7563b..0d7846c9fcdf 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -905,6 +905,32 @@ static int hostapd_parse_intlist(int **int_list, char *val) } +static int hostapd_parse_he_srg_bitmap(u8 *bitmap, char *val) +{ + int bitpos; + char *pos, *end; + + os_memset(bitmap, 0, 8); + pos = val; + while (*pos != '\0') { + end = os_strchr(pos, ' '); + if (end) + *end = '\0'; + + bitpos = atoi(pos); + if (bitpos > 64) + return -1; + + bitmap[bitpos / 8] |= (1 << (bitpos % 8)); + if (!end) + break; + pos = end + 1; + } + + return 0; +} + + static int hostapd_config_bss(struct hostapd_config *conf, const char *ifname) { struct hostapd_bss_config **all, *bss; @@ -3550,13 +3576,31 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->he_mu_edca.he_mu_ac_vo_param[HE_MU_AC_PARAM_TIMER_IDX] = atoi(pos) & 0xff; } else if (os_strcmp(buf, "he_spr_sr_control") == 0) { - conf->spr.sr_control = atoi(pos) & 0xff; + conf->spr.sr_control = atoi(pos) & 0x1f; } else if (os_strcmp(buf, "he_spr_non_srg_obss_pd_max_offset") == 0) { conf->spr.non_srg_obss_pd_max_offset = atoi(pos); } else if (os_strcmp(buf, "he_spr_srg_obss_pd_min_offset") == 0) { conf->spr.srg_obss_pd_min_offset = atoi(pos); } else if (os_strcmp(buf, "he_spr_srg_obss_pd_max_offset") == 0) { conf->spr.srg_obss_pd_max_offset = atoi(pos); + } else if (os_strcmp(buf, "he_spr_srg_bss_colors") == 0) { + if (hostapd_parse_he_srg_bitmap( + conf->spr.srg_bss_color_bitmap, + pos)) { + wpa_printf(MSG_ERROR, + "Line %d: Invalid srg bss colors list '%s'", + line, pos); + return 1; + } + } else if (os_strcmp(buf, "he_spr_srg_partial_bssid") == 0) { + if (hostapd_parse_he_srg_bitmap( + conf->spr.srg_partial_bssid_bitmap, + pos)) { + wpa_printf(MSG_ERROR, + "Line %d: Invalid srg partial bssid list '%s'", + line, pos); + return 1; + } } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { conf->he_oper_chwidth = atoi(pos); } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 010bd6b0de17..29accb0d56f6 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -868,7 +868,21 @@ wmm_ac_vo_acm=0 #he_spr_non_srg_obss_pd_max_offset #he_spr_srg_obss_pd_min_offset #he_spr_srg_obss_pd_max_offset - +# +# SPR SRG BSS Color +# This config represents SRG BSS Color Bitmap field of Spatial Reuse Parameter +# Set element that indicates the BSS color values used by members of the +# SRG of which the transmitting STA is a member. The value is in range of 0 - 63. +#he_spr_srg_bss_colors=1 2 10 63 +# +# SPR SRG Partial BSSID +# This config represents SRG Partial BSSID Bitmap field of Spatial Reuse Parameter +# Set element that indicates the Partial BSSID values used by members of the SRG of +# which the transmitting STA is a member. The value range corresponds to one of the 64 +# possible values of BSSID[39:44], where the lowest numbered bit corresponds to Partial +# BSSID value 0 and the highest numbered bit corresponds to Partial BSSID value 63. +#he_spr_srg_partial_bssid=0 1 3 63 +# #he_6ghz_max_mpdu: Maximum MPDU Length of HE 6 GHz band # capabilities. Indicates maximum MPDU length # 0 = 3895 octets diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index a96a46e2ed78..97f251ba1107 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -893,8 +893,8 @@ struct spatial_reuse { u8 non_srg_obss_pd_max_offset; u8 srg_obss_pd_min_offset; u8 srg_obss_pd_max_offset; - u8 srg_obss_color_bitmap; - u8 srg_obss_color_partial_bitmap; + u8 srg_bss_color_bitmap[8]; + u8 srg_partial_bssid_bitmap[8]; }; /** diff --git a/src/ap/beacon.c b/src/ap/beacon.c index b3b33b7faf1d..3b8cbf43a913 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1493,11 +1493,17 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) params.assocresp_ies = assocresp; params.reenable = hapd->reenable_beacon; #ifdef CONFIG_IEEE80211AX - params.he_spr = !!hapd->iface->conf->spr.sr_control; + params.he_spr_ctrl = hapd->iface->conf->spr.sr_control; + params.he_spr_non_srg_obss_pd_max_offset = + hapd->iface->conf->spr.non_srg_obss_pd_max_offset; params.he_spr_srg_obss_pd_min_offset = hapd->iface->conf->spr.srg_obss_pd_min_offset; params.he_spr_srg_obss_pd_max_offset = hapd->iface->conf->spr.srg_obss_pd_max_offset; + os_memcpy(params.he_spr_bss_color_bitmap, + hapd->iface->conf->spr.srg_bss_color_bitmap, 8); + os_memcpy(params.he_spr_partial_bssid_bitmap, + hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); params.he_bss_color_disabled = hapd->iface->conf->he_op.he_bss_color_disabled; params.he_bss_color_partial = diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index 607020b67677..04eda89d2099 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -304,6 +304,11 @@ u8 * hostapd_eid_spatial_reuse(struct hostapd_data *hapd, u8 *eid) if (spr->sr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) { *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_min_offset; *spr_param++ = hapd->iface->conf->spr.srg_obss_pd_max_offset; + os_memcpy(spr_param, + hapd->iface->conf->spr.srg_bss_color_bitmap, 8); + spr_param += 8; + os_memcpy(spr_param, + hapd->iface->conf->spr.srg_partial_bssid_bitmap, 8); pos += 18; } diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 7e44b2f710ee..3ba516e96b43 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1475,19 +1475,36 @@ struct wpa_driver_ap_params { const struct wpabuf *civic; /** - * he_spr - Whether Spatial Reuse is enabled + * he_spr_ctrl - Spatial Reuse control field of SPR element */ - int he_spr; + u8 he_spr_ctrl; + + /** + * he_spr_non_srg_obss_pd_max_offset - Non-SRG Maximum TX power offset + */ + u8 he_spr_non_srg_obss_pd_max_offset; /** * he_spr_srg_obss_pd_min_offset - Minimum TX power offset */ - int he_spr_srg_obss_pd_min_offset; + u8 he_spr_srg_obss_pd_min_offset; /** * he_spr_srg_obss_pd_max_offset - Maximum TX power offset */ - int he_spr_srg_obss_pd_max_offset; + u8 he_spr_srg_obss_pd_max_offset; + + /** + * he_spr_bss_color_bitmap - BSS color values used by members of the + * SRG. + */ + u8 he_spr_bss_color_bitmap[8]; + + /** + * he_spr_partial_bssid_bitmap - Partial BSSID values used by members + * of the SRG. + */ + u8 he_spr_partial_bssid_bitmap[8]; /** * he_bss_color - Whether the BSS Color is disabled diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1ce16ce31902..e2b1681e0b01 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4550,17 +4550,33 @@ static int wpa_driver_nl80211_set_ap(void *priv, } #ifdef CONFIG_IEEE80211AX - if (params->he_spr) { + if (params->he_spr_ctrl) { struct nlattr *spr; spr = nla_nest_start(msg, NL80211_ATTR_HE_OBSS_PD); - wpa_printf(MSG_DEBUG, "nl80211: he_spr=%d", params->he_spr); + wpa_printf(MSG_DEBUG, "nl80211: he_spr_ctrl=%x", + params->he_spr_ctrl); - if (!spr || - nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, - params->he_spr_srg_obss_pd_min_offset) || - nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, - params->he_spr_srg_obss_pd_max_offset)) + if (!spr || nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_SR_CTRL, + params->he_spr_ctrl)) + goto fail; + + if ((params->he_spr_ctrl & SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT) && + nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET, + params->he_spr_non_srg_obss_pd_max_offset)) + goto fail; + + if ((params->he_spr_ctrl & SPATIAL_REUSE_SRG_INFORMATION_PRESENT) && + (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET, + params->he_spr_srg_obss_pd_min_offset) || + nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET, + params->he_spr_srg_obss_pd_max_offset) || + nla_put(msg, NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP, + sizeof(params->he_spr_bss_color_bitmap), + params->he_spr_bss_color_bitmap) || + nla_put(msg, NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP, + sizeof(params->he_spr_partial_bssid_bitmap), + params->he_spr_partial_bssid_bitmap))) goto fail; nla_nest_end(msg, spr);