From patchwork Tue Oct 30 13:16:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 990970 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=none (p=none dis=none) header.from=quantenna.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eQaE+hBo"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quantenna.com header.i=@quantenna.com header.b="LeVMlywB"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kxVF5JGWz9s7T for ; Wed, 31 Oct 2018 03:18:45 +1100 (AEDT) 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=5sHAf50Dwm/RczbdOxWEwAmmuKBb1DoEKdP0DZkxnh8=; b=eQaE+hBoYKHJHn YfQvsn2EdL5L7vegdTQiZnFShJJzJYBp/E1bJlNAVPLCQLuusNEB0t7pAp6bgShKveEYO+m2+qRWN 0UEdW50HVPB39jeHGCruE0ADLotBZSDpW8Fb4lbdVjgFwJlsX9prL2KDz3irAIJvjmCER7RK4lOZy 5CLyJjkniXKN8C3Wt9Tn74aFhCmsKEQj11LqaFw+gxb+zLSreyUEeZSnFsLr6YVps2rdqTPjx0shB DmZ5KPXIJYO6HPTh7/T6P2GUA/j+xAhzL0+Hf2p902pI/Px4Hi+EPw2kUZk+B+/e0HP7t70Fi7JqQ s6aCGpBnA01Tpwl+A0GQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWim-0004mv-Oo; Tue, 30 Oct 2018 16:18:24 +0000 Received: from mail-eopbgr680083.outbound.protection.outlook.com ([40.107.68.83] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHWKy-0000dn-22 for hostap@lists.infradead.org; Tue, 30 Oct 2018 15:53:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qeI8DE0SfvVHHHeCLAIDQ28vRspGdtlodeK4F8oaBZE=; b=LeVMlywB/bO4qJUzMOhJ2HzHCoADO+x2C1el6/fFy229nrOdl7FPEMe3U1uSOD2XLJxwqjNBPaMkd2OHRFHtFJE0INbTog7BYyMp7WONV5gTQ8VcfcQILqp23yJJZqL+8M63ZecHzfE/2Y+5w89J1fDdT3NCj3Rf1KbijMU07hM= Received: from BL0SPR01MB0020.namprd05.prod.outlook.com (20.177.146.138) by BL0PR05MB5236.namprd05.prod.outlook.com (20.177.242.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.12; Tue, 30 Oct 2018 13:16:48 +0000 Received: from BL0SPR01MB0020.namprd05.prod.outlook.com ([fe80::fce8:69f:f659:27d8]) by BL0SPR01MB0020.namprd05.prod.outlook.com ([fe80::fce8:69f:f659:27d8%3]) with mapi id 15.20.1294.018; Tue, 30 Oct 2018 13:16:47 +0000 From: Sergey Matyukevich To: "hostap@lists.infradead.org" Subject: [PATCH] wpa_supplicant: allow overriding HT STBC capabilities Thread-Topic: [PATCH] wpa_supplicant: allow overriding HT STBC capabilities Thread-Index: AQHUcFLPXazRdMAJZUqXGgeBIl6CiA== Date: Tue, 30 Oct 2018 13:16:47 +0000 Message-ID: <20181030131640.14901-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P189CA0025.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::38) To BL0SPR01MB0020.namprd05.prod.outlook.com (2603:10b6:208:72::10) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BL0PR05MB5236; 6:xTtpSigipFoQhb4gvfa6qN+9jnx7NnON0wVrTeVs51oZ0VLd+DVNs4jNPs1bto12jaGk9+qZybztqAAkfhXALyoKQ3/MjzvTf3KB1aUsataB/pxD+4lHS0GhjpgVYtHLQx2aCw1xV2XZIbjVJsnCs7HXdjf3qgMQ2598Muq/pFvAiDjHcpzTfYTdy2pvU13XOEWXtks1KMmzB38mmerEPJROnKJ5jgXQeVLLbBf/ruauoVIbkZiSZOOpHEbR8PNwrwNL1tNyqfdbWn3kBWSunFun5HKUiSVvzi4U34z5373dA0RC5fI/90PpqF8dCLCRtQuJ5B+bXpHM9rl63YQlI2y5/0G5nIIYIbneBS3vF1txHznp8MuOfJDAWy/9DiDzauVqid1E5+3Iv4wdMA5DE63zw008K+2fxNnEM6YE0VcTCwx2MC9LDrE45NaVE/85hXrLJpfWZrTibf02BS47Ng==; 5:X7k14QIZpWEIogtSH65bxV1LpEoVDANLZpubZI9OtC8rtRey0e4y9x3IQIiPjQ9I/hJlR024ugsa2JXL6nKuYtgQAD6JH69oWEIkmObi8pPjH3CJKqLHw14M5qTx3VdpfhUrjUZrgegC+TJUzDI9UCILgI0yW9UR4rjM/B/LMAI=; 7:WfCiWV15OEDXSaXn0ZP+tVTSqVDjvTlstQt13ba0IAIa4d1xqGqv9b+MI1RZBzvEVIdkkc/Y4Wz9aBuGxp/gFTfd8mp1uEb5eqbs86xYBPbw9LAEDeTJdU4QIZqF4Uc1fuyMpKGAw8Tkse001acoXg== x-ms-office365-filtering-correlation-id: c8c7d66c-c067-4b18-be64-08d63e69f1bd x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:BL0PR05MB5236; x-ms-traffictypediagnostic: BL0PR05MB5236: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:BL0PR05MB5236; BCL:0; PCL:0; RULEID:; SRVR:BL0PR05MB5236; x-forefront-prvs: 08417837C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(376002)(396003)(136003)(346002)(189003)(199004)(5660300001)(107886003)(6436002)(575784001)(86362001)(68736007)(105586002)(106356001)(81166006)(81156014)(102836004)(8936002)(36756003)(97736004)(6486002)(6506007)(5640700003)(2501003)(53936002)(386003)(2900100001)(5250100002)(6512007)(256004)(14444005)(8676002)(2616005)(26005)(1730700003)(2351001)(2906002)(66066001)(476003)(1076002)(316002)(52116002)(25786009)(3846002)(6116002)(4326008)(103116003)(14454004)(6916009)(99286004)(305945005)(1857600001)(54906003)(478600001)(486006)(7736002)(186003)(71190400001)(71200400001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR05MB5236; H:BL0SPR01MB0020.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: h4sYwb46SJuJRp98TY8MJD740jM/COb7EFU8S/9CgU+ggPD89jMago/4mc5E0Rby8ZmkQY0HrmJi0vHlR+JKKgwcjfP+q+XPhHpKitb3EUZLfXQVV55URKpnEwOH5DG6NqDutklfOnEIW39i14I4T2p1a98TuhXEXwGPrQzgKg5kZ1g1WxOTQpXk8KoH+MkjmtKMM4Kv+IU7Lp2Bxt3U/0z8Kp9Mc4uZFoAbHLiKEVZ9rPvj9CGR6s4LQbhKTaISDhaTWkC1/xjpHI/CCq08DMESYPUgxm2a9kJGb2bb0xWi5kv5hYCqSwdhqTIUyHRwMQ2p07tMPEX4rchb9FE9o5ZzfemfnPxp5+iDGr5d2oM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8c7d66c-c067-4b18-be64-08d63e69f1bd X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2018 13:16:47.5171 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR05MB5236 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_085352_766331_7C2505E5 X-CRM114-Status: GOOD ( 17.95 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [40.107.68.83 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mitsyanko , Sergey Matyukevich Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Allow user to override STBC configuration for Rx and Tx spatial streams. Add new configuration options to test for HT capability overrides. Signed-off-by: Sergey Matyukevich --- tests/hwsim/test_ap_ht.py | 2 +- tests/hwsim/wpasupplicant.py | 3 ++- wpa_supplicant/config.c | 4 +++ wpa_supplicant/config_file.c | 2 ++ wpa_supplicant/config_ssid.h | 16 ++++++++++++ wpa_supplicant/wpa_cli.c | 2 +- wpa_supplicant/wpa_supplicant.c | 51 ++++++++++++++++++++++++++++++++++++++ wpa_supplicant/wpa_supplicant.conf | 14 +++++++++++ 8 files changed, 91 insertions(+), 3 deletions(-) diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index 11440ffaf..f3dc7eec6 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -848,7 +848,7 @@ def test_ap_require_ht(dev, apdev): ht_mcs="0x01 00 00 00 00 00 00 00 00 00", disable_max_amsdu="1", ampdu_factor="2", ampdu_density="1", disable_ht40="1", disable_sgi="1", - disable_ldpc="1") + disable_ldpc="1", rx_stbc="2", tx_stbc="1") @remote_compatible def test_ap_require_ht_limited_rates(dev, apdev): diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 78b5f6dc3..1a6cee01c 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -1031,7 +1031,8 @@ class WpaSupplicant: "dpp_csign", "dpp_csign_expiry", "dpp_netaccesskey", "dpp_netaccesskey_expiry", "group_mgmt", "owe_group", - "roaming_consortium_selection" ] + "roaming_consortium_selection", + "rx_stbc", "tx_stbc" ] for field in not_quoted: if field in kwargs and kwargs[field]: self.set_network(id, field, kwargs[field]) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index ced77ebda..8a4f4086d 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2267,6 +2267,8 @@ static const struct parse_data ssid_fields[] = { { INT_RANGE(disable_sgi, 0, 1) }, { INT_RANGE(disable_ldpc, 0, 1) }, { INT_RANGE(ht40_intolerant, 0, 1) }, + { INT_RANGE(tx_stbc, -1, 1) }, + { INT_RANGE(rx_stbc, -1, 3) }, { INT_RANGE(disable_max_amsdu, -1, 1) }, { INT_RANGE(ampdu_factor, -1, 3) }, { INT_RANGE(ampdu_density, -1, 7) }, @@ -2786,6 +2788,8 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid) ssid->disable_ht40 = DEFAULT_DISABLE_HT40; ssid->disable_sgi = DEFAULT_DISABLE_SGI; ssid->disable_ldpc = DEFAULT_DISABLE_LDPC; + ssid->tx_stbc = DEFAULT_TX_STBC; + ssid->rx_stbc = DEFAULT_RX_STBC; ssid->disable_max_amsdu = DEFAULT_DISABLE_MAX_AMSDU; ssid->ampdu_factor = DEFAULT_AMPDU_FACTOR; ssid->ampdu_density = DEFAULT_AMPDU_DENSITY; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index aa73f9df6..76f0c6d72 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -886,6 +886,8 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) INT_DEF(disable_sgi, DEFAULT_DISABLE_SGI); INT_DEF(disable_ldpc, DEFAULT_DISABLE_LDPC); INT(ht40_intolerant); + INT_DEF(tx_stbc, DEFAULT_TX_STBC); + INT_DEF(rx_stbc, DEFAULT_RX_STBC); INT_DEF(disable_max_amsdu, DEFAULT_DISABLE_MAX_AMSDU); INT_DEF(ampdu_factor, DEFAULT_AMPDU_FACTOR); INT_DEF(ampdu_density, DEFAULT_AMPDU_DENSITY); diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h index d2a52d760..6a1a331e3 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -33,6 +33,8 @@ #define DEFAULT_DISABLE_HT40 0 #define DEFAULT_DISABLE_SGI 0 #define DEFAULT_DISABLE_LDPC 0 +#define DEFAULT_TX_STBC -1 /* no change */ +#define DEFAULT_RX_STBC -1 /* no change */ #define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */ #define DEFAULT_AMPDU_FACTOR -1 /* no change */ #define DEFAULT_AMPDU_DENSITY -1 /* no change */ @@ -682,6 +684,20 @@ struct wpa_ssid { * By default (empty string): Use whatever the OS has configured. */ char *ht_mcs; + + /** + * tx_stbc - Indicate STBC support for TX streams + * + * Value: -1..1, by default (-1): use whatever the OS or card has configured. + */ + int tx_stbc; + + /** + * rx_stbc - Indicate STBC support for RX streams + * + * Value: -1..3, by default (-1): use whatever the OS or card has configured. + */ + int rx_stbc; #endif /* CONFIG_HT_OVERRIDES */ #ifdef CONFIG_VHT_OVERRIDES diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 05e3ebf2f..7352a402c 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -1412,7 +1412,7 @@ static const char *network_fields[] = { #ifdef CONFIG_HT_OVERRIDES "disable_ht", "disable_ht40", "disable_sgi", "disable_ldpc", "ht40_intolerant", "disable_max_amsdu", "ampdu_factor", - "ampdu_density", "ht_mcs", + "ampdu_density", "ht_mcs", "rx_stbc", "tx_stbc", #endif /* CONFIG_HT_OVERRIDES */ #ifdef CONFIG_VHT_OVERRIDES "disable_vht", "vht_capa", "vht_capa_mask", "vht_rx_mcs_nss_1", diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index eed973590..3d292f9a1 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4468,6 +4468,55 @@ static int wpa_set_disable_ldpc(struct wpa_supplicant *wpa_s, return 0; } +static int wpa_set_tx_stbc(struct wpa_supplicant *wpa_s, + struct ieee80211_ht_capabilities *htcaps, + struct ieee80211_ht_capabilities *htcaps_mask, + int tx_stbc) +{ + le16 msk = host_to_le16(HT_CAP_INFO_TX_STBC); + + wpa_msg(wpa_s, MSG_DEBUG, "set_tx_stbc : %d", tx_stbc); + + if (tx_stbc == -1) + return 0; + + if (tx_stbc < 0 || tx_stbc > 1) { + wpa_msg(wpa_s, MSG_ERROR, "tx_stbc: %d out of range. " + "Must be 0-1 or -1", tx_stbc); + return -EINVAL; + } + + htcaps_mask->ht_capabilities_info |= msk; + htcaps->ht_capabilities_info &= ~msk; + htcaps->ht_capabilities_info |= (tx_stbc << 7) & msk; + + return 0; +} + +static int wpa_set_rx_stbc(struct wpa_supplicant *wpa_s, + struct ieee80211_ht_capabilities *htcaps, + struct ieee80211_ht_capabilities *htcaps_mask, + int rx_stbc) +{ + le16 msk = host_to_le16(HT_CAP_INFO_RX_STBC_MASK); + + wpa_msg(wpa_s, MSG_DEBUG, "set_rx_stbc : %d", rx_stbc); + + if (rx_stbc == -1) + return 0; + + if (rx_stbc < 0 || rx_stbc > 3) { + wpa_msg(wpa_s, MSG_ERROR, "rx_stbc: %d out of range. " + "Must be 0-3 or -1", rx_stbc); + return -EINVAL; + } + + htcaps_mask->ht_capabilities_info |= msk; + htcaps->ht_capabilities_info &= ~msk; + htcaps->ht_capabilities_info |= (rx_stbc << 8) & msk; + + return 0; +} void wpa_supplicant_apply_ht_overrides( struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, @@ -4493,6 +4542,8 @@ void wpa_supplicant_apply_ht_overrides( wpa_set_disable_ht40(wpa_s, htcaps, htcaps_mask, ssid->disable_ht40); wpa_set_disable_sgi(wpa_s, htcaps, htcaps_mask, ssid->disable_sgi); wpa_set_disable_ldpc(wpa_s, htcaps, htcaps_mask, ssid->disable_ldpc); + wpa_set_rx_stbc(wpa_s, htcaps, htcaps_mask, ssid->rx_stbc); + wpa_set_tx_stbc(wpa_s, htcaps, htcaps_mask, ssid->tx_stbc); if (ssid->ht40_intolerant) { le16 bit = host_to_le16(HT_CAP_INFO_40MHZ_INTOLERANT); diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 4f5916025..2f52a3e3f 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -1381,6 +1381,20 @@ fast_reauth=1 # Treated as hint by the kernel. # -1 = Do not make any changes. # 0-3 = Set AMPDU density (aka factor) to specified value. +# +# tx_stbc: Allow overriding STBC support for TX streams +# Value: 0-1, see 7.3.2.56.2 in IEEE Std 802.11n-2009. +# -1 = Do not make any changes. +# 0 = Set if not supported +# 1 = Set if supported +# +# rx_stbc: Allow overriding STBC support for RX streams +# Value: 0-3, see 7.3.2.56.2 in IEEE Std 802.11n-2009. +# -1 = Do not make any changes. +# 0 = Set if not supported +# 1 = Set for support of one spatial stream +# 2 = Set for support of one and two spatial streams +# 3 = Set for support of one, two and three spatial streams # disable_vht: Whether VHT should be disabled. # 0 = VHT enabled (if AP supports it)