From patchwork Tue May 26 00:21:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1297622 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=iUYXolVW; 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=E6PbMpPe; 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 49WF5Z6n2jz9sPK for ; Tue, 26 May 2020 10:22:10 +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=/pLvvIfwj7owxCxp6YdFAhjCvyBRY77c2Y5gu/lXTWw=; b=iUYXolVWZmrzFU +yoBmBaoUVOi5kBiDh6+nO5erzpCzfPKDhfW7soUG3Gzd3GWIrhbn1Yvgc6Veu4ZEvcQfnoINcY3R tLW+tpiiVImgXtG1lqlV61n8ALn5pICJthelcWpNC0lLs3AFYyk1by13+U8svFFMEu27qZQ6YSkb1 Ey+bIfgqFLlwvIOuWjHvvOoByTyiKhnRcqF2B0KWmWIp3cPupbW8EbCVWD/CJKrVXFztUkckPdE6A Xh29b7oLVEtxq7TgdiV+vfKVOzicx35nsei1I59heYT6DB/qMyHPuvWSpYF+848pPCdZZUh3jjnZP frV1xGPK6HwgTTT+dg0g==; 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 1jdNLv-0001MP-Kv; Tue, 26 May 2020 00:21:55 +0000 Received: from mail27.static.mailgun.info ([104.130.122.27]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdNLq-0001Lt-VA for hostap@lists.infradead.org; Tue, 26 May 2020 00:21:52 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1590452510; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=qZpC4lFjV0EO0F2HA8QD27EpyX2akjxkSrfDIcmXdTc=; b=E6PbMpPejXNN0/qI52t82zTPACznzozWuruw9oxzzD0MP468L51RQ/oXDak4+cx7hUheBjMR 89zgnkU/t0shWLGqtv/mmEXajldEkxJFcoV1CSNBkm0AriDhsvzw/TF5GjbYv7CzRgcqug4U VOC+SYuGgHNwOmIhqLUq/VW9xB8= X-Mailgun-Sending-Ip: 104.130.122.27 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 5ecc611b37a454afcbabf0f9 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 26 May 2020 00:21:47 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DAEDDC433CA; Tue, 26 May 2020 00:21:46 +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, URIBL_BLOCKED autolearn=ham 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 52D3CC433C9; Tue, 26 May 2020 00:21:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 52D3CC433C9 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 v3] AP: Allow downgrading to 20MHz based on OBSS results Date: Mon, 25 May 2020 17:21:41 -0700 Message-Id: <20200526002141.8535-1-alokad@codeaurora.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200525_172151_066854_7C203343 X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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.27 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.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [104.130.122.27 listed in wl.mailspike.net] 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 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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, Aloka Dixit Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When auto channel selection (ACS) is used for HE 40MHz in 2.4GHz band, AP sets center frequency after finding a 40MHz channel and then runs a scan for overlapping BSSes in neighboring channels. Upon OBSS detection, AP should downgrade to 20MHz bandwidth. Currently this is broken because allowed_ht40_channel_pair() returns true in this case and the steps to reset center frequency are not executed causing failure to bring interface up. Fix the condition to allow rollback to 20MHz. Signed-off-by: Aloka Dixit --- v3: Rebased to latest. Modified commit description. src/ap/hw_features.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) base-commit: 88436baaac4172fda2abbe41449ff0bf8994ee9d diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index f6e69030d767..1563a9ee34a4 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -313,7 +313,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface) { struct wpa_scan_results *scan_res; int oper40; - int res; + int res = 0; /* Check list of neighboring BSSes (from scan) to see whether 40 MHz is * allowed per IEEE Std 802.11-2012, 10.15.3.2 */ @@ -349,7 +349,8 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface) } } - res = ieee80211n_allowed_ht40_channel_pair(iface); + if (iface->conf->secondary_channel) + res = ieee80211n_allowed_ht40_channel_pair(iface); if (!res) { iface->conf->secondary_channel = 0; hostapd_set_oper_centr_freq_seg0_idx(iface->conf, 0);