From patchwork Fri Dec 27 12:22:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 1215688 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UQYPg401"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bX1bwfqh"; 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 47kmDZ2sFwz9sR0 for ; Fri, 27 Dec 2019 23:22:38 +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=uFYp9LG7//ZIMyfztlUcBOR+orM2CyxnwjmFx298PL4=; b=UQY Pg401Yykcg6YffXogU4hBf3Feh5GNFIyyWbsV0X/m0az1WHIKVod5O7Xkt8RbrvHpWmHZvSWwxx/b 6Vzx1EfXGgB+V+T0OPdFvLQYgAcMkqmlknwZPzDKzMleUxRbFtZ7VyPdwb16Tv8vLjLWYzrUs8gBg /W4mbWAAlD9gwDs6MVrvuYP6a519bWQzdKeJ3M7cdG0RE8n8WHOBccMP0WQ1CFRgLSWcMkxEi/Lxq rzdk6GFrTCGYFon1cPECAgu+xbvj/DgCIvI9Owm1Pg7nWKnEsgVSv+9WRt0qh4KpYqBkg3H2WLebD 29V5/rYSHR02fTVCNUbyl0cilfJT9Hg==; 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 1ikodT-0003wI-QY; Fri, 27 Dec 2019 12:22:31 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ikodQ-0003u8-S2 for hostap@lists.infradead.org; Fri, 27 Dec 2019 12:22:30 +0000 Received: by mail-lf1-x136.google.com with SMTP id r14so20556490lfm.5 for ; Fri, 27 Dec 2019 04:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BTgVGX17NcK1kVje1CQu4tR0N9v3PrlP0LgfhxtkXG0=; b=bX1bwfqhWbKQZr/My4PbTtrEi37y0nA826jFa1ABNIQNxux2Q0UyduoGzx20SZzYdn ZmHBCuq6Z1l83wxSVezdHVyG4HCMWA6Ris1mZ5vtvdS5iM1fjL8DxIKbwKp3pWmSd9Km IwylAXxUxya57km5VQN1+UgINYfIjOet4WVNRFYfUvjxU4JmuA1PpA/WFF//B+snDtYR DpebVbksyXrt1jg5f4W7w49bzFFZhTw3MiXyWVoEWiQVy9Rw6nmEh/kNXCADpUuastj7 USW4daC9ODv+r6H2cpBYPaQob584nJiDEFOHLsRbLXitbNjtSLqCjklmNEsYX5I3O5u9 0F3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BTgVGX17NcK1kVje1CQu4tR0N9v3PrlP0LgfhxtkXG0=; b=U/81DYLHIeXqn4Zp6YrBY8PnNFsnu+NmIq84oQbpw8ZkaNJNU6sb7P9e/hoz0nSf57 mAYsHUycETaJriDvtloO8psm98V/6k45IHnbSzkEarLc44Dvncvh2ReeYFeTEc+RZZbI xvnM+WmVq4gsUqNnb3rP1lvqGKyMepwtM6Xqfs7KzIEVAUcmWLBwEvMphp2921Zv+8EG KjaRTZpUlT2p3PQuCXb7KT5RpVLNg67QPikmN/raxudBM401cThfApm2VTLYYfzom3sF DyHl0Ja6UEQDvccSrxcy0+q+0Fn2JNu5M+k2+FlTlKcYj05uN22TPEDZSGBhQ74e6EWI c7UQ== X-Gm-Message-State: APjAAAXZdlzNTekhsk+q+5SSX8Xs9dUSfy2CR3Rpu3Xv0xPTabHwVIYj 7NXExPhYisUqAbqrGAY5QNZ2odH9R+Y= X-Google-Smtp-Source: APXvYqxvyhF7gMba7WVyG4Ur/ZDKOp//pybES910cpmOo0zMFNaNSxJW5Xlfwls+wM6wEgqtXatDHg== X-Received: by 2002:a19:f10e:: with SMTP id p14mr28821502lfh.3.1577449346365; Fri, 27 Dec 2019 04:22:26 -0800 (PST) Received: from bars.quantenna.com (ip-195-182-157-78.clients.cmk.ru. [195.182.157.78]) by smtp.gmail.com with ESMTPSA id m24sm16436444ljb.81.2019.12.27.04.22.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Dec 2019 04:22:25 -0800 (PST) From: Sergey Matyukevich X-Google-Original-From: Sergey Matyukevich To: hostap@lists.infradead.org Subject: [PATCH] STA OBSS: update secondary channel info after CSA Date: Fri, 27 Dec 2019 15:22:24 +0300 Message-Id: <20191227122224.2766-1-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191227_042228_930948_34D3FC3D X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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 [2a00:1450:4864:20:0:0:0:136 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (geomatsi[at]gmail.com) -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.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: Sergey Matyukevich MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Field wpa_s->sme.ht_sec_chan keeps secondary channel for 40MHz band. This field is used to prepare list of channels for STA OBSS scan. Initially secondary channel is set to HT_SEC_CHAN_UNKNOWN. Later on, in function wpa_obss_scan_freq_list it is obtained from current BSS HT operation IE. However secondary channel information is not updated after channel switch, which may lead to incorrect list of channels prepared for STA OBSS scan. This patch updates ht_sec_chan according to channel switch event data. Signed-off-by: Sergey Matyukevich --- wpa_supplicant/events.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f034e5040..61c05fc57 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -4564,6 +4564,18 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, wpa_s->assoc_freq = data->ch_switch.freq; wpa_s->current_ssid->frequency = data->ch_switch.freq; + switch (data->ch_switch.ch_offset) { + case 1: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_ABOVE; + break; + case -1: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_BELOW; + break; + default: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_UNKNOWN; + break; + } + #ifdef CONFIG_AP if (wpa_s->current_ssid->mode == WPAS_MODE_AP || wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||