From patchwork Tue Jun 30 09:03:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shay Bar X-Patchwork-Id: 1319634 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=celeno.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=1vOv6ACl; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=celeno.com header.i=@celeno.com header.a=rsa-sha256 header.s=selector2 header.b=CwSZIUDa; 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 49wz3j4FMyz9sR4 for ; Tue, 30 Jun 2020 19:05:53 +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: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=az6amERxoqxScBnvnrVHSOk1WZ4WLMCsHg3edQwiSxM=; b=1vOv6AClUf0i3hXOJWs5Zx0pr7 I45HWiyP+bBP48TdvEQRCF9tzfAm8wSrALBRNV4pO4QiphVdMUPl1jg56qscNyMeNo7KYI0t9/47y Y88fL2AnDJ7uv1/qKzMfQEg545VzOnMkJDlry2M4C5HxGAAOCKdzckZImKg9pf7UiDwPNvfjZnjoi JvEL3Ki4kIBLlVH1ULRKDMKdcIr7nxEqQxeKWzbsYrghv6Ao3Q+rB0+dfE+0xBZK5n7EHPvOGfyVb Jhn32HK7uuA98DrgKirCsLrn8RTvu2ryirozbwm8+0Cno2C23Bv8YPN64/LvI6jukrzUsJKLUjy8A qF/W2saw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqCBw-0002nv-Jh; Tue, 30 Jun 2020 09:04:36 +0000 Received: from mail-eopbgr50088.outbound.protection.outlook.com ([40.107.5.88] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqCBr-0002mc-Ly for hostap@lists.infradead.org; Tue, 30 Jun 2020 09:04:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVQXAF2eY9Lf6O9o+tWIssXKX6xUCcFsNDop/nJbRN0WyRSBrZMDgGLs5JiViStxC8YenmhAjjTsUpY9nObcycbiO0AMkYNNMSxAQoIZpL7eJC8ckuUWK+VnAd2lX3/65DQ6X0vOcKG6pHMj2rdOz7tZgnbsQQ+JiaEYkpEOQaEGSROrIG3R0uiG2aG74hL7rMp0coH81GU7jcwJejHPvPJzK1/jgLfPmxrW+0yqKcvgTdXOAj49ct2tZ9SJRDFBqR4PUegogqdmvwS9n+wL8EvvZSs0HqtWMarZTGDQs5Yz+aXr5zz3lmyXIfTbsugeHCXvQstUw3R2g/nOC7x7bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3lgQtRD8Nn7J8FC9yDkUJ1f6afjykGZJB6DGp0oZp2Y=; b=FTlTtKHHR5UErgXjvfpbO/Iue6nExG23sqjEAGDyhfBE+WbF5RymozGrM05ku2SXl3YZAKnu4SDzSRev+ldGHs/mfbRJnBwCf/cGQaSgOthfz8DxSNvEZNpwxVrJ94Zg7hD8cWXyDKvNiBYxF6NiXrJIo1FQAvN5RyePYs16kvTX9BP0mo4p8xH+vfjcAshfuilpPXIdCM0A0TR1kLAvUtm5nGO6w3f3XiayJselSoZZWUC/mQ5DQpqHhghN62SUAWsx8TLPxDgQRM3fZYqmFJ5Wmcxwaf4asCERSSllnDYz/kqXUION7qXECQW0EaVlbR5QZQebl7C9OmjXoQCp9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=celeno.com; dmarc=pass action=none header.from=celeno.com; dkim=pass header.d=celeno.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=celeno.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3lgQtRD8Nn7J8FC9yDkUJ1f6afjykGZJB6DGp0oZp2Y=; b=CwSZIUDaBLoHQI/fmLunstI/2N1a27cTaihcidQGQUqeiA597ow1gKZSBndnvN7AlfXmmQUFhSU4Asv34675v+leemxDUAmicB0cAzNkgdx91b/w0z2XxcOQffYKjfLYWcczvizoW0nGJ2vqYPdKlLW197BN7Hzc/1Hm9A0m6rU= Authentication-Results: w1.fi; dkim=none (message not signed) header.d=none;w1.fi; dmarc=none action=none header.from=celeno.com; Received: from AM0P192MB0468.EURP192.PROD.OUTLOOK.COM (2603:10a6:208:45::15) by AM0P192MB0516.EURP192.PROD.OUTLOOK.COM (2603:10a6:208:49::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Tue, 30 Jun 2020 09:04:27 +0000 Received: from AM0P192MB0468.EURP192.PROD.OUTLOOK.COM ([fe80::5cae:415:1979:1de1]) by AM0P192MB0468.EURP192.PROD.OUTLOOK.COM ([fe80::5cae:415:1979:1de1%5]) with mapi id 15.20.3131.028; Tue, 30 Jun 2020 09:04:27 +0000 From: Shay Bar To: Jouni Malinen Subject: [PATCH] hostapd: Disable HT MCS and set basic MCS per BSS Date: Tue, 30 Jun 2020 12:03:56 +0300 Message-Id: <20200630090356.3425-1-shay.bar@celeno.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: LNXP265CA0033.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::21) To AM0P192MB0468.EURP192.PROD.OUTLOOK.COM (2603:10a6:208:45::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (87.71.73.65) by LNXP265CA0033.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23 via Frontend Transport; Tue, 30 Jun 2020 09:04:26 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [87.71.73.65] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92790ce3-d5c0-4a9e-ac9d-08d81cd49784 X-MS-TrafficTypeDiagnostic: AM0P192MB0516: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0450A714CB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A1nPWxWnnFOpQsxvWkrSCXNWZCeazClcKwCM/tKDWuBK9HeN7yD5aI815DQliqF6otJbEtKSCX0PH9mbBL+U7j5U54+mbT8wBKl9QeJcCShQh85o+YFDrURnnkz4yLuJj7h2ZYV5b1cb7ZaQ21fH6j+2j2wmbTHi9bHXtJx4Pq4GEmU0zo/M+lTYBXyg+990boAlHcULCT3Yz+/V7R3JKmQqnX6oJWGT2mZbU68XiFK5t4712SW/Pke7MnSzcOGhiSKaaYocqm3dTsqX0/hlq+rK/uTFFboAMq/bWRF1Y63To2d3UgVq0XwF3NillL62SlCYTa7jJ3LRJTDxUeTjdOJQyM9OaPr4Z+tIHt1eIgiw0jD/DfHu6YRdIJ/nYo1mVIEeTkUIXqebS3rxKnd2eg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0P192MB0468.EURP192.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(39840400004)(346002)(396003)(136003)(376002)(366004)(52116002)(6916009)(6486002)(8936002)(66556008)(316002)(2906002)(6666004)(66476007)(8676002)(6512007)(66946007)(36756003)(478600001)(5660300002)(1076003)(107886003)(4326008)(956004)(86362001)(26005)(2616005)(83380400001)(44832011)(16526019)(186003)(69590400007)(6506007)(781001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: t5VOli97qvHRN76wV/a/Z34Y8JVhyTzBvdI/xatPLAETOTHjKqcRxJU8sNngcM1sHmkZOPRFOH6uPw2nJf6aw0kmPR2BNH0I6DNVDMxWsht0h80Y7fLMoN4XYAwadcf4F4WCGZ02XrJn7GEQxSJ0KrkDnEM/Jsji6QBUz8/B3hQCCBsgJBS2FYIY/Pei9z/+3oivENRfDoAMLmFSAzdNZgEE6vx9wzRY+izzbqrvNseJiRpEc+gHdyuPtqQg2GJs30Gl8KyLJ7s6a9a07l+Pv7S4kmmZobLNnzb/fXLkQeZgVpZ8/EQS2//+UhYQtttClX72N41FVThvKlRPKIKNQ9gOgUhjjT5twSk22Kj8JEVv2YskZ8CTe3X9ZqAMlsizZO6/pvn7r2g4DieEMglp+ZSmZ1BTVATOcDahyolHSdLZDYEzfsbad8nS5NhjRz/KOCoHilfp6I2ImrNi/3Prd/Pv/OmrwceeTxFmvDex1+M= X-OriginatorOrg: celeno.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92790ce3-d5c0-4a9e-ac9d-08d81cd49784 X-MS-Exchange-CrossTenant-AuthSource: AM0P192MB0468.EURP192.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2020 09:04:27.8711 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f313103b-4c9f-4fd3-b5cf-b97f91c4afa8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A/UAgqOJOCg9HVLBKcd0E2MG1VsSO+6fYM8gkMbBaMLy5xiDKTxsNWyT9mcEHPWV8bC/JIfdggFNDnOpXbjMgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0P192MB0516 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.5.88 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.5.88 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay 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: shay.bar@celeno.com, hostap@lists.infradead.org, eliav.farber@celeno.com Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add the ability to disable specific supported HT MCS's per BSS via the new (can be per bss) disabled_ht_mcs config. This will overwrite the configured HT capab supported_mcs_set. Add the ability to set specific basic MCS's (can be per BSS) If absent (default) - no basic MCS's are set. Signed-off-by: Shay Bar --- hostapd/config_file.c | 12 ++++++++++++ hostapd/hostapd.conf | 10 ++++++++++ src/ap/ap_config.h | 3 +++ src/ap/ieee802_11_ht.c | 21 +++++++++++++++++++++ 4 files changed, 46 insertions(+) -- 2.17.1 diff --git a/hostapd/config_file.c b/hostapd/config_file.c index e7a47d71d..9b78594ac 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3234,6 +3234,18 @@ static int hostapd_config_fill(struct hostapd_config *conf, line); return 1; } + } else if (os_strcmp(buf, "disabled_ht_mcs") == 0) { + if (hostapd_parse_intlist(&bss->disabled_ht_mcs, pos)) { + wpa_printf(MSG_ERROR, "Line %d: invalid disabled mcs", + line); + return 1; + } + } else if (os_strcmp(buf, "basic_ht_mcs") == 0) { + if (hostapd_parse_intlist(&bss->basic_ht_mcs, pos)) { + wpa_printf(MSG_ERROR, "Line %d: invalid basic ht mcs", + line); + return 1; + } } else if (os_strcmp(buf, "beacon_rate") == 0) { int val; diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 91ac96785..367077370 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -270,6 +270,16 @@ fragm_threshold=-1 #basic_rates=10 20 55 110 #basic_rates=60 120 240 +# Disable supported HT MCS's per BSS +# List of MCS's to disable +# If absent (default) MCS's are as configured in the HT capab supported_mcs_set +#disabled_ht_mcs=0 1 + +# Set basic HT MCS's per BSS +# List of MCS's +# If absent (default) - no basic MCS's set +#basic_ht_mcs=7 + # Beacon frame TX rate configuration # This sets the TX rate that is used to transmit Beacon frames. If this item is # not included, the driver default rate (likely lowest rate) is used. diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index b705c378f..3859ccbe0 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -314,6 +314,9 @@ struct hostapd_bss_config { struct hostapd_ssid ssid; + int *disabled_ht_mcs; + int *basic_ht_mcs; + char *eap_req_id_text; /* optional displayable message sent with * EAP Request-Identity */ size_t eap_req_id_text_len; diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c index 59ecbdce7..d0e87aa31 100644 --- a/src/ap/ieee802_11_ht.c +++ b/src/ap/ieee802_11_ht.c @@ -25,6 +25,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_ht_capabilities *cap; u8 *pos = eid; + int *disabled_ht_mcs = hapd->conf->disabled_ht_mcs; if (!hapd->iconf->ieee80211n || !hapd->iface->current_mode || hapd->conf->disable_11n || is_6ghz_op_class(hapd->iconf->op_class)) @@ -40,6 +41,18 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set, 16); + if (disabled_ht_mcs) { + int i = 0; + + while (disabled_ht_mcs[i] != -1) { + u8 *supp_mcs_set = cap->supported_mcs_set; + + while (*supp_mcs_set) + *supp_mcs_set++ &= ~(1 << disabled_ht_mcs[i]); + i++; + } + } + /* TODO: ht_extended_capabilities (now fully disabled) */ /* TODO: tx_bf_capability_info (now fully disabled) */ /* TODO: asel_capabilities (now fully disabled) */ @@ -83,6 +96,7 @@ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_ht_operation *oper; u8 *pos = eid; + int *basic = hapd->conf->basic_ht_mcs; if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n || is_6ghz_op_class(hapd->iconf->op_class)) @@ -103,6 +117,13 @@ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid) oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW | HT_INFO_HT_PARAM_STA_CHNL_WIDTH; + if (basic) { + while (*basic != -1) { + oper->basic_mcs_set[*basic / 8] |= (1 << (*basic % 8)); + basic++; + } + } + pos += sizeof(*oper); return pos;