From patchwork Thu Jan 9 00:53:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1220262 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=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=codeaurora.org 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=bombadil.20170209 header.b=S32JOl13; 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=iQRuEJTo; 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 47thCj20Vnz9sNx for ; Thu, 9 Jan 2020 20:49:21 +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: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=AYROIvU8kQIDShTrzhAF4qpmA+QlouFU956Xv85FMwU=; b=S32 JOl13KBNJjMiEAJgEdTd/m4+kAawIZOBJbd+xA+DOy8ZaeZlKAp3nWE958Ce8hsWEH+ouk1b4kgO2 Sk9/KOXd/2UZvoMSDOrnE1juVHiNeeO5vx293e+P+C2uJ3V955wlLF/NxhjZy5MvlyyVKOSzhmrB+ 3TB81+5kuVqEM1PLbauDOOp4/Okudg0dFGH5V5vIMPjV35QoiJZbXvaQS6Xgl9xz38FJOHUVh7eCZ kueiLVqt3RfiWkMi1SlWtONgDddRkTwSNakmvmHEgoNOQBjpQBH5SEAImGBOp74nJ1dJhVKLnh5du SogE7cnXyBojTTADosoa+UizvrF43xA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipURG-0002MP-6R; Thu, 09 Jan 2020 09:49:14 +0000 Received: from mail26.static.mailgun.info ([104.130.122.26]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipM57-0007Gq-0P for hostap@lists.infradead.org; Thu, 09 Jan 2020 00:53:52 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578531226; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=hzzDtGHICDYjfqZ7I0mnoE7ECuVlB1/6/E9ZOvms/bY=; b=iQRuEJToAfgfHswUpc1nM7KjjIDgbiKYUlemy6Msy2BWRgfoFWHgQNKKDHz8UUIroMRPugTZ omg3HSEUSaLVf0yCjLrplMfV0mXx9LMpoogbXQPV66NLMVmdFf7jG+HuI94SNRlAoOugPktJ LIdYVvUAD2+45Ukkt8MKfQOb8/A= X-Mailgun-Sending-Ip: 104.130.122.26 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 mxa.mailgun.org with ESMTP id 5e167995.7fc3d7b6c3b0-smtp-out-n03; Thu, 09 Jan 2020 00:53:41 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 37ACBC433A2; Thu, 9 Jan 2020 00:53:41 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from alokad-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: alokad) by smtp.codeaurora.org (Postfix) with ESMTPSA id 03F91C433CB; Thu, 9 Jan 2020 00:53:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 03F91C433CB 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=none smtp.mailfrom=alokad@codeaurora.org From: Aloka Dixit To: j@w1.fi Subject: [PATCH] AP: Allow downgrading to 20MHz based on OBSS results Date: Wed, 8 Jan 2020 16:53:34 -0800 Message-Id: <1578531214-12314-1-git-send-email-alokad@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-20200108_165349_111968_52D5E8A9 X-CRM114-Status: GOOD ( 10.24 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [104.130.122.26 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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-Mailman-Approved-At: Thu, 09 Jan 2020 01:49:10 -0800 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: Aloka Dixit , hostap@lists.infradead.org, jouni@codeaurora.org MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Before operating on 40MHz in 2.4GHz, AP looks for overlapping BSS in neighboring channels. Upon OBSS detection, AP should downgrade to 20MHz bandwidth. This decistion is broken now for HE40. As of now ieee80211n_check_scan skips the rollback step for 20MHz as allowed_ht40_channel_pair returns true when primary and secondary channels are same. Fix that. Signed-off-by: Aloka Dixit --- src/common/hw_features_common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index 19593a521f9e..d691cc939b2b 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -111,7 +111,12 @@ int allowed_ht40_channel_pair(enum hostapd_hw_mode mode, ht40_plus = pri_chan < sec_chan; - if (pri_chan == sec_chan || !sec_chan) { + /* If primary and secondary channels are set to same value, + * operating width should be changed to 20MHz. */ + if (pri_chan == sec_chan) + return 0; + + if(!sec_chan) { if (chan_pri_allowed(p_chan)) return 1; /* HT40 not used */