Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1722521ioo; Mon, 23 May 2022 01:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwySKNA34VwU+H1D26Do2WzNYu7aEONTKqL2d1rkrRnlFp37PtFu5APIzUmKwphym7cfcwH X-Received: by 2002:a17:90a:1b6c:b0:1df:6940:e856 with SMTP id q99-20020a17090a1b6c00b001df6940e856mr25426624pjq.240.1653294696732; Mon, 23 May 2022 01:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653294696; cv=none; d=google.com; s=arc-20160816; b=nKT1DDbEEKDil1ODGomraI+JLQDK87AQ32ySDclMQxZEPLVBY6YL3NEYhOoCaehINe 2TFX6S3TsewGdGwNEeSmYruSECscMdbXW7EL2hBLgeJh7efFPEeo4ItTbMjmE7RjlZRL 5PREcHok76bi+3eDVKsilIBw5ucUXgPBokVcwbsLoeP21NeMbfdNXCvkzBjyZZFEs4fZ oaCO5FOlfD1l87WIAaGYCtv8lC2TZnYlsw5jdelAWCVtKrSjJbWBXwDRROHnElftHstE 36fgwtG8wZZXH/1DgGRbBkLtvIkd2kofP4gVG1yxnM/eDi3JPzfiDI01nrbr56DdBCjk 89iA== 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=gODjbkNAiqr7YYTSKhZn/JtSF6AkaSsDoz79JBEI2VU=; b=CQ/KaOBVGgUO2n+17e9c+cWxSkQeciO1ajrjdESMeq5PQoXF59OOFtpBZj0EB7NzJp If3VAZJW+jNwr5M57J4nkjiBV8EkpTo50nCJChPpKRNPC/HatZ4E+vfLeaye43Sfjah4 pIsvYgBvTAvaicq36TyAuTNN990PpfznwXVLIYPdRpXDlrPnXUzMLzMsG4dcsY3NkPDE FiwN+CSZu/0/yW4BaokEIZKYUJMev0qhnnRLs8Qbzqj5itkCsL7NzlOktZt26mHHcVAP HJKbg5sre6/uvZ+q4lgj3mabqPE6DzQUuiHdwewpUaWifSmypR3ErihpSaFPhUOuAmKX LMKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=hutN0nWr; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ja9-20020a170902efc900b001581aed9a23si9218689plb.194.2022.05.23.01.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:31:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=hutN0nWr; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 732821D0E0; Mon, 23 May 2022 00:46:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbiEWHqn (ORCPT + 68 others); Mon, 23 May 2022 03:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbiEWHqg (ORCPT ); Mon, 23 May 2022 03:46:36 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 161B5319 for ; Mon, 23 May 2022 00:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653291995; x=1684827995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gODjbkNAiqr7YYTSKhZn/JtSF6AkaSsDoz79JBEI2VU=; b=hutN0nWrokIaptYRmbyhJKEgySOv37CiOCy3Oo+swgtv6Pfqd8pp7TaM d+KVBlENoQjx/9ZNmxxu7cUGgB/DQk3qlG9CU3U3JNOD3ErqkeH02Pf9b rOvSXL5Wh2bAk20+0s3YOT5K2j0phD91oiapzU8X2yrb5prxzGc26SKHF g=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 22 May 2022 23:01:29 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 23:01:29 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 22 May 2022 23:01:29 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 22 May 2022 23:01:28 -0700 From: Aloka Dixit To: , , CC: Aloka Dixit Subject: [PATCH 9/9] ath11k: configure WPA and RSN parameters for nontransmitting interface Date: Sun, 22 May 2022 23:01:08 -0700 Message-ID: <20220523060108.23982-10-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220523060108.23982-1-quic_alokad@quicinc.com> References: <20220523060108.23982-1-quic_alokad@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Set rsnie_present and wpaie_present fields for the non-transmitting interfaces when MBSSID is enabled. Signed-off-by: Aloka Dixit --- drivers/net/wireless/ath/ath11k/mac.c | 99 ++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 4ead94554724..cee505a1bada 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1373,6 +1373,89 @@ static void ath11k_mac_setup_bcn_tmpl_vif_params(struct ath11k_vif *arvif, arvif->wpaie_present = false; } +static void ath11k_mac_setup_bcn_tmpl_nontx_vif_rsnie(struct ath11k_vif *arvif, + bool tx_arvif_rsnie_present, + const u8 *profile, + u8 profile_len) +{ + if (cfg80211_find_ie(WLAN_EID_RSN, profile, profile_len)) { + arvif->rsnie_present = true; + } else if (tx_arvif_rsnie_present) { + int i; + u8 nie_len; + const u8 *nie = cfg80211_find_ext_ie(WLAN_EID_EXT_NON_INHERITANCE, + profile, profile_len); + if (!nie) + return; + + nie_len = nie[1]; + nie += 2; + for (i = 0; i < nie_len; i++) { + if (nie[i] == WLAN_EID_RSN) { + arvif->rsnie_present = false; + break; + } + } + } +} + +static bool ath11k_mac_setup_bcn_tmpl_nontx_vif_params(struct ath11k_vif *tx_arvif, + struct ath11k_vif *arvif, + struct sk_buff *bcn) +{ + struct ieee80211_mgmt *mgmt; + const u8 *ies, *profile, *next_profile; + int ies_len; + + if (arvif == tx_arvif) + return true; + + arvif->rsnie_present = tx_arvif->rsnie_present; + + ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn); + mgmt = (struct ieee80211_mgmt *)bcn->data; + ies += sizeof(mgmt->u.beacon); + ies_len = skb_tail_pointer(bcn) - ies; + + ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ies, ies_len); + + while (ies) { + u8 mbssid_len; + + ies_len -= (2 + ies[1]); + mbssid_len = ies[1] - 1; + profile = &ies[3]; + + while (mbssid_len) { + u8 profile_len; + + profile_len = profile[1]; + next_profile = profile + (2 + profile_len); + mbssid_len -= (2 + profile_len); + + profile += 2; + profile_len -= (2 + profile[1]); + profile += (2 + profile[1]); /* nontx capabilities */ + profile_len -= (2 + profile[1]); + profile += (2 + profile[1]); /* SSID */ + if (profile[2] == arvif->vif->bss_conf.bssid_index) { + profile_len -= 5; + profile = profile + 5; + ath11k_mac_setup_bcn_tmpl_nontx_vif_rsnie(arvif, + tx_arvif->rsnie_present, + profile, + profile_len); + return true; + } + profile = next_profile; + } + ies = cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, profile, + ies_len); + } + + return false; +} + static int __ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif, struct sk_buff *bcn, struct ieee80211_mutable_offsets offs, @@ -1399,6 +1482,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif) struct ieee80211_ema_beacons *beacons; u8 i = 0; int ret = 0; + bool found_vdev = false; if (!arvif->vif->mbssid_tx_vif) return -1; @@ -1412,11 +1496,21 @@ static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif) return -EPERM; } - if (tx_arvif == arvif) + if (tx_arvif == arvif) { ath11k_mac_setup_bcn_tmpl_vif_params(tx_arvif, beacons->bcn[0].skb); + found_vdev = true; + } else { + arvif->wpaie_present = tx_arvif->wpaie_present; + } for (i = 0; i < beacons->cnt; i++) { + if (!found_vdev) + found_vdev = + ath11k_mac_setup_bcn_tmpl_nontx_vif_params(tx_arvif, + arvif, + beacons->bcn[i].skb); + ret = __ath11k_mac_setup_bcn_tmpl(tx_arvif, beacons->bcn[i].skb, beacons->bcn[i].offs, i, beacons->cnt); @@ -1452,6 +1546,9 @@ static int ath11k_mac_setup_bcn_tmpl_non_ema(struct ath11k_vif *arvif) if (tx_arvif == arvif) ath11k_mac_setup_bcn_tmpl_vif_params(tx_arvif, bcn); + else + (void)ath11k_mac_setup_bcn_tmpl_nontx_vif_params(tx_arvif, + arvif, bcn); ret = __ath11k_mac_setup_bcn_tmpl(tx_arvif, bcn, offs, 0, 0); if (ret) -- 2.31.1