Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp769594pxa; Thu, 27 Aug 2020 15:34:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTC/2Sc8MF9JYJvRUwNal2BBWBGd9WzCX7/h5ExQ2jjnb8S6bmt/zVTzqlDfIwfhWB05YV X-Received: by 2002:a17:906:386:: with SMTP id b6mr22569434eja.538.1598567651147; Thu, 27 Aug 2020 15:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598567651; cv=none; d=google.com; s=arc-20160816; b=TsjajULoOO4X0eoEmdGk/LkQgHpJC+r/zNeoYfe1W0PoPN99R8QIPeN8dzIsgu8s9h q0qoPk/CzsKnLe7OcyJdFIu4nvWsAWsvGRxBNVC9GiUilX+7YR17ze1nmviaTusCLEjH PXQZmLqWbrT/ngiv7u/3RBUeelDh12HwQdv+JhQD4Mp00HeQOwEcaj3BhEbJSHXrAfIG eC5BUxuwcKRToub4upwlBzDDHZDjBwKxjn7TjXr2QJi1qXqFLZMbzqffbu6Ey8BojV5e C9zqr4EWs4tSNdPsfK7wvXhOLq5fF6zZAUHv2ebVRnY6u4cGgk7u18BcWBiQlRgdPMb1 MySA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pXl+wSKMyOT5A4OkTMquWdsFfaIPZNmIMP1pYXxPik4=; b=xkyJpQWTBLQ85FmUOIEbVTDd5fCuVkNNmuDmsrgm7skW54Wa9IqDv0bczsUOKykdnx pk/Ex+mbGMyfRiXQsqm6NF1jDljotJmsPQm/zNtaJi+I20b+1PqbrzecNDI6YCrreFqV bywSP/z68ivy32CO1vKzpcF5rRat7a0cL8GpErwtW111tSMHi4G2HXK2s5khJRN+W0L6 iEgBOqiLjmhuQ4TQRLZaoLHorpSOUZmEyAksvlvJlb4SWuy51NGNe3ztsBCeljjRX3Dv DhxmBLv03uS87kui4AD/phNKwGrsaAhONeX1IIR7q6F8NH9lhfo+N3C9APkoTi87eYjU X3eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si2438500edq.576.2020.08.27.15.33.47; Thu, 27 Aug 2020 15:34:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbgH0Wd2 (ORCPT + 99 others); Thu, 27 Aug 2020 18:33:28 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:50416 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727993AbgH0WdV (ORCPT ); Thu, 27 Aug 2020 18:33:21 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 662034F8182; Thu, 27 Aug 2020 22:33:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id l8JPIWdGLHJn; Thu, 27 Aug 2020 22:33:17 +0000 (UTC) Received: from atlas.campbell.adapt-ip.com (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 1C6A84F81A5; Thu, 27 Aug 2020 22:33:09 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH 07/22] mac80211: s1g: choose scanning width based on frequency Date: Thu, 27 Aug 2020 15:32:49 -0700 Message-Id: <20200827223304.16155-8-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200827223304.16155-1-thomas@adapt-ip.com> References: <20200827223304.16155-1-thomas@adapt-ip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org An S1G BSS can beacon at either 1 or 2 MHz and the channel width is unique to a given frequency. Ignore scan channel width for now and use the allowed channel width. Signed-off-by: Thomas Pedersen --- net/mac80211/scan.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 5ac2785cdc7b..5002791fe165 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -905,6 +905,17 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, local->scan_chandef.center_freq1 = chan->center_freq; local->scan_chandef.freq1_offset = chan->freq_offset; local->scan_chandef.center_freq2 = 0; + + /* For scanning on the S1G band, ignore scan_width (which is constant + * across all channels) for now since channel width is specific to each + * channel. Detect the required channel width here and likely revisit + * later. Maybe scan_width could be used to build the channel scan list? + */ + if (chan->band == NL80211_BAND_S1GHZ) { + local->scan_chandef.width = ieee80211_s1g_channel_width(chan); + goto set_channel; + } + switch (scan_req->scan_width) { case NL80211_BSS_CHAN_WIDTH_5: local->scan_chandef.width = NL80211_CHAN_WIDTH_5; @@ -925,8 +936,14 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, else local->scan_chandef.width = NL80211_CHAN_WIDTH_20_NOHT; break; + case NL80211_BSS_CHAN_WIDTH_1: + case NL80211_BSS_CHAN_WIDTH_2: + /* shouldn't get here, S1G handled above */ + WARN_ON(1); + break; } +set_channel: if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) skip = 1; -- 2.20.1