Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp477070pxp; Wed, 9 Mar 2022 06:43:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAxiArqCVjoXTh8tSMrcV//+Rp/Xho4qMksUKRjGg+8c9Th8Z4wdKn3x7yBvlZvEClxX9C X-Received: by 2002:a17:907:7656:b0:6d0:1f5a:2bec with SMTP id kj22-20020a170907765600b006d01f5a2becmr77770ejc.164.1646837001398; Wed, 09 Mar 2022 06:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646837001; cv=none; d=google.com; s=arc-20160816; b=vLGu6Tgbk357eY3zvpgwB2sZZqaMXmzqDpWUt5BgWxVjmNlOANj95cfXLrlHvDyIr7 Ah/a5lhfMMjRWbkgbnnz1H38SLqMKPr6VurNi3K2gJso4Myxijz9xedu2aDvhEkrwX16 226vcJrsHMEaIlNJqNSFIumUVnUu59kD5QiuNMnZSjM1bKztL/4lsnMvfpQNvOWUGpLC u6vjwb1lMGBmcQKcwCei6lOi37otiZP8l7y2Cc0gSgaZUIya2ndsV4GkvKqLADNMeRIR r5lKvTm+pIL7OS9BpY93Occda/B/Efsx9f4vWuqEnzI8gnzEBcCWHrpeCej3HQNQLzM3 bYyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=nNhR9lzULjF+GOkSXVVSYWKeKChfy7S6p24fEtMM+Sg=; b=SmUaGPYg/l3fhGXM8H71hGOqcoUUpu+2yKL273xQiBbe0H25BDKgvXuAvvyzFWQfjs HB8nVIG8f7/NPfNhlHMmXmmVBwMhOQ6XwE0CpYvSY3NkZL4Nvcpq5zxK+31DpnrD+4NP c/JzvNmz6i7LkibW6zaxgSGSAHQlu4ss9HBk44lxe0LvPStAJGln80qNh20s+0hrRkya 0XfVyNeKKhxd2hN5RF8WZWxh2TRIxIfPLXfR2vHEa3sjW11UT4ADKQQNC7t+4IZfTp00 aXkoRHOzve6WZwl1NcAFyjAmB2g5tW4Tc6tDgKqgoVATiIFmfWx5oP6kZlrv9p3CJ8da EWDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a170906604d00b006d0bee7af78si1222731ejj.793.2022.03.09.06.42.52; Wed, 09 Mar 2022 06:43:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233393AbiCIOD7 (ORCPT + 70 others); Wed, 9 Mar 2022 09:03:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233389AbiCIOD6 (ORCPT ); Wed, 9 Mar 2022 09:03:58 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF524CD71 for ; Wed, 9 Mar 2022 06:02:59 -0800 (PST) X-UUID: 78969b6ebef648b093ad4470686b70c1-20220309 X-UUID: 78969b6ebef648b093ad4470686b70c1-20220309 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 685479044; Wed, 09 Mar 2022 22:02:54 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Mar 2022 22:02:53 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Mar 2022 22:02:53 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Mar 2022 22:02:52 +0800 From: Evelyn Tsai To: Felix Fietkau CC: Lorenzo Bianconi , Ryder Lee , Shayne Chen , Evelyn Tsai , , , Bo Jiao Subject: [PATCH] mt76: mt7915: fix MBSS index condition in DBDC mode Date: Wed, 9 Mar 2022 22:02:49 +0800 Message-ID: <20220309140249.10285-1-evelyn.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham 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 MT7915_MAX_INTERFACES is per-band declartion. Signed-off-by: Evelyn Tsai Signed-off-by: Bo Jiao --- drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 5e10fe156926..c60af144f611 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -727,7 +727,7 @@ struct mt76_dev { u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)]; u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)]; - u32 vif_mask; + u64 vif_mask; struct mt76_wcid global_wcid; struct mt76_wcid __rcu *wcid[MT76_N_WCIDS]; diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index c3f44d801e7f..9eefc132d77a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -205,7 +205,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, phy->monitor_vif = vif; mvif->mt76.idx = ffs(~dev->mt76.vif_mask) - 1; - if (mvif->mt76.idx >= MT7915_MAX_INTERFACES) { + if (mvif->mt76.idx >= (MT7915_MAX_INTERFACES << dev->dbdc_support)) { ret = -ENOSPC; goto out; } -- 2.18.0