Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp707804rdb; Tue, 5 Dec 2023 18:49:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgRGzK/aV3dmketgcOqsNvaEZNvP4iBNf+cZfXUFe+iSEW+SfZtG4MshvgAvG12FIYUAqJ X-Received: by 2002:a05:6e02:b2d:b0:35d:59a2:2b8 with SMTP id e13-20020a056e020b2d00b0035d59a202b8mr494468ilu.88.1701830996456; Tue, 05 Dec 2023 18:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701830996; cv=none; d=google.com; s=arc-20160816; b=TK4Y5IiHoWlKmMQb0RX0rNhN0HEKh6Yn6P2cE5k8VkZcYxK3TXX0erxmw263rUU+c4 xWwiDarciTWJYAWPXgK8a7Cnd+GpFc1fFL3EZpiwMR7JRT0xmb7T5gL+V0tQPoZF9nVL 8cWfnTEsLWI6stnbvyF4ZaRJmAkANwg5PSH7OTT6rCX53ZZk60j5MuwYmkQyi5wvHXpN iP//VKl9cknM7QfudgOBMohc1BRvfhAJMeM4KaWwGpfyr+ZOiVYIPJQ7ToY82QSNYdQF edGegOZydOCWAorARnqAXNrfoeh7zyJh5wJVeyhyx+JbzE4lL4LzpndVojEBJim8Lyq4 r6EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=LoDR6yW5PhaOI9nXfn4sNBMu5ukjVwmKI+VJR2t82HE=; fh=WK2PpSuOwWYxR92RxG/H8h1+4tM0PRTMPLWGJNr41EY=; b=FexTAGjeumBlrVOw0Q4SyaARcXXT6oOXfy5j6j50clds+KImlDqB+eZHy7rBC15KQQ 46b40W03SqnzweHnuQ3s80DUyk9IiGP20IFb53inWT68tiRnEjYS/suMbhBchhru5aWp wi16FAi9RnbnQX+x8qO6aLyhHjQEPiCHOHM0+ZeQQqFFa9hxx2wNWTZk3gkkDyu6PQqx M9sES3qvoNubIfX/bvqQkjvYA9mqlXVD+vdCbFYl565kWKlSIbW3xhOplV3X2mC9DUMC NgUOoPXiDZK9rPs1mwKqxa34yn6DM47M56XXpqSCz7g3Ztls22c78E2Wj+cOVUYebjsR vSaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hXGY7TC+; spf=pass (google.com: domain of linux-wireless+bounces-450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-450-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y9-20020a170902b48900b001c9c733c422si10612500plr.95.2023.12.05.18.49.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 18:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hXGY7TC+; spf=pass (google.com: domain of linux-wireless+bounces-450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-450-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 56754B20EDD for ; Wed, 6 Dec 2023 02:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F35463B2; Wed, 6 Dec 2023 02:49:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="hXGY7TC+" X-Original-To: linux-wireless@vger.kernel.org Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFBDF1A5 for ; Tue, 5 Dec 2023 18:49:45 -0800 (PST) X-UUID: 198ba52293e211ee8051498923ad61e6-20231206 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=LoDR6yW5PhaOI9nXfn4sNBMu5ukjVwmKI+VJR2t82HE=; b=hXGY7TC+sxlmrtHGpr5yMl4ASXuMFXHMLrgQe8fK3E8Bn41W9p5ZRa2U3KmNl9s+I7oONg2xzYx7irNl6hgXzBfH1NbVCIEWZxaDuQ8pdKDAjHoXauvNHaJZJ4BqZekNl9u04sjxtR4X06+zKWj/tfQhouZ1+nj9qF7KYf+/TSQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.34,REQID:828c328a-49b5-48ad-82ef-bb2c909b3cd8,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:abefa75,CLOUDID:fc9755fd-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 198ba52293e211ee8051498923ad61e6-20231206 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1106730928; Wed, 06 Dec 2023 10:49:39 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 6 Dec 2023 10:49:38 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 6 Dec 2023 10:49:38 +0800 From: Allen Ye To: CC: Johannes Berg , Felix Fietkau , Lorenzo Bianconi , Evelyn Tsai , "Money . Wang" , , Allen.Ye Subject: [PATCH] wifi: mac80211: Update bssid indicator with real BSS numbers Date: Wed, 6 Dec 2023 10:49:11 +0800 Message-ID: <20231206024911.7668-1-allen.ye@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--8.102400-8.000000 X-TMASE-MatchedRID: kgKXJcFYqZi2jsN8aguKvC97pb4g5HCtvtVce6w5+K9bLUcJ8BGOxWD/ jkY+Hb4O08QE6X8k+fyUTQ2JYQzY2yE6c9JYhNJ6k3ewifG2MNPm1SQ5tAvJo9qtffjsN+cnq3c ttlDobAypYSDa5JlKKGijwWv+7EDclwV2iaAfSWcURSScn+QSXt0H8LFZNFG73Yq8RVaZivWmra jv7qH7k7zHx35ro84oE/svZgTKKT+OAG8otMPC8qehxTSuqyLn X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--8.102400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: F1F1717A581B2F9DE085D79198B1B8E48C4B0560DDCDE47B740B2AA210E968702000:8 X-MTK: N From: "Allen.Ye" The cnt member in mbssid is the count of total number of MBSSID elements instead of BSSID. Therefore, we fix this by reading the MaxBSSID Indicator field directly. Signed-off-by: Evelyn.Tsai Signed-off-by: Money.Wang Signed-off-by: Allen.Ye --- net/mac80211/cfg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 606b1b2e4123..f90bcd59f85a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1164,9 +1164,11 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, /* copy in optional mbssid_ies */ if (mbssid) { u8 *pos = new->tail + new->tail_len; + const struct element *mbssid_elem; new->mbssid_ies = (void *)pos; pos += struct_size(new->mbssid_ies, elem, mbssid->cnt); + mbssid_elem = (const struct element *)pos; pos += ieee80211_copy_mbssid_beacon(pos, new->mbssid_ies, mbssid); if (rnr) { @@ -1175,8 +1177,7 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, ieee80211_copy_rnr_beacon(pos, new->rnr_ies, rnr); } /* update bssid_indicator */ - link_conf->bssid_indicator = - ilog2(__roundup_pow_of_two(mbssid->cnt + 1)); + link_conf->bssid_indicator = mbssid_elem->data[0]; } if (csa) { -- 2.18.0