From patchwork Wed Dec 11 01:19:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850058 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AEB52451D0 for ; Wed, 11 Dec 2024 01:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879980; cv=none; b=pYrnDpm1nfHAsAmP8z7N++4VY4Fke3L1S9i1zrPkRZJ++qToDqTzm01M+dTXBLM5wzFZQL7INeE09F+gsH2sXfRH6KTaKWISkjjR9oKpHKizsXheF6eMM5/Afcx3CzOWw8tV+Kxt5Fo9mGk5tsat5JejxkHVHsi3hHkNgYCIujs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879980; c=relaxed/simple; bh=VYGgGm0ULbxa+KBg4Byg/FjyhggivEeLHz/5dEXj3ik=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Jlm3psBdvXuO/e4qTcii+Gn0hjP8Ue5bDbhRkKXS7v26l+VldTqHhtTtYgk6uH/r0WDKUGyqkVWBLX8PGSUA4lF6KNsSx46qJA97FlyWyDyblcctQcJiR84BjpxwpGTRNlFraZPtHG7SVyOi/3S6JlZtRuDvbRDpIXJ+3+fWU/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-29fb532b668so949933fac.0 for ; Tue, 10 Dec 2024 17:19:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879977; x=1734484777; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7R2p//Pqh9wUP2QmrJjZ02D5zzYfEnah5rmAeHm8NgI=; b=X6ZgDBandDZfaqiOoLgE773hi/W+ngPHevz7dbKJFacsw9O3444U7i+/VKdNz3r41+ arM1DAs0oxMHlnCoOWLEpSvFm+KURfPqBt9TTIhWCcptiEl2x9gbLjftkF0d2Yo88agG vVWoUgCZTySKkoabedj+wEGVzUREv9XaEoLZuYhq5Tx+u77mLXIAU1546HILDptICeNK 8K0Cs/nEe8MgzkE+Tgdqsbrfk3zb+EKh9JMbLTZpFUBIOVROq6DMoImyGq6Npmm7XF7h yAV6AaaplXPG2nb4iXTwMob7HlaAkR5Avi9jgsBUcf4cA+JWr/mNOAcPzJrWYaIXwBZN Jjhg== X-Forwarded-Encrypted: i=1; AJvYcCVNOohU5j6nmC4oqgxcMGK5j/NVfTV303QU7/S7OCrJdx9sPggD5F1wbKy7Q8sBbM40CO+HwY7MSUetXNJasQ==@vger.kernel.org X-Gm-Message-State: AOJu0YyEtiJ5WyZFswVLpjK9O60lRCcD34RJAQchWyQF4TxSm+OuTvbM BRRopCrtj3ITnfDjla1mJBO6we73S3M6NOqVzTLblc7Zm6q4N2gDEv8MzzBTobM= X-Gm-Gg: ASbGnctqozSGeg4H4O9dt2JtPPEyhUOO9oAUrGwoTwX0DoK9Zgw5ffVcxchgHbnXDi0 39UWtaPfaXR6jpTRZ4T62QvMSraFWUZdA/WRCw81L6ieGLkh7PpD+lLtLDsh6VSMjGot/+b97W1 ecQGuAH2UcHeI8atmu/Tr4d3f0be0v2WXCw8JPfx7nCRTAkQXbmhxS87vISY5MOyNkp9TEnFVPE LY6ZsjaJGCZsPD+CH4LUWNSQmkHUsMGH+QNXNiF4Wop1pVK/eJsqEn4M0J9SpW+/yrYrRQ= X-Google-Smtp-Source: AGHT+IGNuoBK7+mQMrPDJXe8k8x4BCL83y7Gl405d/qpVq9bNdqtQY2pnCr2AcEElpzXFVMS43aLUg== X-Received: by 2002:a05:6871:6c0f:b0:29d:c5e8:e424 with SMTP id 586e51a60fabf-2a012b4f09cmr706059fac.9.1733879977589; Tue, 10 Dec 2024 17:19:37 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:36 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 01/17] wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO Date: Tue, 10 Dec 2024 17:19:10 -0800 Message-Id: <20241211011926.5002-1-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Sean Wang This commit extends the `mt76_connac_mcu_uni_add_dev` function to include support for Multi-Link Operation (MLO). Additionally, backward compatibility for MT7921 is preserved, enabling seamless integration with existing setups. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 1 + drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 1 + drivers/net/wireless/mediatek/mt76/mt7921/main.c | 1 + drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 4 +++- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 +- drivers/net/wireless/mediatek/mt76/mt792x_core.c | 3 ++- 8 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 804d3f5a5244..5373937b0e04 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -1113,7 +1113,7 @@ mt7615_mcu_uni_add_dev(struct mt7615_phy *phy, struct ieee80211_vif *vif, { struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; - return mt76_connac_mcu_uni_add_dev(phy->mt76, &vif->bss_conf, + return mt76_connac_mcu_uni_add_dev(phy->mt76, &vif->bss_conf, &mvif->mt76, &mvif->sta.wcid, enable); } diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 77f3e92d581a..4171710d645c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1137,10 +1137,10 @@ EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_ba_tlv); int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, struct ieee80211_bss_conf *bss_conf, + struct mt76_vif *mvif, struct mt76_wcid *wcid, bool enable) { - struct mt76_vif *mvif = (struct mt76_vif *)bss_conf->vif->drv_priv; struct mt76_dev *dev = phy->dev; struct { struct { diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h index 1b0e80dfc346..57a8340fa700 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h @@ -1938,6 +1938,7 @@ void mt76_connac_mcu_sta_ba_tlv(struct sk_buff *skb, bool enable, bool tx); int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy, struct ieee80211_bss_conf *bss_conf, + struct mt76_vif *mvif, struct mt76_wcid *wcid, bool enable); int mt76_connac_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 047106b65d2b..bd1455698ebe 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -647,6 +647,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac, ieee80211_disconnect(vif, true); mt76_connac_mcu_uni_add_dev(&dev->mphy, &vif->bss_conf, + &mvif->bss_conf.mt76, &mvif->sta.deflink.wcid, true); mt7921_mcu_set_tx(dev, vif); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 573a2cd7fe45..1542c762e2a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -308,6 +308,7 @@ mt7921_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) mvif->bss_conf.mt76.wmm_idx = mvif->bss_conf.mt76.idx % MT76_CONNAC_MAX_WMM_SETS; ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, &vif->bss_conf, + &mvif->bss_conf.mt76, &mvif->sta.deflink.wcid, true); if (ret) goto out; diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c index 634c42bbf23f..ddd406969061 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c @@ -1271,6 +1271,7 @@ mt7925_vif_connect_iter(void *priv, u8 *mac, struct mt792x_dev *dev = mvif->phy->dev; struct ieee80211_hw *hw = mt76_hw(dev); struct ieee80211_bss_conf *bss_conf; + struct mt792x_bss_conf *mconf; int i; if (vif->type == NL80211_IFTYPE_STATION) @@ -1278,8 +1279,9 @@ mt7925_vif_connect_iter(void *priv, u8 *mac, for_each_set_bit(i, &valid, IEEE80211_MLD_MAX_NUM_LINKS) { bss_conf = mt792x_vif_to_bss_conf(vif, i); + mconf = mt792x_vif_to_link(mvif, i); - mt76_connac_mcu_uni_add_dev(&dev->mphy, bss_conf, + mt76_connac_mcu_uni_add_dev(&dev->mphy, bss_conf, &mconf->mt76, &mvif->sta.deflink.wcid, true); mt7925_mcu_set_tx(dev, bss_conf); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 791c8b00e112..22a9437236c0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -372,7 +372,7 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, else mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL; - ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, + ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, &mlink->wcid, true); if (ret) goto out; diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c index 042aa8d1b6e7..e6046bfbefe3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c @@ -151,7 +151,8 @@ void mt792x_mac_link_bss_remove(struct mt792x_dev *dev, link_conf = mt792x_vif_to_bss_conf(vif, mconf->link_id); mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid); - mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mlink->wcid, false); + mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, + &mlink->wcid, false); rcu_assign_pointer(dev->mt76.wcid[idx], NULL); From patchwork Wed Dec 11 01:19:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849720 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15DE12451D0 for ; Wed, 11 Dec 2024 01:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879983; cv=none; b=I303Q7kjTIYqrL6ZLt4jurTrqXXTmX+HZCuBYoJOk9uCbQDny3o1OWZkMgO/G6hHFAB/oMseBLF/iwNW9hIy2fdCVeIMmOOhplYCZuZF9uXaEz3VG+kUV2fBp68k992Frigqhic4vnYqtUp3bGWG9p5BE6SHPd9wG2SmIC+fn3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879983; c=relaxed/simple; bh=HsDP+ktQDnTCTV73AHp2cMqdWdKNB1b2/EmOlwMgjA0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qn+Ih++HkH7o1CYBAAPMFz08gRbkVf+p1M7FPisY30SbCe9o9rsWa0QvsnLSjrp5lXyKNTD9ObTCQYAwSo0Py0JKvxOuQL93LtqiPUnWl4O0aIbUZx18f9WM3n8kuZMp32rcegi4a+GhMuIhj8hwCct8VksXHnGSLn89KtdrIRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-29e5c0c46c3so3195990fac.3 for ; Tue, 10 Dec 2024 17:19:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879981; x=1734484781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zAlj/teGsDEq9AqLoVCNv/Q4QETD233FzVs6JHfwoUg=; b=ZC1trDGDkrQN/RkMuL7v2Xo2klNSR7aeWJn6ur2JGFCI7cNkxNmwdwImFKPX1ppP7C gnoYiH+XoiCzeDgPMhJTGQ4wZd9azdYJ8kG7S6ADDeRzODnhN7LBGRbDrpmF3fpjik0R RCmQ2DZ+3blLNTHdYTKfAqZNzj9BLSj2/cDUbyYvr0KhpmFcA57qRARa8yyEJxEKipk8 5+Nu3oJdINNbkmuXKQlDItUW3Tbbh5l3LCxBhLiqUh5H2cZNn5uNtJwtuxfrT0v9sFkl UsKfYALbPBkSq5ig0r/+qeKtQHxKtZTPexkTVgduQKrjiLotxPlLGpc3GDoJotdxT7Ys aVGg== X-Forwarded-Encrypted: i=1; AJvYcCXw4BfivDplrB8b3jQACxiFzPHqJ3sDdZosqu9IANxFPOkdRagzokMybmM1InkmfKSRoNjsJUpjyG1nZ2QbxA==@vger.kernel.org X-Gm-Message-State: AOJu0Yx3KDUIwQSn9uCr1EULKlaUmrXACCdSzxshGXCmnV/3JDEOqai0 W7v3ZvpZdigPrtYvgIzzXxBMHEuKi4AeF3CMmxr7KZLqddr8w7Yy/TSBGd6g6NI= X-Gm-Gg: ASbGnctKXS9d7G1ULJkz0Fu+/7TvNWZDAOpf5plLGcCwrtNAcsZvZMlH1FcANwtycZp 7vc6dt2R8kEhs03JVPq077UqyRiPR+qKjZW0mp3geZhpIBwHNwSVGQEV2vYyY/56l7Nr7BRA8+Z Xu40s42AGlWiFoBdugecK1YBx317yVA4r1Nr2DGqXok+wTDVRrmPnHcxaBOYBL6vnA3eGAeKRmd QMO4FdTUBLbBa3pROjOcfnDEjaMGG4pZPf+cQv/5A2hrk+1boGhqyD1UOzGuv+x6Nd8dro= X-Google-Smtp-Source: AGHT+IEKGtkKMDcOAvSZPb9fRrb8ifnKVB5UFdmFjXR1LR7QbnJ19pUR1iRC2SZdihLd7LrZZ/euWA== X-Received: by 2002:a05:6870:3286:b0:289:2126:6826 with SMTP id 586e51a60fabf-2a012d9ce35mr796668fac.30.1733879981290; Tue, 10 Dec 2024 17:19:41 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:39 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 02/17] wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support Date: Tue, 10 Dec 2024 17:19:11 -0800 Message-Id: <20241211011926.5002-2-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh For this TLV, the address should be set to the MLD address rather than the link address. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 0c2a2337c313..7189d4f6dd4c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -2463,6 +2463,7 @@ static void mt7925_mcu_bss_mld_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf) { + struct ieee80211_vif *vif = link_conf->vif; struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf); struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv; struct bss_mld_tlv *mld; @@ -2483,7 +2484,7 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb, mld->eml_enable = !!(link_conf->vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP); - memcpy(mld->mac_addr, link_conf->addr, ETH_ALEN); + memcpy(mld->mac_addr, vif->addr, ETH_ALEN); } static void From patchwork Wed Dec 11 01:19:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850057 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54FD82451D0 for ; Wed, 11 Dec 2024 01:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879988; cv=none; b=Bc7A6eTRo2ziTmVuK128xS6UPbcDVzVt1tthnmtMlJZu6fjLGKC+8TTVtK50HMKUJbGpwHkrzCXDikrd0sDHI/jqakKpk0DUsSMOWiiCxl3GCRWlRb82i/WdXZrsQRN5x663i2X3x6FiJafegelRkkEb3qDQxEzyRkuKm2fbpNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879988; c=relaxed/simple; bh=EahyOeYmU0V11l+tXXPofBU8uIQw4S2EASu0iAyOUxo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BVUIMwSkXm+Xc5umsBRL5z0dgMC7dP4tRj0EOjofo1Ugeq3xm8CQzh8sERAslsLawxNbvdKs/5sF3JOs1TD8bbHqrVFpOp97cYCYgAeMJ6ZEkTBQkkL74kf1n8SwZIjIloJrUbMaTAiqKrPdb6epK+tiRFesXRMIqhUhwltesEE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-29737adb604so3134111fac.1 for ; Tue, 10 Dec 2024 17:19:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879986; x=1734484786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hEOr7ZXlRapM92LTTZWIPUw2bm7p3TbC4/klzbIn6U4=; b=L3SnzRBAyZcXuKNJbpkOFIdY+v3+nVaaI8v3wenK/PyvHcX0DvRtepv9tNiHP55dM9 iHhNHnTL/cCnGl+hypPuiKSviaDfuGaHd/Z8xHApKiZx4FUB1I7ECyPIBPybEdzEah8y ra2gSIzGtGaaceDFsKYsXukN+xfUxni92gfgTcwv8cq5PWJNlHPzHSR1FYLLBrZcuyiV rB4ETp1IXsQEykF39dkv7nsrO7FLOY8o3eCdB5PE1uHTSxrK3kyM6fepxZmbDuQ5+VTU JG+Ur7vaXlpS2UHPVNvrGdFrnbejl7FhjhL0dXg3UuW5CyNfcVpUdCUFimc596aMDfpf jpGQ== X-Forwarded-Encrypted: i=1; AJvYcCWIN1iANQCxWcER6xjqRbybYEoBcEA6GZe+oJW9MXvIO/KF9JQMrABkpz3V2Rp/lta6Jt0EpKp2uSjRFR5SNg==@vger.kernel.org X-Gm-Message-State: AOJu0YyBvGewNcHPMnVtAvTR68w2fWCiIWmq1RCkbaleJvdyiSi188X3 rtYXukn/QaH77UDAx/eTkVTmmYbnDasyr6awulIRjTYNn30eXCMUSNeZv+2q62I= X-Gm-Gg: ASbGncuVQiJ/fWmRJDtcnylA262X8yjqqKQRElOSk6kS7xySRvrxE0bzbXnz7dAuJkW PYcFHbl+ntCms3sV98nVisuopVLp4KJCHGRnVkVIdpqTuQRyFrb/Egw8Bo2cAdBtZo0vqWTOwIz 6IeTDH68wxt/ydimM+r68A7RSLbKzZNwPEjzBNkII8ZS32akd5625eNJG5hS4hhQPz0TchJcXWP eyKkO5iWtx+icbI6LzGnfeonHInZdb6CMoZNqhZm3xpEpb1yAERoWSJBCi9StD79qRrjGI= X-Google-Smtp-Source: AGHT+IHyTyMIudqQQAHm8Avp4jqbQUHuxB2LXIFJRrOoiknpoI5ToKmsSgg7GyvDzpOHcwl3dttvug== X-Received: by 2002:a05:6870:2887:b0:29e:569a:f90d with SMTP id 586e51a60fabf-2a012f3f948mr555637fac.32.1733879986473; Tue, 10 Dec 2024 17:19:46 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:45 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 03/17] wifi: mt76: mt7925: Fix incorrect WCID assignment for MLO Date: Tue, 10 Dec 2024 17:19:12 -0800 Message-Id: <20241211011926.5002-3-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh For MLO, each link must have a corresponding WCID. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/mac.c | 2 +- .../net/wireless/mediatek/mt76/mt7925/main.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c index ddd406969061..a095fb31e391 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c @@ -49,7 +49,7 @@ static void mt7925_mac_sta_poll(struct mt792x_dev *dev) break; mlink = list_first_entry(&sta_poll_list, struct mt792x_link_sta, wcid.poll_list); - msta = container_of(mlink, struct mt792x_sta, deflink); + msta = mlink->sta; spin_lock_bh(&dev->mt76.sta_poll_lock); list_del_init(&mlink->wcid.poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 22a9437236c0..6823187f406b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -837,6 +837,7 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev, u8 link_id = link_sta->link_id; struct mt792x_link_sta *mlink; struct mt792x_sta *msta; + struct mt76_wcid *wcid; int ret, idx; msta = (struct mt792x_sta *)link_sta->sta->drv_priv; @@ -855,6 +856,15 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev, mlink->last_txs = jiffies; mlink->wcid.link_id = link_sta->link_id; mlink->wcid.link_valid = !!link_sta->sta->valid_links; + mlink->sta = msta; + + wcid = &mlink->wcid; + ewma_signal_init(&wcid->rssi); + rcu_assign_pointer(dev->mt76.wcid[wcid->idx], wcid); + mt76_wcid_init(wcid); + ewma_avg_signal_init(&mlink->avg_ack_signal); + memset(mlink->airtime_ac, 0, + sizeof(msta->deflink.airtime_ac)); ret = mt76_connac_pm_wake(&dev->mphy, &dev->pm); if (ret) @@ -904,7 +914,6 @@ mt7925_mac_sta_add_links(struct mt792x_dev *dev, struct ieee80211_vif *vif, struct ieee80211_sta *sta, unsigned long new_links) { struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv; - struct mt76_wcid *wcid; unsigned int link_id; int err = 0; @@ -921,14 +930,6 @@ mt7925_mac_sta_add_links(struct mt792x_dev *dev, struct ieee80211_vif *vif, err = -ENOMEM; break; } - - wcid = &mlink->wcid; - ewma_signal_init(&wcid->rssi); - rcu_assign_pointer(dev->mt76.wcid[wcid->idx], wcid); - mt76_wcid_init(wcid); - ewma_avg_signal_init(&mlink->avg_ack_signal); - memset(mlink->airtime_ac, 0, - sizeof(msta->deflink.airtime_ac)); } msta->valid_links |= BIT(link_id); From patchwork Wed Dec 11 01:19:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849719 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEE042451D0 for ; Wed, 11 Dec 2024 01:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879993; cv=none; b=mh2rusWdxMiXKYo7vkKNYPlu+HM2RtiHxlqKk63hJfHSovFWHqHsLY7MtEglhPo2bHOY2O8Ue6jiKaM9F109EcPxsSGY73AWj+4aOhmCdJTVX6/F6Z8YB+qsHpVzWg46BRJLkt5d5SCfB1++pWkFk4W9JoS7933GOKOjzBA7ydo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879993; c=relaxed/simple; bh=veCj8jswodCHOWoK/0Hw2g6RuJ5G96o8XzB7nZpGOFk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TiIfWzHeC5t4v1MBMjTTn31ZjeKnaW8oKMU4WwdrbcbvEodell/zHvgzTiFzUowV1BRlARekHDnG5MTaPSx6DOAm7lcs53n/O2T5MA8Euon/mkA8C5yRkCZQAHPwFQDiLrMMhNWcRHAXun7gpJtF7O2v7vgQdtutbLVcicwXHXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-71e02eda71dso903910a34.0 for ; Tue, 10 Dec 2024 17:19:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879991; x=1734484791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rpVhxS7jqXsBo8scTDy0x+y6eI+LhzVWJoven7CoWuY=; b=KK+Wx8v9mUeTKUvph6+GJeASMHc5a+Ll7G0FcTyK6JpyPIop/7k2EKozK8/z4j1fSq raFEL3yAf0Wvrls1hbOR8YxB1B5rX7fCLrOHdNGGAu9EfeRmZNhozkmC/YshiRxtjNmV 8njKfk9QHx73qTsjCU8RenesLQjL8A780VjieHrWUcdG/HI73gstETJZ+q1eGUk+w1fX wI4ez99PPhsUkXvhYj7fcOJaj2AIpOB2Rc33NrA9/V5KC3gIrIp2iNisQpEonbb+2ykd Bh5SNGfQS7ac+JwrFSbPT/H4H1TAxViG2YxBTT9ILFJ+HBqapKOp3NVYGi9w0LDc8ThQ Kifw== X-Forwarded-Encrypted: i=1; AJvYcCW5Y5+0tYSh89NthWF3FmCB2j+akiWsWSoFKWpDw9Ry3Z8dtUPKPl3T9DVfBVZm+6kmLUE3UbsZe+tq8pz1Jw==@vger.kernel.org X-Gm-Message-State: AOJu0YwKTYD05ms1/Mr3C8yKKjiY4wVhmN31pyaD/Cp/fu0pv2HMqpCf Rl6wuywQg0VUWtfVmbzqznNLl38JUq4s1kFfBoauJtmp2MSgDzpgwh1pzCrwqwA= X-Gm-Gg: ASbGncun/jiuuDI4rfmsSNaD72XW+4ijpU3su/xLzODaRJ6H0K6lCgFOnu4d8hIgs23 0hQhGcCXOCEkYZ32Lnf0YPx28w+vp8Ue7l3GdCJJRH/p9bNajsWWg8eGgnnRDOzETMAp6RcXOAo xOIEWPnvlZEqt3z+yexhw1d3bWXJ29rKr96MxDvePzsLa48Bhl9FT9RrnCCzdDR/LdMNix3+oPc vNDm/f7gfugHvoalaNeLa88JRqxKlq+xuBQrzJiCqUSIIMeAyVtJxJMRtYpufYPZKquwew= X-Google-Smtp-Source: AGHT+IF5I9BChu/+PnBYCjP290N4JLBxE7ykFbbUyl855H1vZYnMKRE0FkIgujm7qjIVOEwqqEU5Sw== X-Received: by 2002:a05:6870:a104:b0:29e:255e:9540 with SMTP id 586e51a60fabf-2a012f9fd92mr745313fac.35.1733879991082; Tue, 10 Dec 2024 17:19:51 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:49 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, Eric-SY Chang Subject: [PATCH 04/17] wifi: mt76: mt7925: Fix incorrect band_idx setting when enabling sniffer mode Date: Tue, 10 Dec 2024 17:19:13 -0800 Message-Id: <20241211011926.5002-4-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Eric-SY Chang In the current sniffer mode, the band_idx must be set to 0. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Eric-SY Chang Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 7189d4f6dd4c..83f237d49c26 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1976,8 +1976,6 @@ int mt7925_get_txpwr_info(struct mt792x_dev *dev, u8 band_idx, struct mt7925_txp int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif, bool enable) { - struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; - struct { struct { u8 band_idx; @@ -1991,7 +1989,7 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif, } __packed enable; } __packed req = { .hdr = { - .band_idx = mvif->bss_conf.mt76.band_idx, + .band_idx = 0, }, .enable = { .tag = cpu_to_le16(UNI_SNIFFER_ENABLE), From patchwork Wed Dec 11 01:19:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850056 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCC4F6A009 for ; Wed, 11 Dec 2024 01:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879998; cv=none; b=hF4ZP9u9w87Y5+/Wza1rzGsQep9Zs27PdqtTs0holtcEHj9LXPi9l6YOiGaQVdcdZ2m9w7ihBoFR8AZ79NUIHZcRzE9xl/u4y87kHHY9qTqXvZN/5pAFJW+FB1cWldjWrvcLe9VUSzUMv+GEQSkZi22QgIgWL4QytZLYWP1XmuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879998; c=relaxed/simple; bh=s/sA1uk+inbUfQVuXexas5TYATGj5+rmsBCQ+Vu/oYI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=REctl+oGlHmHdu7BPcBQmrH/z0UOiAoJccfT/SVXcjlFD6FtR3gD/FfadUdYu7kxDj8CEkJR3cPY2Kd7ZQuC/n7ALpUWkPu56h/ghmt1VHUI8S7zHKqbm01qeJUcchk/DrRxWXCRs81AmCSti9NLHrwSdW6CBBNaWWhsGi27WkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5f2da12248fso107537eaf.1 for ; Tue, 10 Dec 2024 17:19:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879995; x=1734484795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yp97iVt69yOBSqlfe/exljPV9iDu960ZlpwaBTRyHuE=; b=Rv/ianIgdQujhsZEsTH8BLU8FIbTFwS+GMxu3tQGOR8avFGU7jlU1kHy5UPVs8U1Te 9x9gd6ayI+6MeDlUlT35ivIIiuQ9JJJGbOkiAzBu3d8Kstz202yeW8RGucSwAILdsd0h dXjBGnjt28VW6F8Ay/uUsK6JuyBSh2D28iTeTObRHojxVjZNFdZtKZTgQTfOpdhFX3AP 31kK+6oh7EcA6s2e6e9bDoUJ0ayMF2OIqzadpAcJ/ggjsC3gZTClSOExAbUd/UoDRmxL +u4lrKW8AmjshEcZcPFSzPR6M3fZ6OvjxFo2vvCWq5FB/QTGwDGV/otBEqOHlBYO2zUl EMSA== X-Forwarded-Encrypted: i=1; AJvYcCWgE9z26wxIkOCWk+9+iQH38IyuQ0FrwL9og3bjRkggNK/AHfhU6SXhZJXmCW8VKp0kwIlgirJwMnvq0vHT7w==@vger.kernel.org X-Gm-Message-State: AOJu0Yzw4aaqyxkpiRQg9GEqH1HbOqgkJV/vuzwtVYS8ku7ZjiE/m1wR fIKh1XbDcPzOXRUOwfd3vfTT6mR73ULwgTBGUMBZLE+5d/psKzUF X-Gm-Gg: ASbGncvn2iN28kp4CPsD1xkHZzBEXZGPk+/iQ669aNVyhspDI8zZptJRsZX0XI9AwqI aDc4XzvFaljUGe/HffdbLGM/bOSTbmMcrxLTmsivEQYzzbJxtElqQdTn8x4gVp5HdRoeUyXb0iR 0TK8FmO84EN4gd6AoqTFgqPxYO3iqu0zyMRRqbVLPLc78hMzVUkrmcj8umD0DRM5qPSmiGpqhTJ 9DxAZ30yy7zezWtWqjvVjVDNQhgrbclTSZUKcneI9gA8chKg78ITUQW7efc8kOHA6BUY8M= X-Google-Smtp-Source: AGHT+IGub+QpuAGxq89kxr8PhzQ0vEN2Is89Nr60V+LtDwDd1KSFdzv6E/56OxeohVB4H7GUerri1g== X-Received: by 2002:a05:6871:5224:b0:29d:caa2:f0ef with SMTP id 586e51a60fabf-2a01537d059mr502351fac.6.1733879994868; Tue, 10 Dec 2024 17:19:54 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:53 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, "allan.wang" Subject: [PATCH 05/17] wifi: mt76: mt7925: Fix incorrect WCID phy_idx assignment Date: Tue, 10 Dec 2024 17:19:14 -0800 Message-Id: <20241211011926.5002-5-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "allan.wang" Fix incorrect WCID phy_idx assignment. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: allan.wang Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 6823187f406b..97b48fda5595 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -384,7 +384,7 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, INIT_LIST_HEAD(&mlink->wcid.poll_list); mlink->wcid.idx = idx; - mlink->wcid.phy_idx = mconf->mt76.band_idx; + mlink->wcid.phy_idx = 0; mlink->wcid.hw_key_idx = -1; mlink->wcid.tx_info |= MT_WCID_TX_INFO_SET; mt76_wcid_init(&mlink->wcid); @@ -851,7 +851,7 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev, INIT_LIST_HEAD(&mlink->wcid.poll_list); mlink->wcid.sta = 1; mlink->wcid.idx = idx; - mlink->wcid.phy_idx = mconf->mt76.band_idx; + mlink->wcid.phy_idx = 0; mlink->wcid.tx_info |= MT_WCID_TX_INFO_SET; mlink->last_txs = jiffies; mlink->wcid.link_id = link_sta->link_id; From patchwork Wed Dec 11 01:19:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849718 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D1E522098 for ; Wed, 11 Dec 2024 01:19:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880000; cv=none; b=RRsnI2LgR742pixj0uInYDTrGEVwGNkOquP7Q71L2Kxn5ygaCAWNpwLUb8CuMSfVbmlVDS192mfpFFRbqShxojRvi8SbwoLHur9EpszAqlQNKfLhN/74XodlneyEDNvtBf/g2ez7sOUOOBhCmG6g2ww8LKoB3aO0/HzRXpwrziA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880000; c=relaxed/simple; bh=tKxK8ku2yAnUtRd0m+X8zKnILJlXjJaoAvpA9novS2M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=i340nq/nmc2H6ZTxDZXv4Yt/Ut+JTiZG4OOUTTwoDqnsHWnk6vY7+AIgcWY4+s076R8OUs/M86i1R9sIn9POWumEwao8kEee/NpN0UuOhhcuQju/U259pRoDZ4LPSMD2NLIQALL4qMG2G7EndinlimAfXfRZRAWi2ZIdnE0Aptk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-29e2a50586dso3245710fac.0 for ; Tue, 10 Dec 2024 17:19:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879998; x=1734484798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yk49pXqoMYWny8tmzY5u5tahMKAPgzxyn6k/GluClh0=; b=LvrHCqmUyflEI/PNoUQCK5c7HDBrjVg5SkllPJbghWFQmgrAsnlcU01zBX7trwt79V sG4+pvVFRyI3GOUDybVWfijABvNAtGdL/aMddlHVELR+DFqRplgSJidWURn2rDCZwxu7 2cYno9dmOst1pcVsHPQ0Rqq73h4drFauVE1oPO9bXfR7jLJ3frXVQVoc/Rj9U7PeDmYx 1/GovMSi4vPjBwFnDp6edKrKysGiEoq8cs6pLzfZEPkFeHguiU+iOXJ2wA++gRK0vKbV WDoLHfb+0PyDo1bmo2cc8jtJRcLyO1fYHaFk48NQ2f7wrw78DmU711v6Zrw8Ix2kh32o swpw== X-Forwarded-Encrypted: i=1; AJvYcCXE5XxE9hnOwn20k9zOfhmAIgcQ57U4kG0UXlg/uOGUQHyGoBRkTXFSSGCIktTJCx9ZehC+2JLlXKKOFaN+ow==@vger.kernel.org X-Gm-Message-State: AOJu0YyzdPGAxEgbFErwOl2kqwmTX/xdAVBwo/fubQPwycSkSON3JPHy cBQwV0BJdCUWW+lbsAqmTv5bIsh+DOo0VAVTgyvRPpbziaIC8ZgV X-Gm-Gg: ASbGncuFvB1ZQlViHmqQfHo5dFn+bBmW7XnbEw1ksY9rlCD3qslkdPPab/PgDroCFdV HWbwhpM71F/D5KThqan6LY72roNSNZWa/4Q8eyc2mnDZfo1Iq3rQRpAMyz74kVGoVXvNO9R8ckR 4ZKvnPB8aED5mTIQWFEz7a5OhncKaLMfCLY4E38a9RlLL/f1fklsVCL2cMho5BNSQoH6F63Qabs iTMcILLa+Nb94KbBgK9a5EfPobcrnWSnCjOFJ1gvIVxoux8g/umAlVRKLfg4qiErrer/kU= X-Google-Smtp-Source: AGHT+IGqPCatQj/2c2jZ6uQhg94tt5NOTEosEEskQiKERWxs5QGjzv/Q6ATe/f81GUUeNedQJy5aqg== X-Received: by 2002:a05:6870:7b49:b0:29f:8a1b:f76a with SMTP id 586e51a60fabf-2a012d9cdb7mr583515fac.28.1733879998456; Tue, 10 Dec 2024 17:19:58 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:57 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 06/17] wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info Date: Tue, 10 Dec 2024 17:19:15 -0800 Message-Id: <20241211011926.5002-6-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Fix incorrect parameters for the related channel information command. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 83f237d49c26..f6aa052ca802 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1200,6 +1200,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links, req.roc[i].bw_from_ap = CMD_CBW_20MHZ; req.roc[i].center_chan = center_ch; req.roc[i].center_chan_from_ap = center_ch; + req.roc[i].center_chan2 = 0; + req.roc[i].center_chan2_from_ap = 0; /* STR : 0xfe indicates BAND_ALL with enabling DBDC * EMLSR : 0xff indicates (BAND_AUTO) without DBDC @@ -2177,11 +2179,27 @@ void mt7925_mcu_bss_rlm_tlv(struct sk_buff *skb, struct mt76_phy *phy, req = (struct bss_rlm_tlv *)tlv; req->control_channel = chandef->chan->hw_value; req->center_chan = ieee80211_frequency_to_channel(freq1); - req->center_chan2 = ieee80211_frequency_to_channel(freq2); + req->center_chan2 = 0; req->tx_streams = hweight8(phy->antenna_mask); req->ht_op_info = 4; /* set HT 40M allowed */ req->rx_streams = hweight8(phy->antenna_mask); - req->band = band; + req->center_chan2 = 0; + req->sco = 0; + req->band = 1; + + switch (band) { + case NL80211_BAND_2GHZ: + req->band = 1; + break; + case NL80211_BAND_5GHZ: + req->band = 2; + break; + case NL80211_BAND_6GHZ: + req->band = 3; + break; + default: + break; + } switch (chandef->width) { case NL80211_CHAN_WIDTH_40: @@ -2192,6 +2210,7 @@ void mt7925_mcu_bss_rlm_tlv(struct sk_buff *skb, struct mt76_phy *phy, break; case NL80211_CHAN_WIDTH_80P80: req->bw = CMD_CBW_8080MHZ; + req->center_chan2 = ieee80211_frequency_to_channel(freq2); break; case NL80211_CHAN_WIDTH_160: req->bw = CMD_CBW_160MHZ; From patchwork Wed Dec 11 01:19:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850055 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DCD12451D0 for ; Wed, 11 Dec 2024 01:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880004; cv=none; b=cL+UnHhG22uq3tOf9/3YBbxd9ACQPx3jBbSscX3wK33jhIaraj9Xe+7h1aqPiH2Xxi6eGWoTKRtxBCLslIdDnUnSugcj27lJp0ZV2OcDGUkWQLKwoHQmkFCyJKjS5umpWGp0G3yWunAFgutO/OyZsQeoyw5n51js3dJjboXPPtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880004; c=relaxed/simple; bh=xKcZQqVpL2fgXVDX4USSJ2CVB4s4KJJmbdj+YHgZRQE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lZye/RjCqmFGHCiIYggrOpuOZSO/m/BXLuL9kg6nr+1lubIJW9kCxCuH7I0FvnmDn4KDjhvijEQBXD14qYARS3KB5FJWcNweC05dClOobLiYzFSM+IKZgZPxpvBi2bhtddHmp6LS0o2kv1qrjxQ53hfPKXoB94eO5Eh90HM0DEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-29e61fcc3d2so5323911fac.2 for ; Tue, 10 Dec 2024 17:20:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880002; x=1734484802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yl5+M/3Wjfu1WokgjzEWNvkbZlxOvtZ069F9urs3Uak=; b=APTJ8Xy4bVjFcbwLHhhnrr3PFveqjbESiYRblZ4PPNX69RVSdSpIz4P7dsUy0JmN2v LLfjG+VlhJnGVtXn1sY/ngvwAjhBHnuw+SAe2DJ7A4hTxO+NHgQs7Qqdn6N+KEz12Uke p010MdlKZrLqMR3p6D8i+U13xupQT/BsboMiGuXYlUbxj7qeo+jQZg8yzGEOw2chka6E vI+gCb7ebtAdzZM3rocI+Zyrny31BrYJrA7scGvWQRMeOHhi2JDtfcaWUM64vFZUH+UN ZznCHJ1iRYr1VMrzh1ly3p1CvkWUavf5Z3F6gVJM/XoyEeUIgTiLdJ9CE1rz+HRX4xyA 0ArA== X-Forwarded-Encrypted: i=1; AJvYcCXU5TZFkyjMfhRJZ69V2FhrwQjma2WiQOMC4HApfVBhY2qI+kpRLaBzLyIVjg50+pi3JImPJBxc3cbcGWsSEQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxHZ2ZgUh7kzh/UaKi2izNBu8JAjJIEKQxaqcFxnaaImZc3AxP5 kYfdQl2sAMVIKgEo2NPQ4zIwbnWdpwHFcxcRSC2IW9bxoD3IpppjY1PGVOXMuK8= X-Gm-Gg: ASbGncvjQdmEg9r5ei20NIgxIDBGgOHs01qX804lC9+SqEC8W64syadPoRw7yVlwX4m 3GWx0fN92kwVSQNZmB8CgSX7e05Blaz4ssgFmRZ0cfup45ayIwY7US8Kx4CMUS0Q5LaAbRo3bzr +JGKQXc5tx3moyX0mZcXmCc9TsbpY+JsEUnXE1WHw67Tlqk8Aw/aUvQdEpx1pk/gZo/N1R6AdaW p5QNM0V3tQaPv63Wd11KausOTcTle14PkaIThXxztxBOU9FYi4q33EMKlzqejj1ggsE7iw= X-Google-Smtp-Source: AGHT+IFGjk93XHCKgWPxTkUaom6Dr1++sOdagiuWtt7nKIOG70Vy6CmIPsr1hmkgXTjKZwbXe2st+Q== X-Received: by 2002:a05:6871:820f:b0:29e:4b63:d7 with SMTP id 586e51a60fabf-2a012bb3bd5mr562846fac.1.1733880002127; Tue, 10 Dec 2024 17:20:02 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:00 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, Leon Yen Subject: [PATCH 07/17] wifi: mt76: mt7925: Fix CNM Timeout with Single Active Link in MLO Date: Tue, 10 Dec 2024 17:19:16 -0800 Message-Id: <20241211011926.5002-7-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Leon Yen Fix CNM command timeout issue when only a single active link is available during MLO connection to fix the following kernel log error. [ 741.931030] wlan0: [link 1] local address be:90:e0:22:c4:22, AP link address 08:0c:43:7a:19:2a [ 741.931042] wlan0: [link 1] determined AP 08:0c:43:7a:19:2a to be EHT [ 741.931052] wlan0: [link 1] connecting with EHT mode, max bandwidth 160 MHz [ 741.931071] wlan0: WMM AC=0 acm=0 aifs=2 cWmin=3 cWmax=7 txop=47 uapsd=0, downgraded=0 [ 741.931076] wlan0: WMM AC=1 acm=0 aifs=2 cWmin=7 cWmax=15 txop=94 uapsd=0, downgraded=0 [ 741.931080] wlan0: WMM AC=2 acm=0 aifs=3 cWmin=15 cWmax=1023 txop=0 uapsd=0, downgraded=0 [ 741.931085] wlan0: WMM AC=3 acm=0 aifs=7 cWmin=15 cWmax=1023 txop=0 uapsd=0, downgraded=0 [ 741.931095] wlan0: moving STA 22:0c:43:7a:19:2a to state 3 [ 749.090928] mt7925e 0000:2b:00.0: Message 00020002 (seq 15) timeout [ 752.162972] mt7925e 0000:2b:00.0: Message 00020003 (seq 1) timeout [ 755.234975] mt7925e 0000:2b:00.0: Message 00020002 (seq 2) timeout [ 758.306971] mt7925e 0000:2b:00.0: Message 00020004 (seq 3) timeout Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Leon Yen Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index f6aa052ca802..d0bfc7711a80 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1153,7 +1153,12 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links, u8 rsv[4]; } __packed hdr; struct roc_acquire_tlv roc[2]; - } __packed req; + } __packed req = { + .roc[0].tag = cpu_to_le16(UNI_ROC_NUM), + .roc[0].len = cpu_to_le16(sizeof(struct roc_acquire_tlv)), + .roc[1].tag = cpu_to_le16(UNI_ROC_NUM), + .roc[1].len = cpu_to_le16(sizeof(struct roc_acquire_tlv)) + }; if (!mconf || hweight16(vif->valid_links) < 2 || hweight16(sel_links) != 2) From patchwork Wed Dec 11 01:19:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849717 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B197313C914 for ; Wed, 11 Dec 2024 01:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880008; cv=none; b=sNgpwTeC/yyw/S9pBk+gMW8EMj4s962g1BP3IXix1HH0pRsBoIIOjkSyP0qKruLP49azxiwhoAat376MEkewOyJLlRJLv8irK3YadOTu17dSOnLp4stF5f+rP+5pt6jggASJjJ3MbmfayvWOZs/5sv5qIdI2oJOw2abX/4z7EOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880008; c=relaxed/simple; bh=pK++0OLvgOIrMemRBrSy+rWTQfCSK6vdyInOX1CbyFY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OMQcgyzot7BiubjM+dFqpSx9PmvZfEKr6/YF+wo8CK+uPsw9RECzVWKD9RxIIXgc3ketbosEPwk4bqc4Ay4to03TE3j98wsIikOpDx/Oba8u1imb8kAyAtrabtX07jgaPmFtE6RrmV3ctLRg80DtBhYLQFEYZNOhWh3NDSlStMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-29fcbf3d709so1001539fac.2 for ; Tue, 10 Dec 2024 17:20:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880006; x=1734484806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UEJ5kdrUNfjAy+icZnm1esu6rZ7qPtHroRsyBXfTsTs=; b=czkUdKMwIx7dgtjyvbVbMobs+RDw9ItGbznXLQ6RjuHl+6HpWguXzE+7x9VpAvfB9v XvJl8Nirpolynh7QjldDZqlJYBT/5Uje1/Pi/fok0yqnxE8sXK4q9YnGOb6Dh7AzishC qWL8kOpWRAPWHoCvIGZjaFlXuCwaG+bO5jN/S3jHjKG+WV7/M0geonfGQIpwcQkgRfBz VvH9Er9/FVlWyDGwFf6LhMGbU4tfH/TQ+yKebVAMiZ+N58wVnOMe+Z7zd3V6Xxl8e/3E NWfS5W6vswSO03VNGwX8S3WzR8FVs0VrXKBE1Xq0J7FOn78ZWaVgSUF8qO7fsKAaKULJ 49Lw== X-Forwarded-Encrypted: i=1; AJvYcCUWSKt+2ATMMsltXCiAB8ncdxUzw3mhu+tE483TTvt0IFbQmOEcZD3yPIGvQZoROvMM8Q9UkVnJluD3KzQgGA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw6377kMZLs3WpTMg1B1pIJ+TWXSo79Q2Uepd+aGWAXLzCiU2bN ZVr2q4DrdfgHkXksziqRgkvGLwtSnC5VRcpf3RZd5s2W1r10AStd X-Gm-Gg: ASbGnctR/bxH+6xJtFbwFfzAySm7+klDqFZ/G5hVP1dDMp1/0R6e2ecOmRWn0Qa5wvK emZUpUMKL1Sf/SpC9HMESd9diZazsckdAaw2kY0vJqweTQNHn9/ynjYjiO8GsZxSbilBf1oZLv8 ZJXP9XFjUQrdAVFmRxoaGV5ZvUo60fnr1/tqHxppDfZ6aQM5f90opkallrFTvmxR7dNk1hRiIT5 bH32Dwyi2L/DTll7Ui3F34ffl2lKmVcs3HHkAGt04ri6P1fSG0/TcPX5tzcy6/PyT+Ibxo= X-Google-Smtp-Source: AGHT+IFcQ3gUsYitlfCkN5kLRyrQGJyfYcf884guORROPcDHh0Lvi4yEHkFTf9jFWu3U8jkQsLxilg== X-Received: by 2002:a05:6870:4990:b0:29e:671b:6003 with SMTP id 586e51a60fabf-2a012dc69ddmr561652fac.32.1733880005778; Tue, 10 Dec 2024 17:20:05 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:04 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 08/17] wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO Date: Tue, 10 Dec 2024 17:19:17 -0800 Message-Id: <20241211011926.5002-8-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh In mt7925_mac_link_bss_add(), the mt76_connac_mcu_uni_add_dev() function must be executed only after all parameters have been properly initialized. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 97b48fda5595..93e00a3840fe 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -365,18 +365,14 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, mconf->mt76.omac_idx = ieee80211_vif_is_mld(vif) ? 0 : mconf->mt76.idx; mconf->mt76.band_idx = 0xff; - mconf->mt76.wmm_idx = mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS; + mconf->mt76.wmm_idx = ieee80211_vif_is_mld(vif) ? + 0 : mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS; if (mvif->phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ) mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL + 4; else mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL; - ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, - &mlink->wcid, true); - if (ret) - goto out; - dev->mt76.vif_mask |= BIT_ULL(mconf->mt76.idx); mvif->phy->omac_mask |= BIT_ULL(mconf->mt76.omac_idx); @@ -395,6 +391,12 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, ewma_rssi_init(&mconf->rssi); rcu_assign_pointer(dev->mt76.wcid[idx], &mlink->wcid); + + ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, + &mlink->wcid, true); + if (ret) + goto out; + if (vif->txq) { mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq->wcid = idx; From patchwork Wed Dec 11 01:19:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850054 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BF87137C37 for ; Wed, 11 Dec 2024 01:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880010; cv=none; b=FvX3SZWg2VyMZvKaJt/0unx5b+BGHeOvrKGFFAONVq95yPqOm+IunIkAGdID8UTmiXQQb7TOQankZJL2dFEjYCIEsUBDJYfc+CL60LLsxNXzbpHlkry531VQlafkaidy9UWTI715fl1HF9VnpxKmpVi0Mh5o6sRnkbX1Vgb0+7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880010; c=relaxed/simple; bh=DzMK61PDEB8bhmUK0HD911K/DuT5MeZ0duy0BTp6pgE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZDJF67F6TaUr5daS97hNJZCntHBplzaE5UaNtlmKtvtPqsbilBeiNbQyLg1K8DNjarPMTbbvvXNg1tHjlcr/tGLhn/j+ul0OyqMlINQCdEcfBimZSdJY7aEaN8msRurj5ijlREppp3smoyc/fLE+UBhNeuqT6XGhaBy0DcF/DVo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-5f2c51478e5so904638eaf.1 for ; Tue, 10 Dec 2024 17:20:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880008; x=1734484808; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y62PD/q4WifdsD9DWO73O3hL33oH6LRMI1tKvJMAWf0=; b=Z97JtWrRjIlKItMB6IeSktDKhBbETmoJHLWlHfQpDQ9hL+V/fy7o3v2+lYdaJDqhDD 90bCYTJ3ND0UyUnguzx6/j5tFcuLRPd8I3+o9GAOCejBpm0f3J1+fnG3ujm0cZwp2KML 0ZWE3fDkHgvF9Nqotz4FkWBrAbc3O5sDQN067iE6J1kmuBLpTNSRRfkwpxkNg9HFQ4tG Tn3KPhRwnOYCHi+8E9brvnfVET6RT/eL40NJnkO6QqpHtwfeqIzMWJZEMFNnKBzyl73V BCFFpi7FzlVEd2foq5ZQz+fBftLDttZiIEE1jgmetUML0TwC3LN09DCb+7HRyWQDJgwj Zpew== X-Forwarded-Encrypted: i=1; AJvYcCXu9KFqwGuPLXQ6oNzTBuIwrIMxe3j5onxoW6RYj7f9cULAbgD9iryuHLtEi37o4ezkgDTu6WWk755rPrLwlA==@vger.kernel.org X-Gm-Message-State: AOJu0YxNxNcnqmLwIKsFoiiicpqeBLzlRQcXlmPrdfUnI3VctuL8oqKL n8nLuF5HhGrAc5kgFG2lT8OUjHTSrVFVvR2E5+KqPBIETWgK25cR X-Gm-Gg: ASbGnct1Tbm68e573+8GSDZXo01cQL9I0rQwXZ2w1fObKrdpICAiEzUAmMHMQtGhkQB Sgq8nWATPrvHXTG4A4err5d4/ST4ZWLWBLmko1kCUok3Se7x7nB99lHkx/5GxbDQfS5v+qQSyCC 0aO19KTaMN900Uw8vb5Gnf2d0kGMRIyNSoFN4vz3yoOW1e00Rb67XRJ3LEc1zJP5rTcWpm712K8 vcXxEnIqdYOkf9cSSSJTCtkbKpw1lyt0dzjjtnVswdTiKGPF9hTvd+eLcKtOq/dshzyXRk= X-Google-Smtp-Source: AGHT+IHi2n0Oe10OpBcmMYum3qtEL9tyj3CRay7lN1GLs50XcirrOBt7LFdX+aDJKqzt8/dNOU+ccQ== X-Received: by 2002:a05:6870:168f:b0:29e:2d50:11aa with SMTP id 586e51a60fabf-2a012c1ddaemr707724fac.18.1733880008569; Tue, 10 Dec 2024 17:20:08 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:08 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 09/17] wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO Date: Tue, 10 Dec 2024 17:19:18 -0800 Message-Id: <20241211011926.5002-9-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Enhance mt7925_mac_link_sta_add to support MLO. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 93e00a3840fe..9e9f33b6a1bb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -878,9 +878,14 @@ static int mt7925_mac_link_sta_add(struct mt76_dev *mdev, link_conf = mt792x_vif_to_bss_conf(vif, link_id); /* should update bss info before STA add */ - if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls) - mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, - link_conf, link_sta, false); + if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls) { + if (ieee80211_vif_is_mld(vif)) + mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, + link_conf, link_sta, link_sta != mlink->pri_link); + else + mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, + link_conf, link_sta, false); + } if (ieee80211_vif_is_mld(vif) && link_sta == mlink->pri_link) { From patchwork Wed Dec 11 01:19:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849716 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169D62451D0 for ; Wed, 11 Dec 2024 01:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880014; cv=none; b=O14aNSkTab2rKr02vVtkbwWvI19CjBOhQqW9kbWz6YXoqBr3vz6vgY+iKX2dKT6lOuGZQQNUIXlU3N6+5bYG5JArN5xrauhikUcj4f/m/ytUxe+GZH8DGzL1qBWIJxxS7/wM7H5o4I35diKeRa8GO3muIpvTJYzPjOYiHxHUH2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880014; c=relaxed/simple; bh=Yx9QfPZWzD/XAaCOS2MRiAaAKnxA7XL5d9w+SWB7iwE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JOXnOa5SWOLfiVHtXPKYMHzXrthyu0d54H6NOTtd4P/FZQ1HEnnbavKtHTep6ObAea/qkNz5v11n28V7nq1v//2nYxQguzCRp9QNDQEi1LYFbXhVV1/nq3rO3iAl9XmTyIp5vX8RnENJjszt4bpTRDHO6fOlwm5snhN6jvCgszg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-29e7516ee77so3236835fac.1 for ; Tue, 10 Dec 2024 17:20:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880012; x=1734484812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FV6wsq5yojUFiUHKK/2cJBWsk228RylpQzgVFP9hkUI=; b=ZKZUn8nsdbFZk/lyzQJe5GORxd0LZJJ0xHTJ1NfWgUHER0z44gQB7k1mUWRlPC7sht z8+ylAszOBMyL1Rzu/e7I373XSI3JmwDSldehkei8ZUuo8738iQ7e1JF0Qn+ICunSZyF PlXotIHvYeGPFnpLXOVXzREwLaq+MiYSbJ4XcgFnIIxPQQMSJ3iiIEMh1hcukvKHT3eA F7m4Z0Hux6Z4Hni5JQmzdeKsu3ncHAEAf+T2dPwPFV/M1oKCwPcdlVfHz0ETtix6idZ9 XX53kHedFovFrH0XldF+LQfPZ6YyDJk0hvergyH1OU5XL6XQfczmjVRYFqRKKgXGdThP XA7w== X-Forwarded-Encrypted: i=1; AJvYcCU8xB5Dgq0gcStPNTDhE7dV+Hy4WTDAtyjPYXKFaS/o2SFQyEQP3xnJH3dRGMOFXSn3smks2n6HGUXVX+5k3Q==@vger.kernel.org X-Gm-Message-State: AOJu0Yw9c8JEPsENfUexxwXjImTPsWVQ5GLYSJENf1NjoXGqOuw076qd 2zo7WqJ5XCcFJAOwcXQCtDy34aw7uQA9K7tTxCfwOltF2mBJSpSV X-Gm-Gg: ASbGnctRPE+sULer2kOf6krar5MUFR2y9U1UWRFC+TE9Oii7Ui7Vm+lolH3FqpVZZuu DQdHbBc2dad4uw0578zcSnLkCV4hyh5KBBjfbOnpwoN6bVwm/PynTEPQbuJIUbrJ6JNZ/+g58bw Py2QcuA1GdOFcwJXQLVrozN/tolU5bvExCmyPdTrWSMgbTtZiZR/P+qSsl0BmW+CDqCJIxfZLq8 6sWQt79uRiyqQrbx31h6hAu1TgXD+9N6WW9s/7+w8NMBKcE4Tzhpk5JAID4nkA1dSpCx8o= X-Google-Smtp-Source: AGHT+IGqlBfpoRHgY6cQ59RfOO97L29fROSkxpXSP4o/y0JiWpNvhu6DePzNcIePlys5f39S81NDGg== X-Received: by 2002:a05:6871:e48d:b0:29f:de75:d178 with SMTP id 586e51a60fabf-2a012c541d7mr747405fac.19.1733880012250; Tue, 10 Dec 2024 17:20:12 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:10 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 10/17] wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state Date: Tue, 10 Dec 2024 17:19:19 -0800 Message-Id: <20241211011926.5002-10-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt7925_mcu_sta_update for broadcast (BC) in the ASSOC state. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index d0bfc7711a80..a0df9a4c4b23 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1905,7 +1905,11 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev, mlink = mt792x_sta_to_link(msta, link_sta->link_id); } info.wcid = link_sta ? &mlink->wcid : &mvif->sta.deflink.wcid; - info.newly = link_sta ? state != MT76_STA_INFO_STATE_ASSOC : true; + + if (link_sta) + info.newly = state != MT76_STA_INFO_STATE_ASSOC; + else + info.newly = state == MT76_STA_INFO_STATE_ASSOC ? false : true; if (ieee80211_vif_is_mld(vif)) err = mt7925_mcu_mlo_sta_cmd(&dev->mphy, &info); From patchwork Wed Dec 11 01:19:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850053 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D0297346F for ; Wed, 11 Dec 2024 01:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880018; cv=none; b=CbEHoqkP4c9nw0zJ35IQyrcBOtbkdSvQcfH+wLdgpVMbkPztkaOm9uW/tl6fHMYZewc9AsEfZWctB0tht4wzzLx+45ANflNoXFmUWvrJRlQ+NgeZ5Vf+ZUFTh5ULVLq0fZc19LkcutBuMzXtYHzn44yRYWDuuRjgQYnnRrEACpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880018; c=relaxed/simple; bh=K7T++v3suEkb231OyqJeS1Imd0nNRqHTNNjdhpQ3Hi0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iz9v4sI3uhCgzHBjDYWGNV7YSJo92bf7g3tuYDg3GlMSdR/9FwJjXgQPZ+yM83gcicUBRPuS0quDEenoYqfAAp2N0G1NFLB+8xDmkIU9PlH68xq1UK6xQa7Gaq7+mCeJLuhMPyc8OD+F0zY8Zs2gSxAEsyS15El2N4IN+xpr1Ac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5f2bdbca73cso700044eaf.2 for ; Tue, 10 Dec 2024 17:20:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880015; x=1734484815; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BdfYkugeufvaD6bBwr+fMjYhLzDCWCLOV5qz0sJPubA=; b=rzhsjhKi3KY5PXTcuXpePUCPi16wqN+9Hf7opv2joUalJLrIaJooKttpxNGE6mEpBb FBhAGMiT8Ywh7NA+bN/xzEXhtIokd3pddRXlskX35m4X+uELJTugxslSfbBOD3b2Afgt md+CZCpj6kWLlDR9XFDGaT2jChRTyPxKKblcfYzITD3OcQ7u8BXPIhdBUxHcu+W5QWdA ejpLpqxxLj4vQBEXQQjBQHI3+BB3SvOqWxgs1Ci5X8dgrqZnp6c+FWdjjDfBIA+FFpBO yZTYA7ozQ+IslzKuNE4JxvDVH39qj7lkCPGh+aiTrSNxYt4szbPpJTWgX3KFIXb2hkSk eMPA== X-Forwarded-Encrypted: i=1; AJvYcCVKnwsR+antaUBZxjh7B5EKqu5RRLI7Z2Syr9+PavQ6fD6KF8sVvE6ilVYsx6ukujgWOuUkh8Zmp/e3zC/jFA==@vger.kernel.org X-Gm-Message-State: AOJu0Yz3OigZDoI+oEkEazpTtPIE9ZINOkRb6COwFmH7VOhIjuXYpCC9 B0Ii/vgAe5up/7CpfU8ZQIbMhqt0tRQRrJBYVqv3kTpC37enfECRyvW4wxVyq0g= X-Gm-Gg: ASbGncvinxQ5V63yxl65kNmXN9RpRg4i/8VSBsvksxsihOuFdfcgqZC8NvUh5yfl5HO cJgTxFjTrn41H2NoToOxJdiJlcQ+0KNshJJmtoNk81139G4gyv73+V5baIz0eAdXg2CYKOEQdEc dYAcrRDo48YVcaCxuBD66FjhbD2/gK5LY7q5toaO6k7eNNPCJ0n8Ng6m9CnFPR2zpWdCjDIGkPU xJC82pYjAi+pOKEBa4UeRkmCLLSeI142tamfp3qpZhLGVXPIHPfImdWq1H9f+R1yP95Z6I= X-Google-Smtp-Source: AGHT+IFsi/N15YrTJAV4K2mZ/2RhdEDq73CVQz1/8jVmt+l1w+60W75u2y3clZ11ZP1IRXt4WmmcCA== X-Received: by 2002:a05:6870:470e:b0:29e:49b3:c50e with SMTP id 586e51a60fabf-2a012c1ffe5mr693962fac.13.1733880015653; Tue, 10 Dec 2024 17:20:15 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:14 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 11/17] wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA Date: Tue, 10 Dec 2024 17:19:20 -0800 Message-Id: <20241211011926.5002-11-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt792x_rx_get_wcid to support per-link STA. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt792x_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c index 106273935b26..05978d9c7b91 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c @@ -153,7 +153,7 @@ struct mt76_wcid *mt792x_rx_get_wcid(struct mt792x_dev *dev, u16 idx, return NULL; link = container_of(wcid, struct mt792x_link_sta, wcid); - sta = container_of(link, struct mt792x_sta, deflink); + sta = link->sta; if (!sta->vif) return NULL; From patchwork Wed Dec 11 01:19:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849715 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06D0013A265 for ; Wed, 11 Dec 2024 01:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880021; cv=none; b=s14p6fab/D9Oqd2IZcgfoDCYozvhlR+c3YTLDv3y7JoOnhNYTcl69Q7vf3ZJ3GOGLdy8CtThJOfawqOH2UW8kVycZCQbFqHX3I4qngGghaNn3ObG7VGGCo3JtvAPqc9JJtjO3arU2p5QsbMd5b3Tx9ovTXCOT0TNkgPzpumlvok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880021; c=relaxed/simple; bh=lyaVV3yCnlMBmjN18jgHBsblzu4gFx3AJCNAUUj80ms=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OMmzKoCzG64mEO4fYCGDbXN7uq22KhBvSxZQLCigXs1rL+yAhv04EivRkr/UoIA3BEyZM/ipf2RVUGtVciLdmW5FyAMjvKgXkM/l8zuESH/dDBTl8ccum76l2MOkuZih8zQDw/ckiOCaxQCdvxoAgJN02zTN+3QgDb+0dz3zDMM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3eb7934a948so428247b6e.2 for ; Tue, 10 Dec 2024 17:20:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880019; x=1734484819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YvLYpyR5eCI3+Y1o7ii3SvRbYIqhS4yWBFBtNSrsqIo=; b=FkKO+Of84UEhQDPFVnc6VQpZsBv1V6XWM6/xg/VgFRgVl5Sw2Hsxmqvpy54qxDKXWt SmSjaLHbllvzUbzNMZ08s9lT+kzGJ6aclp3NYRys3LDQic+87qEpmyI/wVPEkd/Uq5yj cm0sjBurRNDMo79hzNhe5QZqcvc/p7jB1td8LmVZwhi9/uQv1PTMl9+vEJCfcH5G8Vco fIVlnI2pWExMwDdks++ci4FcYSkDtfV9BoQq+NqqJ6wuQSSO3t8pVrwr3aPxf/fSK6zu qktHRGJ6DKf8oUFQxPWkdwxyGAtoN4a5uZti34MRVC8qEsOonxrcXAJFAxDAtjlOsYb6 tEKw== X-Forwarded-Encrypted: i=1; AJvYcCXjzizRg2dxZzEVpPHmX3PydOCdQK9NSMgEf+bdbboL7LFwaU1eAuwGyMTF5RyNwQWRTWChpIFmgn8Ko4LV1g==@vger.kernel.org X-Gm-Message-State: AOJu0YzT+WsLResjv56Ive63vjd9HfJOPqEyzTxqF1NY66WGWtu388ac 9b3qT661CZMLoXeF6TrWWWPfJe2sBvoI+2lQ4ZaWANTi2kdqpq+sz67j5hS8+ck= X-Gm-Gg: ASbGncsgCGAH4x6RrXtLft4shfGkpz0WB7zSc74UV06CZ/7lxen2apFIRwIJ/AlYYNw gvec7K0BkOmX27wXYsOwbmmS4FGrWJkurFIemlKJ9GcTyJLNdhZl1j8TzWZ5bUaOmSL1lWjtRKV bLKADdsEi/ffKL3uR3bvKKcTyd934g6cWnDuDZ5vpttNr1WmJZD+KuCD9z3YiC3qHXpDR+ZdkYX xcsmKDKaQu3zEGRSIe78MjC0YYb/gUiIoTL2Qsb7OPhX0pnL7uojZfX8kg1T4e+wYjRpf8= X-Google-Smtp-Source: AGHT+IFvjvpgdG+j02OXVpvjD6zMw/zx1NdUsngbozfn/+B6x1XAX1y4CJhegoGRL3gvUB+sxUc79Q== X-Received: by 2002:a05:6870:55d2:b0:287:4904:7125 with SMTP id 586e51a60fabf-2a012db0fd6mr678464fac.14.1733880019143; Tue, 10 Dec 2024 17:20:19 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:17 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 12/17] wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS Date: Tue, 10 Dec 2024 17:19:21 -0800 Message-Id: <20241211011926.5002-12-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt7925_unassign_vif_chanctx to support per-link BSS. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 9e9f33b6a1bb..615d7a370923 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -2090,7 +2090,7 @@ static void mt7925_unassign_vif_chanctx(struct ieee80211_hw *hw, if (vif->type == NL80211_IFTYPE_STATION && mconf == &mvif->bss_conf) - mt7925_mcu_add_bss_info(&dev->phy, NULL, pri_link_conf, + mt7925_mcu_add_bss_info(&dev->phy, NULL, link_conf, NULL, false); } else { mconf = &mvif->bss_conf; From patchwork Wed Dec 11 01:19:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850052 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371A8165F09 for ; Wed, 11 Dec 2024 01:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880025; cv=none; b=GrXl2AaXhnBfDO8V28fxuLKUoceXDjCVT98m+26Gg9phqPowGRFN1cPQQ3ZqT/xA5tBNGlDF8MaSOv5fFSi3sUbpf/fHjNQsH8+Jz5ADmTfPHAU8HD/sKLa9fr3v4mmBGbmbMNiEGoh3U64apBI73L4TcYoWM2kDuPVFyM0ky3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880025; c=relaxed/simple; bh=Q9NuamWIHQaMMhtnyyZGanAuEP8JOay1FCovdsjIYOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Mbc3CRau9qwKxFaN+TXs9ipa4VmylRm/DnqKi96lVRCNUUbaTehZq3lJZmXZ/K5ipiFZHRF1KdeOr2C2NQUNkGCc15qOSL/SWMvueKogoDyv/swz/QiRTLITBINFGIlCeGJ8vwdE/G96YTUTc4Sa+d4/rha5o2ud37aidGFAPdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-71e157a79c8so236886a34.2 for ; Tue, 10 Dec 2024 17:20:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880023; x=1734484823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tRF9ugiz33htRxpTQb5KpK3OS4duLbF4MKOYzIA9S2Y=; b=aGn3TaCTx+UuqJzL1c8wy0BWPxHmhLouYOqoh33uc8gqD3pn4wskbmehZ47s4CQjW4 modc3WUcrthi3+G9QFkMwJlXvvBMnsJ7bB+ExfbqdfD2NHh4SlU69GwX+E+6bGg1d4Mh qrzEEe7b0tH5RhgizYHrrePf+cqVhNF6JsFRvYY1IlSH1W2N6LIiBlyeBWaDcMLBUPXo yw9DptNa+DVKQh3XJ3bAHTLP12kNL5KZFfsizNPFdJyOJqii9lOsGZnb/MHGFgBfrJBB ib2hX3BWQRoGQmjeL4q3HuiqpuZ3dZ4IHYy/+QlvfmyWlQl14evFF20Ojejm0ZzKNNg1 ZhkQ== X-Forwarded-Encrypted: i=1; AJvYcCUIUsBegWs/6XZc5C/Qj1hgVPrenvhgRcMPMQmLGK3I83EpA2MQonKX3rBFRpm2X8lCYk2Ku2Bmup/34oi/1g==@vger.kernel.org X-Gm-Message-State: AOJu0YypaXok1ZPw7ik+2QAKsyA5SvRR1WzIP67Z0zXg99Yi8tOSr4Ky wUmogCxScRyWsKDqB9JpKQuDXc5ziMgTTxtcBFvXiuB68LlsPs2a X-Gm-Gg: ASbGncv07LN0+b9RsCmUBsd6ph9aFcUv5fdaNi74FbxbVUdTzc5tC872ZNELyF9A3a4 6eG86NwTNg5ofMqzTUjVGU0rzVlLZplkL2p3aOPi+yxO/GDwg81Zl9fYHli0faOTUB3d7lL/f1a +z7jRbIp1vZhYSNzN48028LV4FJQqLT2qJ57PFqI3w2vRhWWZVcpXBrVZJ/gmU/kM7IE3RFvslf TZeTF/LHLi8x7qlcJbVo1dve9J07V4pG3MqWGgEB8v7+PbwvyZMA+cIO6H2QPTdJnMsO8I= X-Google-Smtp-Source: AGHT+IE1TVNPZ38uP/IvTR3MzgVFIX09y+QeA5AuUwqpjwg/ND5Ay0/c4177SuRviRkvgjmcxh8OFg== X-Received: by 2002:a05:6870:470e:b0:29e:49b3:c50e with SMTP id 586e51a60fabf-2a012c1ffe5mr694106fac.13.1733880023388; Tue, 10 Dec 2024 17:20:23 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:21 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 13/17] wifi: mt76: mt7925: Update secondary link PS flow Date: Tue, 10 Dec 2024 17:19:22 -0800 Message-Id: <20241211011926.5002-13-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update the power-saving flow for secondary links. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/main.c | 7 ++++++ .../net/wireless/mediatek/mt76/mt7925/mcu.c | 25 ++++++------------- .../net/wireless/mediatek/mt76/mt7925/mcu.h | 3 +++ drivers/net/wireless/mediatek/mt76/mt792x.h | 7 ++++-- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 615d7a370923..f2a0159be9c1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1903,6 +1903,13 @@ static void mt7925_link_info_changed(struct ieee80211_hw *hw, if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED)) mt7925_mcu_set_tx(dev, info); + if (changed & BSS_CHANGED_BSSID) { + if (ieee80211_vif_is_mld(vif) && + hweight16(mvif->valid_links) == 2) + /* Indicate the secondary setup done */ + mt7925_mcu_uni_bss_bcnft(dev, info, true); + } + mt792x_mutex_release(dev); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index a0df9a4c4b23..9fafb7cce356 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1364,7 +1364,7 @@ int mt7925_mcu_uni_bss_ps(struct mt792x_dev *dev, &ps_req, sizeof(ps_req), true); } -static int +int mt7925_mcu_uni_bss_bcnft(struct mt792x_dev *dev, struct ieee80211_bss_conf *link_conf, bool enable) { @@ -1925,32 +1925,21 @@ int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev, { #define MT7925_FIF_BIT_CLR BIT(1) #define MT7925_FIF_BIT_SET BIT(0) - struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; - unsigned long valid = ieee80211_vif_is_mld(vif) ? - mvif->valid_links : BIT(0); - struct ieee80211_bss_conf *bss_conf; int err = 0; - int i; if (enable) { - for_each_set_bit(i, &valid, IEEE80211_MLD_MAX_NUM_LINKS) { - bss_conf = mt792x_vif_to_bss_conf(vif, i); - err = mt7925_mcu_uni_bss_bcnft(dev, bss_conf, true); - if (err < 0) - return err; - } + err = mt7925_mcu_uni_bss_bcnft(dev, &vif->bss_conf, true); + if (err < 0) + return err; return mt7925_mcu_set_rxfilter(dev, 0, MT7925_FIF_BIT_SET, MT_WF_RFCR_DROP_OTHER_BEACON); } - for_each_set_bit(i, &valid, IEEE80211_MLD_MAX_NUM_LINKS) { - bss_conf = mt792x_vif_to_bss_conf(vif, i); - err = mt7925_mcu_set_bss_pm(dev, bss_conf, false); - if (err) - return err; - } + err = mt7925_mcu_set_bss_pm(dev, &vif->bss_conf, false); + if (err < 0) + return err; return mt7925_mcu_set_rxfilter(dev, 0, MT7925_FIF_BIT_CLR, diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h index ac53bdc99332..31bb8ed2ec51 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h @@ -643,4 +643,7 @@ int mt7925_mcu_set_chctx(struct mt76_phy *phy, struct mt76_vif *mvif, int mt7925_mcu_set_rate_txpower(struct mt76_phy *phy); int mt7925_mcu_update_arp_filter(struct mt76_dev *dev, struct ieee80211_bss_conf *link_conf); +int +mt7925_mcu_uni_bss_bcnft(struct mt792x_dev *dev, + struct ieee80211_bss_conf *link_conf, bool enable); #endif diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h index ab12616ec2b8..2b8b9b2977f7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x.h +++ b/drivers/net/wireless/mediatek/mt76/mt792x.h @@ -241,6 +241,7 @@ static inline struct mt792x_bss_conf * mt792x_vif_to_link(struct mt792x_vif *mvif, u8 link_id) { struct ieee80211_vif *vif; + struct mt792x_bss_conf *bss_conf; vif = container_of((void *)mvif, struct ieee80211_vif, drv_priv); @@ -248,8 +249,10 @@ mt792x_vif_to_link(struct mt792x_vif *mvif, u8 link_id) link_id >= IEEE80211_LINK_UNSPECIFIED) return &mvif->bss_conf; - return rcu_dereference_protected(mvif->link_conf[link_id], - lockdep_is_held(&mvif->phy->dev->mt76.mutex)); + bss_conf = rcu_dereference_protected(mvif->link_conf[link_id], + lockdep_is_held(&mvif->phy->dev->mt76.mutex)); + + return bss_conf ? bss_conf : &mvif->bss_conf; } static inline struct mt792x_link_sta * From patchwork Wed Dec 11 01:19:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849714 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF0F6175D29 for ; Wed, 11 Dec 2024 01:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880028; cv=none; b=DA0ePB+Zeu0oIwOk6uenUxGLps+BKPsopK2mZyFKL8gFLfRwb3e3HjDY2iIrewqo7uDY7lbQuBBBNlnWY71D0KwEm+mJG86BKgLzhdqJLRWALeXeDvANXMRpSRVcU+8mzt+lRDJAnz8O2Sr3XykQFAIegHeGDmzob1PuAqx+TCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880028; c=relaxed/simple; bh=oAQXu85edx6ZFlDR0EZowb7+o9vXF2s/tU27/RQ9VFM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fip43cTFYpR8m2jJFOBuGtG6VH8aGfQ19c9qvk32A6J1EJ9Dp46q/tAfqkKcDmq5Q3uS69tJjp4+Gk0KSrANKBGiHMdILR7IE5ZesIx5/KZGSRSK0IPVqrJRal7jDExaEBXp1MMvIy/FyJgCS45mX8lb522uG/1522WOJJexuKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3eb569ec0d9so793608b6e.1 for ; Tue, 10 Dec 2024 17:20:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880026; x=1734484826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4sCOLPelO32qVuyU8xDyaBPcPYTcYPDXfN9EW5NAA6Y=; b=fDv2KJU88uYaXvoiI306aBZcNAad1DhWKOwoxJZb7LRcFanD0U5n/6R5SfFfq3VolO 16ihc+fmOPlRpYGancsU4vmxAY8TmjQVH3AGQSpwg7VcWkg53GqVF/EQJvCa8vBLL8Vi ZQt4hGO02jCUcWGNGXoUOZ1B72E+IxMopJkyx1qE0XxUQe7/Rl7g4QdmLnOAgL06gT8G VwjECsTBFKUmzZRtMtwWE66TXUJ2fAFpVECTVZVx988DlxKV2hFsvJYZrs3u+0t1C4y1 FEyPaTjkeZBca450w1jp0xRuACJc1cBLReGL1zNZ0mXJNDmi6y+Eu+Zq7yHLz9ZnAXFf +5WQ== X-Forwarded-Encrypted: i=1; AJvYcCXsCWQp9ZYeZYC7bI+Sb5+MgPuqG9ImM7xTVnEKHjyUIsNmyD8n2FZImBV1wS5UQ8rS7+1Ri+PlzS0tYdhu1A==@vger.kernel.org X-Gm-Message-State: AOJu0Yx4yRCV/MmdkR4hHLGt2XCKiyCFsbNKUEi9do1Tb4kaaS/zQaDd M80V08xt8Chh7VcLmokaskPMbVqhcZBNWtJJ73jwlJ03rAebTyAH X-Gm-Gg: ASbGncsTi03SJfoekflmrP1U47UP6tQ3hS+hmbuhgJQXA+ojqYQNINmnAR8N7J8F5Aw 6LRW/txMHJtbhvjyXhkThGUIFXvZNO+gp0a8UeCnNOxGqjrVoeyGjw7lXJSva+zr9O01jxbyRzK MKVRY/ZK/oDP4+Dc+d6ROiWCv1GMEUIs00mby6hUTMUmvOf6O0ysOEIcAfgQr5s33yMSQJamFWT +5RpMMBJwFF6vJBqo5B8ZLD+JKcC3OW98VG83wZGET+o3VjUNqMungcipCuuzL9tBV+OM4= X-Google-Smtp-Source: AGHT+IG8GhzuwchpKQMFJgrUxyXInhFmPd8FCXfE2Y/ubZ3c+ERwZS6Wcs+IRVz6tFSwIZGIH1lR/Q== X-Received: by 2002:a05:6871:821:b0:29e:3132:5897 with SMTP id 586e51a60fabf-2a012d35af8mr656068fac.5.1733880026039; Tue, 10 Dec 2024 17:20:26 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:25 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 14/17] wifi: mt76: mt7925: Init secondary link PM state Date: Tue, 10 Dec 2024 17:19:23 -0800 Message-Id: <20241211011926.5002-14-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Initialize secondary link PM state. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index f2a0159be9c1..6b2b91a0475e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1989,6 +1989,8 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto free; if (mconf != &mvif->bss_conf) { + mt7925_mcu_set_bss_pm(dev, link_conf, true); + err = mt7925_set_mlo_roc(phy, &mvif->bss_conf, vif->active_links); if (err < 0) From patchwork Wed Dec 11 01:19:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850051 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4414F9EC for ; Wed, 11 Dec 2024 01:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880032; cv=none; b=G/XCTgs3/wWj5/H6dkztvGXJ1yLgtscsodYdcjqWkMa0WEs6JHz4+avpQgTa4Q6vTcx5SidQ35uK0EkXUlel7nPFqhQSKDn4RGVlHsD6MVioz4UeyLUtnkp/18+dQzpzjswzOyttVPd8X6CiZkxceRZAMK4Pkw8GHW4cvSzWBBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880032; c=relaxed/simple; bh=MgyreksPsqCeG9MiEK0kcGpdCeFXecM94xNCH5PbR8o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Onfm7UHVIy2SYZYxzYpr3telzryBosE1OpTi3ETh0kwflGHgK4ggyTUwdCaiivbwpa+m6RetywEys4RK3rG7cK9SOyodra+qR2n6SwN+8hHKSYXDN7bcjgA2FxZTDf7tsFP8h0ChtlM5IkLXzZiswBQfPnV9rb3Yhp/Jp7y6GOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3eb3c143727so106192b6e.1 for ; Tue, 10 Dec 2024 17:20:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880030; x=1734484830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MR5d/wysEF0Kf7ZmoLEbw9RGTdi/T9opkbjQB4jDM80=; b=XSuoL1ry8YiKhimEPKmu2MsPwV1xEhWXafWPYsmtlRgj93dY1weKXJmdqSlrwVTTCT YwcYCH3Uo194MjdGMcWSKL7SbeuSPs1ZViViFxQ8/qFYuUmGEVU6OGefM0g9goKdG67L ofvQ1RgUoPY+dV5mTPcgkl73De6LzVNE5CPpXp6F6OqQEnObuoCbLW4bN9+EFAAV3uzx 2f5qwujifBbjEyAlfFSe/sDQEBFPyongYP154zEpdE8bn5smem4C4Rll7F5jUU4FR2bq 5gB31mkfhQQlL9hc6trGN15HsxuZZ4EUe7EkIY83VbefMn+LCmMwy1GY4qu04jpJVtxn uH6w== X-Forwarded-Encrypted: i=1; AJvYcCWei8ixmRrEfQ/q7zAtHpyuq0jl2Ds0qjKZwCm1lNaYrvkDNurks/h52Wn2GROYYWBEhXfTdzYPoLEB3IVs1A==@vger.kernel.org X-Gm-Message-State: AOJu0YxcI2TotmUY5v+XmaqcvcTBf9HTw+z42/LK/m5RacCgQlZjvM82 69QC2jGKmWLMNcjBVBPkviEYXXegU18e4OedsqTjUDQpdJowsrfe X-Gm-Gg: ASbGnctdDxfE3icz3b4Cr6uu/PdwOlL+ym1gKIKA5h+NxPt9TbS80xtXSVzC5NRPsif msJXjvR8uq8W9zhbZuFFgsoK6JPzbXGOM6en9CLV7E5GIISxA1iSmyiiwd6fJ4uwsUCmdVXSdow jTXsOc3qfqbGWHS4gEpdXFTSn5pAI9L7gHotss3etGmm5lCSBoBhbbcu55LFx4+QHO0QXtXtnFo 2teDc2tk0mpMEtrXsystimjNTQpjClc6m9F5K/m4A4XZanZEhHbkbPwpf204hmneDxNznY= X-Google-Smtp-Source: AGHT+IEOqF5pb1wUGU1VDty28sTsMA6yF3gA7xTiIBtgG0SjYjInlv2zCwobaX0GRnv9XZ04592Gfg== X-Received: by 2002:a05:6871:58b:b0:29e:2a06:8405 with SMTP id 586e51a60fabf-2a0155a6f54mr463201fac.19.1733880029797; Tue, 10 Dec 2024 17:20:29 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:28 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 15/17] wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO Date: Tue, 10 Dec 2024 17:19:24 -0800 Message-Id: <20241211011926.5002-15-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt7925_mcu_uni_[tx,rx]_ba for MLO support in firmware. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/main.c | 10 ++-- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 50 +++++++++++++++---- .../wireless/mediatek/mt76/mt7925/mt7925.h | 2 + 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 6b2b91a0475e..da7a2a798545 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1258,22 +1258,22 @@ mt7925_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, case IEEE80211_AMPDU_RX_START: mt76_rx_aggr_start(&dev->mt76, &msta->deflink.wcid, tid, ssn, params->buf_size); - mt7925_mcu_uni_rx_ba(dev, params, true); + mt7925_mcu_uni_rx_ba(dev, vif, params, true); break; case IEEE80211_AMPDU_RX_STOP: mt76_rx_aggr_stop(&dev->mt76, &msta->deflink.wcid, tid); - mt7925_mcu_uni_rx_ba(dev, params, false); + mt7925_mcu_uni_rx_ba(dev, vif, params, false); break; case IEEE80211_AMPDU_TX_OPERATIONAL: mtxq->aggr = true; mtxq->send_bar = false; - mt7925_mcu_uni_tx_ba(dev, params, true); + mt7925_mcu_uni_tx_ba(dev, vif, params, true); break; case IEEE80211_AMPDU_TX_STOP_FLUSH: case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: mtxq->aggr = false; clear_bit(tid, &msta->deflink.wcid.ampdu_state); - mt7925_mcu_uni_tx_ba(dev, params, false); + mt7925_mcu_uni_tx_ba(dev, vif, params, false); break; case IEEE80211_AMPDU_TX_START: set_bit(tid, &msta->deflink.wcid.ampdu_state); @@ -1282,7 +1282,7 @@ mt7925_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, case IEEE80211_AMPDU_TX_STOP_CONT: mtxq->aggr = false; clear_bit(tid, &msta->deflink.wcid.ampdu_state); - mt7925_mcu_uni_tx_ba(dev, params, false); + mt7925_mcu_uni_tx_ba(dev, vif, params, false); ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); break; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 9fafb7cce356..551b1827bb40 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -531,10 +531,10 @@ void mt7925_mcu_rx_event(struct mt792x_dev *dev, struct sk_buff *skb) static int mt7925_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif, + struct mt76_wcid *wcid, struct ieee80211_ampdu_params *params, bool enable, bool tx) { - struct mt76_wcid *wcid = (struct mt76_wcid *)params->sta->drv_priv; struct sta_rec_ba_uni *ba; struct sk_buff *skb; struct tlv *tlv; @@ -562,28 +562,60 @@ mt7925_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif, /** starec & wtbl **/ int mt7925_mcu_uni_tx_ba(struct mt792x_dev *dev, + struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params, bool enable) { struct mt792x_sta *msta = (struct mt792x_sta *)params->sta->drv_priv; - struct mt792x_vif *mvif = msta->vif; + struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; + struct mt792x_link_sta *mlink; + struct mt792x_bss_conf *mconf; + unsigned long usable_links = ieee80211_vif_usable_links(vif); + struct mt76_wcid *wcid; + u8 link_id, ret; - if (enable && !params->amsdu) - msta->deflink.wcid.amsdu = false; + for_each_set_bit(link_id, &usable_links, IEEE80211_MLD_MAX_NUM_LINKS) { + mconf = mt792x_vif_to_link(mvif, link_id); + mlink = mt792x_sta_to_link(msta, link_id); + wcid = &mlink->wcid; - return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params, - enable, true); + if (enable && !params->amsdu) + mlink->wcid.amsdu = false; + + ret = mt7925_mcu_sta_ba(&dev->mt76, &mconf->mt76, wcid, params, + enable, true); + if (ret < 0) + break; + } + + return ret; } int mt7925_mcu_uni_rx_ba(struct mt792x_dev *dev, + struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params, bool enable) { struct mt792x_sta *msta = (struct mt792x_sta *)params->sta->drv_priv; - struct mt792x_vif *mvif = msta->vif; + struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; + struct mt792x_link_sta *mlink; + struct mt792x_bss_conf *mconf; + unsigned long usable_links = ieee80211_vif_usable_links(vif); + struct mt76_wcid *wcid; + u8 link_id, ret; - return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params, - enable, false); + for_each_set_bit(link_id, &usable_links, IEEE80211_MLD_MAX_NUM_LINKS) { + mconf = mt792x_vif_to_link(mvif, link_id); + mlink = mt792x_sta_to_link(msta, link_id); + wcid = &mlink->wcid; + + ret = mt7925_mcu_sta_ba(&dev->mt76, &mconf->mt76, wcid, params, + enable, false); + if (ret < 0) + break; + } + + return ret; } static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h index f5c02e5f5066..df3c705d1cb3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h @@ -242,9 +242,11 @@ int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev, struct ieee80211_vif *vif, bool enable); int mt7925_mcu_uni_tx_ba(struct mt792x_dev *dev, + struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params, bool enable); int mt7925_mcu_uni_rx_ba(struct mt792x_dev *dev, + struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params, bool enable); void mt7925_scan_work(struct work_struct *work); From patchwork Wed Dec 11 01:19:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849713 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8382310A3E for ; Wed, 11 Dec 2024 01:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880036; cv=none; b=fOa8l1UXh+K05E9TA71Gl8PexlDvsIYgbzJzCaDSOgtbN00t1BHUgKHggYNmE3kwxGyY5iCVT0KHWGkfMilWbZKf2hr8LDK/JjrY80h/6IbmcCS04rplLIG4MWmkkZgWqzhzBZNThgPgoyqU7BIM/HMzalsJLKVp+r7CUMbrOFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880036; c=relaxed/simple; bh=Z5fxSJKp/mhKCgl0ICjjXv+timoPQ/BNep2XxOOZKV8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AETuf06CW3c6hj+uVkxSAdovFqm/kdntAAlMzc6shWraYULkHZBTBxL4Jqwn20snBOCMKVgKkhd3jC7dGtzfHvEiGdJ6eMVlqs/u1vVonJvJNolL64jWzrIPW7AO1lDQQOOSFqBq51DFzaaL+PDRRUeDDCkln7XiBpl+1wCfzAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-29737adb604so3134323fac.1 for ; Tue, 10 Dec 2024 17:20:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880033; x=1734484833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K1YpHXYbDA4VM1WpYLpyHXFxdUkmq+2IyIhunuoKdpQ=; b=doHHsCpysZgplCosULcu/8bBJO2XXzsj27g9rqYfn8dz8Dba4GyOyx/G4m2cryWKz3 IVVjPgmGjjg/VPGO8E/aMmx5FZnmEeu2wTBn+3J0fFhl2TL5NFgJpxgbXM1hIRPwuUEy p1xFU/GuhfN9JHaifoyCLoeazoT/W3h7qsh3MDYCvjbmEquFKUev1TbfIM8rO9Lfa6vm dS40vUde8zhUgvvL5LXP+0j+i2Pj7vpdpGjnqyw37MCw8OvwivBmDVHiy3N/IQw4aKks B1hrJtfAPYE9XoxI9nGCAU0VtZQ22v06ccUK02FEkKe1U4/M7MY2ooaBhvd39OlWGIj6 g76w== X-Forwarded-Encrypted: i=1; AJvYcCWWcn1+btuRFSQopOWOtFABUbt71P0TcIc91n4UQ1mjSbHx622DMF1TVq1Sdg1gyivqkqbURjCOu1ELfE5nYw==@vger.kernel.org X-Gm-Message-State: AOJu0YwAGeO38PXhDcLlbqgttpGiK/DEz8Cb0vqrmVAXgKIDii+uMJZs /xtxNAjeBJLwQAlypTaxkIgThrFvGkapRyiTjgGig6d4TGkXKwN3kXTbC3b5Tok= X-Gm-Gg: ASbGncvA1Gvm3u+g0SQEEF3biCLI6cjh+HJL4uurUx1olXJytyexGNXexFAi/157RiV BYOaLDVZJT4bCw/0W4MKTXhMwb/778teB8/ECazCzFWnRGcsXGytUqt2z7ZdZhJa1EBZ4vSYhQ5 sKQXqLjZ9C7+X86dubulhAL2lwuHwcJTZjcg8oBMtVpqzzgbtg8DuUoWHQtiGvwDlTWADB47tHr voGqQuIYChmfwOoe3b1S0jbL1xXLDLqcaBaqeobPq4FHWzM6/xBxUel/ucHA+fMM5I+vj4= X-Google-Smtp-Source: AGHT+IF0gUkHuRCaOh8UGDwrWZiHIizEzdf2Z5358lrfRXUW5B3uSGUMCpL6znNlITwq0TrtI1wC4w== X-Received: by 2002:a05:6871:430e:b0:27b:55af:ca2b with SMTP id 586e51a60fabf-2a012db1083mr711621fac.11.1733880033574; Tue, 10 Dec 2024 17:20:33 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:32 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 16/17] wifi: mt76: mt7925: Cleanup MLO settings post-disconnection Date: Tue, 10 Dec 2024 17:19:25 -0800 Message-Id: <20241211011926.5002-16-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Clean up MLO settings after disconnection. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/main.c | 37 ++++++++++++++++++- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 4 +- .../net/wireless/mediatek/mt76/mt7925/mcu.h | 2 +- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index da7a2a798545..9c43437ad9d0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1149,8 +1149,7 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev, struct mt792x_bss_conf *mconf; mconf = mt792x_link_conf_to_mconf(link_conf); - mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, link_conf, - link_sta, false); + mt792x_mac_link_bss_remove(dev, mconf, mlink); } spin_lock_bh(&mdev->sta_poll_lock); @@ -1208,12 +1207,46 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, { struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76); struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv; + struct { + struct { + u8 omac_idx; + u8 band_idx; + __le16 pad; + } __packed hdr; + struct req_tlv { + __le16 tag; + __le16 len; + u8 active; + u8 link_idx; /* hw link idx */ + u8 omac_addr[ETH_ALEN]; + } __packed tlv; + } dev_req = { + .hdr = { + .omac_idx = 0, + .band_idx = 0, + }, + .tlv = { + .tag = cpu_to_le16(DEV_INFO_ACTIVE), + .len = cpu_to_le16(sizeof(struct req_tlv)), + .active = true, + }, + }; unsigned long rem; rem = ieee80211_vif_is_mld(vif) ? msta->valid_links : BIT(0); mt7925_mac_sta_remove_links(dev, vif, sta, rem); + if (ieee80211_vif_is_mld(vif)) { + mt7925_mcu_set_dbdc(&dev->mphy, false); + + /* recovery omac address for the legacy interface */ + memcpy(dev_req.tlv.omac_addr, vif->addr, ETH_ALEN); + mt76_mcu_send_msg(mdev, MCU_UNI_CMD(DEV_INFO_UPDATE), + &dev_req, sizeof(dev_req), true); + + } + if (vif->type == NL80211_IFTYPE_STATION) { struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 551b1827bb40..6675492ec9a8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -2662,7 +2662,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy, MCU_UNI_CMD(BSS_INFO_UPDATE), true); } -int mt7925_mcu_set_dbdc(struct mt76_phy *phy) +int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable) { struct mt76_dev *mdev = phy->dev; @@ -2682,7 +2682,7 @@ int mt7925_mcu_set_dbdc(struct mt76_phy *phy) tlv = mt76_connac_mcu_add_tlv(skb, UNI_MBMC_SETTING, sizeof(*conf)); conf = (struct mbmc_conf_tlv *)tlv; - conf->mbmc_en = 1; + conf->mbmc_en = enable; conf->band = 0; /* unused */ err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SET_DBDC_PARMS), diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h index 31bb8ed2ec51..fe6a613ba008 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h @@ -616,7 +616,7 @@ mt7925_mcu_get_cipher(int cipher) } } -int mt7925_mcu_set_dbdc(struct mt76_phy *phy); +int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable); int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, struct ieee80211_scan_request *scan_req); int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy, From patchwork Wed Dec 11 01:19:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 850050 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F9C313D53B for ; Wed, 11 Dec 2024 01:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880039; cv=none; b=FGU5wn5/TiePfiCQ9tURxBS/5Tu51rd/a9RtlQRHBxcHvRC9BSLyx+8eBkxiXCDfGUPGhLjDohcrOPomlTsNoXmUA5s+cQn5AO47w/4E0/w2KooG7hMaY3mQz3g0aj+TpYbXhdifxYMcveHm0Ph7IAYQIb2h5OmxKYmc7tnCYYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880039; c=relaxed/simple; bh=i/7YKEfhnqsx7EnbYuqda2QMLpaARjtrHChfo81YCQg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IromVtsly+P4thvpX1pp9PtkvALKl5WxGLLm+wS1PWNc+Qg1qJKNl6BRqjvoHtNcsJ9Z1Fwho/JyQhrs/TVIyvuM+gchaenPUduzc1hHU2hExWGLfMD7wrrF9zmi8B4emH0fVxMuJ0m2QdsTm9ruBa/pYdnWlJAqeC3RD9XROdk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-29f87f1152cso2097144fac.2 for ; Tue, 10 Dec 2024 17:20:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880037; x=1734484837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zFt/APP9Kpg1SvU/nP3fnBmzPrWhuM3L++1qvEulSaE=; b=qfVWY22RR35tS9umzmI3NVyQk0JIfWvOf9ztdMkx07I1wM8R5P4cudjmE9nD8mD8/+ OVV/zM9P/Uf36aFHvav0RWfn7nJPqsThjLoPcy+W2819PhalwYoqouBMPe8ZTwgiXEfl wC6+XJpQN46Y50XEvPM3VcVmFaYHYrbEDim8y7pDvyeU8YZQaladu7fUueiBorsXa34D 3ipneKo6FL51e3JWcaNGGE46dZJGImagWAUdwpGf3PrSQY9LSh0gimm9Fwl69Sbia2vz pt+YwYxGMSPPJt0j2gK60ydfBE+i6NS1U9524v7ilU04sTbv75KU8r4XUHVxtRXVbD0y 4Owg== X-Forwarded-Encrypted: i=1; AJvYcCVQ3DcWvFNbkY+E4+nq1UdJwB0lKbfd3b2oWCH1Wg99sCwlijQY90TKFoS9qMRKI5FgVMwuPTe0PCg7RD8sxw==@vger.kernel.org X-Gm-Message-State: AOJu0YzyzJ1XiOlDIrH6DUIK3JyBODOrzi4QS7VCaEDKGIuIlefiMBOo yN/9VSL2SZe3hVnrhqsP3fZWZeaUUKvalO+ceXp9si0emlY2JfJg X-Gm-Gg: ASbGncsgaLhiRIGN6ft2KphDufl7nvs213xq895sRI6SOJN/rqqe6exZ7NxB9vvHmHJ mAea7LqyxiWiXC6LkgxFUiTFw3YGqBBCYgi/7T7eW1/1K5Epy51ftHdmEpD/XjHbfZ33ONgpRwX kftPM46Dt16qhEXEeGmLugUkPSXLucQyQAlL8x0SgNAdM4yH7/cGlU72x8t0rhfo6ucx1sNxWi8 TG/sjFuG+6poCLyfoUyGev94v9b42V5kqFWhuUneRWUWUJ6V5BtMmR2jzCYYgLXL1HkJ3M= X-Google-Smtp-Source: AGHT+IFoBvPxPXAn74OsI+gka8y3QPRiQn0R7SewMW5QIeQR3Ss8iag4UdWTxYEHJxMiuodqUSfPsQ== X-Received: by 2002:a05:6870:a105:b0:29e:65b3:27f5 with SMTP id 586e51a60fabf-2a012c5a94cmr735905fac.19.1733880037150; Tue, 10 Dec 2024 17:20:37 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:36 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 17/17] wifi: mt76: mt7925: Properly handle responses for commands with events Date: Tue, 10 Dec 2024 17:19:26 -0800 Message-Id: <20241211011926.5002-17-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Properly retrieve the response for commands with events. Ensure accurate handling of event-driven commands. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 1 - drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 9c43437ad9d0..13e07cecca41 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1244,7 +1244,6 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, memcpy(dev_req.tlv.omac_addr, vif->addr, ETH_ALEN); mt76_mcu_send_msg(mdev, MCU_UNI_CMD(DEV_INFO_UPDATE), &dev_req, sizeof(dev_req), true); - } if (vif->type == NL80211_IFTYPE_STATION) { diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 6675492ec9a8..0068ec6d92c3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1254,7 +1254,7 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links, } return mt76_mcu_send_msg(&mvif->phy->dev->mt76, MCU_UNI_CMD(ROC), - &req, sizeof(req), false); + &req, sizeof(req), true); } int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf, @@ -1303,7 +1303,7 @@ int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf, } return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(ROC), - &req, sizeof(req), false); + &req, sizeof(req), true); } int mt7925_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf, @@ -1333,7 +1333,7 @@ int mt7925_mcu_abort_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf, }; return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(ROC), - &req, sizeof(req), false); + &req, sizeof(req), true); } int mt7925_mcu_set_eeprom(struct mt792x_dev *dev) @@ -1486,12 +1486,12 @@ mt7925_mcu_set_bss_pm(struct mt792x_dev *dev, int err; err = mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(BSS_INFO_UPDATE), - &req1, sizeof(req1), false); + &req1, sizeof(req1), true); if (err < 0 || !enable) return err; return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(BSS_INFO_UPDATE), - &req, sizeof(req), false); + &req, sizeof(req), true); } static void