Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3351154rdh; Thu, 28 Sep 2023 09:08:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeSTKMF7oFzh1HuNTFgc6ETv1HIUuLleiX/nEx18C/6UoQqjfGGBTMLq0rqqjB9rlm/Ps+ X-Received: by 2002:a05:6a20:2446:b0:15a:290:d83d with SMTP id t6-20020a056a20244600b0015a0290d83dmr1878694pzc.41.1695917323241; Thu, 28 Sep 2023 09:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695917323; cv=none; d=google.com; s=arc-20160816; b=h+5XgSBgOAZgwY4fv3LskyEfxrV//yjr5JMHLN3fHpFYZNfUegGG7Xl1hgBi53oUpO J7cdY/nQiD1/0HKkf7gmi/B8snwvOSFLYdAn+Z7qVzqemS+K1YTVOch0AiD6jOIVJ7/x WZuZRMTahr6C1RYbNpFJVfawI7lTEO3fEJ0MNOAU0tSvgYefiARjtthatePSXiC6M1WB d/NGBP55EOZlguzDZZBKyOWyscEtmkfna5CUEJPM/9yinZWjmknoeA9BwOHcQRaBbZFr nCcpmoNwhUHFoYlu0MZPZ5eGL/37nzKizN3EX+H1IluR/iWDjg5w+dsXioLtezDjIbBf oCRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qwj8N2rRMxFqFtXnqwzIVSrXFU8QN/VCgX2ctb1LeiU=; fh=/GEb7gVUqTR6q5QKTfw0XUP5VVlqVBkkw8R/kfrGqdo=; b=nDwM8Zf/eAJ7CQgTxIPXLZJTOO6tdgm/yxhpW1JTE8jIHHGFu+F7LMB6QKh+K7xVWJ uOBJLXuciPtTVOwPQbgZHebNniWw5jlhZHMKOjbXZrIja+YOn/hUwR+ELT8vE3EcznZs e1t2aPuLd78d/EfEwEk27oQ6vy60SjwgsublUOkwvzd4Dh0gLDOnIInVO6GGtXoUYloJ 23vqRcyLdqPWn4oF7bT0BamG1q0V6qdQNlAibIVWQBLDewu+SuIlfSgTUkSjEIhtigR6 mRr/nHIFm0KyWHsC2NJGI6UHLQEmP9l+ZTFsOJUmk28ZxZeNnOTxoYnXXgXDuUHjo/vt WKvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="J/Ea0F61"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u9-20020a056a00158900b00690bdd81cadsi20554427pfk.155.2023.09.28.09.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="J/Ea0F61"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D366F81CDB8D; Thu, 28 Sep 2023 07:36:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjI1OgR (ORCPT + 55 others); Thu, 28 Sep 2023 10:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbjI1OgQ (ORCPT ); Thu, 28 Sep 2023 10:36:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E41AF9 for ; Thu, 28 Sep 2023 07:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695911773; x=1727447773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=K1aq3gH29PspHwmdscOXP+sXEouKzig2qkRbVoJKo9o=; b=J/Ea0F61D9sysZwpC3IqUl36Lcj6Kd85VAJDf+xYseqsyBRmz07H2XcT 8cL25ZrtnX9ihnHIil1Tog/LIoYmUQa1OEQnQ76hclVvoxY04meBtzg4X jcSwWvcolZwFWSiZZdNVqtdht2qjlxY20Y1oIhExqt+3laasxtTg49rK1 Z9J738SuCeDhICwtbzFhp84UF2AZ3GrSGS0gqRRduRfQYXvSMgQFA6gNJ VFcXEp1DF6ZHAP4o2lUgDDg87LxRN4fqJl1TJhi59v5BbIpJDlEXJu2sf Xxjpcs5Hs1Davu8ZZY8nH9KizklDgqxO3Bs/mEsGi2PG3+G30KfVjUp6I g==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="688450" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="688450" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 07:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="996590443" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="996590443" Received: from smoriles-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.92.89]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 07:36:11 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer , Gregory Greenman Subject: [PATCH 09/18] wifi: cfg80211: Handle specific BSSID in 6GHz scanning Date: Thu, 28 Sep 2023 17:35:30 +0300 Message-Id: <20230928172905.54b954bc02ad.I1c072793d3d77a4c8fbbc64b4db5cce1bbb00382@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230928143539.1037500-1-gregory.greenman@intel.com> References: <20230928143539.1037500-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 07:36:27 -0700 (PDT) From: Ilan Peer When the scan parameters for a 6GHz scan specify a unicast BSSID address, and the corresponding AP is found in the scan list, add a corresponding entry in the collocated AP list, so this AP would be directly probed even if it was not advertised as a collocated AP. This is needed for handling a scan request that is intended for a ML probe flow, where user space can requests a scan to retrieve information for other links in the AP MLD. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman --- net/wireless/scan.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 8d114faf4842..6c2acd3fa36a 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -830,10 +830,47 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev) list_for_each_entry(intbss, &rdev->bss_list, list) { struct cfg80211_bss *res = &intbss->pub; const struct cfg80211_bss_ies *ies; + const struct element *ssid_elem; + struct cfg80211_colocated_ap *entry; + u32 s_ssid_tmp; + int ret; ies = rcu_access_pointer(res->ies); count += cfg80211_parse_colocated_ap(ies, &coloc_ap_list); + + /* In case the scan request specified a specific BSSID + * and the BSS is found and operating on 6GHz band then + * add this AP to the collocated APs list. + * This is relevant for ML probe requests when the lower + * band APs have not been discovered. + */ + if (is_broadcast_ether_addr(rdev_req->bssid) || + !ether_addr_equal(rdev_req->bssid, res->bssid) || + res->channel->band != NL80211_BAND_6GHZ) + continue; + + ret = cfg80211_calc_short_ssid(ies, &ssid_elem, + &s_ssid_tmp); + if (ret) + continue; + + entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN, + GFP_ATOMIC); + + if (!entry) + continue; + + memcpy(entry->bssid, res->bssid, ETH_ALEN); + entry->short_ssid = s_ssid_tmp; + memcpy(entry->ssid, ssid_elem->data, + ssid_elem->datalen); + entry->ssid_len = ssid_elem->datalen; + entry->short_ssid_valid = true; + entry->center_freq = res->channel->center_freq; + + list_add_tail(&entry->list, &coloc_ap_list); + count++; } spin_unlock_bh(&rdev->bss_lock); } -- 2.38.1