Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp200136pxb; Wed, 20 Jan 2021 05:04:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrJX+tLiHBPZpL0XhzSTU7R09A2wwvGW9RvExBG3O/pv+9aYzZL8DA2VXf2anPapFxa8Ga X-Received: by 2002:a05:6402:190a:: with SMTP id e10mr7468524edz.110.1611147863639; Wed, 20 Jan 2021 05:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611147863; cv=none; d=google.com; s=arc-20160816; b=aRfGamyz+F2rCd+h8Oc55nzZLPLU1CSgv9h3Pvy7FSSmMLJzMeXKezbuzpoFGos0Aa YrCWAPCyYbYPef4NHh3L+R4q6ie/0efJAhYHb3GSIVQ1F1xVFKETrRoRpea0SXFFd8S/ ZTvfHIxdF5uAdJB+ljj76nLy3yWuh4WB9m7Q39RMZ+Mf3YN+mI5qdh0VhWKHFrsOdoaS 0tslWcqSsV4ElRrMcdAj9yB/JgTi4ASxpn1MZWe+YPbqiaO7l5hbJvcjSdyT5a/171YI QNOG4L5x+YNtUytHN+TSSCfmS/575Wz2hpR1fHSEMsw7RT2mKMfLCSbCwV0k+Pl0EbFo RYZQ== 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 :message-id:date:subject:to:from:dkim-signature; bh=dR7HHTfMHCKCLhthHVIvW/2u3DBNOi21dKCrKwDa6/U=; b=qWNyI99MNYMXQ/0ILjmIOUcxjg65P+ciS/7h+iOkSwkRWHHHBf4ngwqY80tAYMEU9j pWJVWlGwhcj4DFHmRS6UEuhRUutTnjwc2zfszh78jznWcgikolJEdVKLzi4Nih9BLziI zxvQ8z0Pf51SV5GIbdmPsKRdu+wIpBXh+CuB97cWObkixkh8U9HKd5UZwbnI4ny8B425 LlJjbNO6eDZK3RvRcbKFU6OubiWOd7zwHdBOZ5OZyA4m/I1LlmoztdlBULOBBbcUwba2 UZ3whQRwNLMCfuGG8KASukgV+d1+5VLJ26FCF3Vl6HdjaY9R0YSySbtPWrPyFjConaqx 9lfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=V8inCJOI; 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 da23si730516edb.104.2021.01.20.05.03.36; Wed, 20 Jan 2021 05:04:23 -0800 (PST) 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; dkim=fail header.i=@nbd.name header.s=20160729 header.b=V8inCJOI; 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 S2388849AbhATM7c (ORCPT + 99 others); Wed, 20 Jan 2021 07:59:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731356AbhATMML (ORCPT ); Wed, 20 Jan 2021 07:12:11 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063DFC061575 for ; Wed, 20 Jan 2021 04:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dR7HHTfMHCKCLhthHVIvW/2u3DBNOi21dKCrKwDa6/U=; b=V8inCJOICuMKOI3//pdurtLSv3 VvMw+FvqiYZf/u+LYMt/hpB9RYkjUPjUGVyFrekeQtB2lFUszHamcDGa4OfE/JpTC/c5gcGNeCLw8 oe2dVC63IiluMPY+HXQ+10bM2ELsgz/VOHqKlKEjiu/a6/KAJpVJs874ssWCzdwJWj/A=; Received: from p54ae91f2.dip0.t-ipconnect.de ([84.174.145.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1l2CKe-0008Rx-IX for linux-wireless@vger.kernel.org; Wed, 20 Jan 2021 13:11:28 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/2] mt76: mt7915: make vif index per adapter instead of per band Date: Wed, 20 Jan 2021 13:11:23 +0100 Message-Id: <20210120121124.81306-1-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The firmware treats it as global, so we need to avoid collisions here Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index cbd9892f5bf9..a38f52c87977 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -161,7 +161,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, is_zero_ether_addr(vif->addr)) phy->monitor_vif = vif; - mvif->idx = ffs(~phy->mt76->vif_mask) - 1; + mvif->idx = ffs(~dev->mphy.vif_mask) - 1; if (mvif->idx >= MT7915_MAX_INTERFACES) { ret = -ENOSPC; goto out; @@ -186,7 +186,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, if (ret) goto out; - phy->mt76->vif_mask |= BIT(mvif->idx); + dev->mphy.vif_mask |= BIT(mvif->idx); phy->omac_mask |= BIT_ULL(mvif->omac_idx); idx = MT7915_WTBL_RESERVED - mvif->idx - @@ -242,7 +242,7 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw, rcu_assign_pointer(dev->mt76.wcid[idx], NULL); mutex_lock(&dev->mt76.mutex); - phy->mt76->vif_mask &= ~BIT(mvif->idx); + dev->mphy.vif_mask &= ~BIT(mvif->idx); phy->omac_mask &= ~BIT_ULL(mvif->omac_idx); mutex_unlock(&dev->mt76.mutex); -- 2.28.0