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: 13902713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FA03E7717F for ; Wed, 11 Dec 2024 01:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7R2p//Pqh9wUP2QmrJjZ02D5zzYfEnah5rmAeHm8NgI=; b=gSUkB5q13V6OXLinVnfpdH9+8c D0DVEIoR7F7SLoHHiGF5R3CQXR0HUprwP1ZMZKJODu6v8qdVbCPOGMa0ivzaxAf1sDOMalHEOXu85 fa98Ns5kJAEZV61GVGIjWGreYjrSoI8/kpqKPMDn4rk714OWJ58CK7V0p6P9KkWLOv1TmqD5lgEoR 3oUjrsy5rIEcZbpc5dXuUEKicMCOsXpxsKKlw4IcLnDKwY5k4lqXAPAOLnSkSis0Gpzx2UqVefpRG k+kpWL1JCrVrx0guR4752OzCDUgITE+OaPKhdWaoKX/106P0MilhLVYPViDDhHOPNa9M3HGcQjUc/ nhWl9sIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOA-0000000DObo-0m3w; Wed, 11 Dec 2024 01:19:42 +0000 Received: from mail-oa1-f43.google.com ([209.85.160.43]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBO7-0000000DObC-1gcZ for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:19:40 +0000 Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-2689e7a941fso1952748fac.3 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=pbtnJobjq/IcLO98ckqUgxNL5W2s26iPEcwgLwhKbzz3IC0nqmHcugLAGZHgCcCgqV ODVLrzJElSawQLsxDT2AK3JzrS6p81HthEUzTT8eShkmwQcQKiwfih/Yv2LzS2f2O/ol f8mYSCmtENfc6oJnTRTpYABiegAXENoQUN1P7Hb3RpjhrlqmWAI65pW58359m4Y5FMBN dOvfeGS+bzPFHjM4C2RBBNB7+8KfeAjUg1sB/HD2VezsE3muat6NCfSNZsPtH1Jj8cgf H0g/D/WrZVMaQbwxDFA2GaW+d22A2YisO6jEHwFmVfdntf/F6f0kmGCF4EwuHuGPbEc1 ThFA== X-Forwarded-Encrypted: i=1; AJvYcCVaMuNg3H2C+iNxDaplYgiBuxR0ElVS38dKZt2UynA4qS6tx8j2K+Xv+b153xTD/zh+hvhI8y5GXzi7BOYJEA==@lists.infradead.org X-Gm-Message-State: AOJu0Yxv2/S2UW+AKtNBOQJMU1StZD6mcoW51SBBlrxvw1ITWV98s8l0 5upEPylEpU+AZWqhfYg+dQWnYSJdeb5MLXWNxMXTfOq6c4KvgKX2 X-Gm-Gg: ASbGncujrdEfXP+KNwtX3xu97TDmp6FVGyDs6qBoxUF81bqmeWi0un+jWWq+JiVnVrw B8TpvkQ6cSQhX6hZP3wzQXm+uO5Yvnd6IKy6RQZ/IEgvA4YazmuFd4n31LNqNapF53tnNQ+zLnp W+yUCoGLBbvLwbJp9RlKjTR27N6yIRUAcw4x1ODftlTtUnhaJbgoj3sZkURAs6lz99/s1+TRNkS YSNVU54zAncoiE4jeTV5iwCNpICKyOVVLbdIC9gedF37YBad6M7kU5B18czcTZieIUfj30= 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171939_444712_2BC8EDC8 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D584E77182 for ; Wed, 11 Dec 2024 01:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zAlj/teGsDEq9AqLoVCNv/Q4QETD233FzVs6JHfwoUg=; b=O8MGVR/L+2/fLxeRm9D1ntMp3W D72AhoWJw0XNjHHoXICAWRVBQ843G/COD+8smex/nuz7Je5I5UKrJn4eddotnqN5DXS2XbELSIyNo vLcGPrd0hOkJnnfCuw7krjIz16SA4y+fXN0RGL1d1J9E/SSNoIr0KsubtGx2pNJqUQpDBPeBtI9YD ZOJ1I43ScOTaeIZmgWMlbBQBfZY2nbZXYZ8J22cNC+fUZGYA9C890Nh+bRvIbGtVYZ63jPZvPu6Q8 FISkLY2fu4J/Xixsv5mP0N6wxEwlFZTzrXdvLtMtJ/2PNM5gA459MCcHOScLQVBHhVtUMmHoaJgsh IQfwcGlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOC-0000000DOco-3JbV; Wed, 11 Dec 2024 01:19:44 +0000 Received: from mail-oo1-f44.google.com ([209.85.161.44]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOA-0000000DObe-2r9H for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:19:43 +0000 Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5f2b936ad48so1223356eaf.0 for ; Tue, 10 Dec 2024 17:19:42 -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=QqnQMOPrZvX5lD4TAks3REw+HHEfZ1K+CUDecnq235M4WuJ7u2bG7v2zwI4TGb+R+h SMdQIYDT+8ROKL/XVCHHuAXq4S8a/PB1SuNZSmj0RI5yzBkTsvMJMUv5Eimdh0du7Los u1QZhR6IEz+m/kHMXb5DX69mT7w2p/N27LkSz5aAvbSwCEHX9zQ4nmzx9lNRawYg23Tr 826YiYKeY6yWlRUn+6ViTd712xkzV9XY9QVShFrNU4RtQBQ2YEM8ZkSzs02YzouWGuhy u0uFeMCRtbeskSXD/aHItnM2sqnkLcas9kQgmUEXyRKjEuxsLw+ltAuVvurrTKWS2BRp roxw== X-Forwarded-Encrypted: i=1; AJvYcCXp5cFmCX4r0epa+Qicnhnp0f9s3AtzsNh73OFoJVtZSyo6Qa3N9ZjIsawR2q+Hmv/5WE8v3kiY2PhifvEbrQ==@lists.infradead.org X-Gm-Message-State: AOJu0YyVRpimf2EMsIkhhs/KH5jcIixhz7FVPbptmGkES9FCv38zY+VK WhSijo1RaGV4H9F6ijjtHL4vY8rik2msM1Ce24lenVTk+8rD4zWh X-Gm-Gg: ASbGncs34pxOedxIBFN931JJEDo/lq9+9bmX0Mx6D1l4VBQGzNnPEJjSIOrOjKcHvhl 4xxHHOZKW7+scWYf6fF9MG1t7XO9IIceto6DB3KcH/GIZRMDXEx6k3Z5CR0T+/n3vcj5NmsR642 vfvjQrzi0X6HocmfXNqtONwRF463yq1jW2NJrMe91KqpMfYOlaaI2tJXxBbe5r6eClcB6cncny9 MXu8I/9Vr7vllLQLi4uUyw2puimz4vZwnXfYpT+tGwpa9WWdvOopXvrXVbZTICVgxcBa9I= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171942_720196_ACA2932B X-CRM114-Status: GOOD ( 10.78 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2F6EE7717F for ; Wed, 11 Dec 2024 01:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hEOr7ZXlRapM92LTTZWIPUw2bm7p3TbC4/klzbIn6U4=; b=DGwgnUxygSlHUPVptd32cajHdI /nSRMzm1dkoWJlF9yju+ags9SWTVj0flhTliXFkTZaysgCArSPhQX0O9zeEQZo4MOXwqL/wB/L8LM nbi0IE62h0VJCXPFyl4M0X44IKQ2/Q5ReKt7PiHcQh2xBkOBOlsTJ9URxMkVUuDG8We2XeaTT+NuJ rGIzi51TbVRHSp1lJhrBmrMej8JiCcit9+Vo4QqYpUoUZOTEhZF2A9tantj6ZQNVP/uDOf4usicFX 56+iQXfEbAxmdC5YDNqT3+9Bk0RUDNN+tRSgSgIoRjH28Y2xse+fKJrlcU60dKwE5sVrdzeC9lrkg uQ95DvGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOI-0000000DOfB-0Mc3; Wed, 11 Dec 2024 01:19:50 +0000 Received: from mail-oa1-f44.google.com ([209.85.160.44]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOF-0000000DOeC-2mQs for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:19:48 +0000 Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-29ff8053384so749259fac.3 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=LFR8Mb0p6TswmQdSkqTGt3utw4WV5soXv1N70DLci8xg+dLoRdQuEh3VX18vC92crE 6/bqhxvedO84z9WjD3ieAP7TcY7+CfKtpw4SSEYMC3bj4UeOfSKt9BdNy0L5RyRsK2EU YGgSNgCcmDWpTJ7FF8qpO4YnGoZxNUZy+JgiMUddx0DlAXnIBsoU3O8hicjzP05iQLB4 cMsjWrL9Wcvxctix83apB4dBE/s5maznRLTXce6FYvGmx4Gesemd1QIDpNtDTUTpM3eb B7d4RRdNnskAUR5nTswaUtnz36e76zNqdLYD7u3bARGVQnhAwHBUvW1vm5SfUff8P23U So3g== X-Forwarded-Encrypted: i=1; AJvYcCW/zzSpUNldbw2g3osqtLbZEhznvx4u0D9fk722lofQ+JTddtwzM5OViKf/6cmOQseWC0xVeKI2vQzoEuChGQ==@lists.infradead.org X-Gm-Message-State: AOJu0YxhqBQUjl433ebKuvzWaZBjRJaVIP3c4uj62RMTwMLCBd8Hhf+l WJVbiDI7qLiocd24KxUJg8NaQitPfx5ELKAc6dHdcdOM0uaJUOnD X-Gm-Gg: ASbGnctSzubmuxRRAZj+bdfQ2pisGAFKFotoHj/4tDNbFJo5mf/SiNdFosT0NPR7p56 G5/WoVJKWHM/rtloqg2gRWQ2Mfwh4oW2tZilBiH14OJMj1lecDJY1OxHeNORZXo1uPS7wHl4fUg FT+ntLOXwxzySkshz0ec7RjGPCLaXSQYVZsPxqfRTxzR+b9WX0MkQC0hX9tYW5pfWVrGaG2yW4e sV3OA+BDR0oPXTWcl0BQLh/257ZssqW/2EwrufJd/cQUIvUf+KtSI5rdxEVGiREIYNimDo= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171947_703741_72972448 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31437E77180 for ; Wed, 11 Dec 2024 01:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rpVhxS7jqXsBo8scTDy0x+y6eI+LhzVWJoven7CoWuY=; b=e5RBDTmrypppMEDFou6RJR93P0 eIAIf07udXl35eLffiAJdzKmIjE+Q/5di66j8Gy3Ckuj9Fn+EYY7xjONJOK8PSe6D+32SeggbD+7r 94zqfLbC1DuDBwWAIQcHK9LRFguTN99uEf1A0oPf2nB5h9BeWSFzSDkFZTLJvJV4gcpErA1Z9b8Ry aBMNX4RDXlBIimb5IKcZfEUxLpI5MjsNMTrEyAzLuegxXvZo/Pe3Wi3ciDH8QcOZKdeVUmq74Fzle MqmrtBo/sI8SATIqUQrB51OiFTZBqe+KnY5knX7uv0UfeXsT2O5r9rnnEhgLgBwYAaOQgz4kFy1Tx FpNmPmWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOM-0000000DOh5-1aN7; Wed, 11 Dec 2024 01:19:54 +0000 Received: from mail-ot1-f49.google.com ([209.85.210.49]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOK-0000000DOfx-1EIZ for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:19:53 +0000 Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-71e1d6c7738so7359a34.2 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=EtVIc52vYeBdU9kUlQ2hfjrRHDV0IFom4AAaWiW0ViKnZ1KxvmRaIGF9+KcVIoaHUf F7LyaM0Zl+npNKBCx8Ktu7lXYCuu/wNCCi0uEpUuv28PZ6o7TYzSPQJGkVCwn8lviMVv Y37Xz8xaNsEQVcV7BS6hreozJHXK7kg5GNTeBmkgSYfhcS2U/+ZYZQNPkner2cKlxUtN qOXUoEvEXv2gf2XelEE3NsqhKA3J6PJwgkIcg7esI2MdGoSDtI/CIQuaB/vUnSzDrZDh iWZBlLGoM5VRPrKiF9I+cYlkyxV49u/19Hl/gep98Da826dwZAvcRvjdBdQMgAqItfuU N0oQ== X-Forwarded-Encrypted: i=1; AJvYcCWqRvlfUvNQqHmFMaS6UoKzSph/HLxwC/9LN8+OND2qtDBTtwcfOYobWsTwiM0S5pNGxRwgzrZ1xOapDLnA0w==@lists.infradead.org X-Gm-Message-State: AOJu0YwC4BLtYbQ6eCuyZSkP2kkU+P0e4iOIZYUOIJehhP51Jjr1+9kN Vj6PFV9/mxhcCWgbkyy9nCgBVINIBPv/xZ0XJDvhRhI2lJ/z1voJ X-Gm-Gg: ASbGnctB3VKb2DZd2JaMOJOC9zDaJODyFPt28AP+JzQCsyvl2z9Op5BFDzIsoHLi+iQ zj4snTZc7pcAEgjJ7ErDLY9NZ6kxdrdsvZNp87kNmMsZV3XQRtqInMhdCdloqZimULbg/TjFSEp sL7y/tjazKdCemJDXfmwXuo2cJqsDqSdNBooD77gJpF0zHhIt4EQ4ypm1M10m20hRTGFMc+vW71 m1M83imDNPlG4Ynf1zPOeYtmdYYLdm984MP11nuDKWkBy32qIrykhvdUwIFL5pgOzbB6y0= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171952_332848_C514BA2C X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94298E77180 for ; Wed, 11 Dec 2024 01:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yp97iVt69yOBSqlfe/exljPV9iDu960ZlpwaBTRyHuE=; b=p0bYnKD2UvfnkFvdqT0g8zl7cQ ZAV08ouD5ZMU1iT5Zgc8hp+AsqiOAkGkNkdq5gt4HIHn7+BbkpFd07qkPPuxhVahu2clSGmRUlklr llOTQAUPBaAf9LWl7ZvzWBr9LNJil91pT3/YbHRrKKchlWKUigEjDOfMekpWpBAKGSXMX35NtEyiS hgviG6Z/eQ3P3YqZWWaffrC+t76SGyP7GPVgIE4RFlAS4WCOxbnf672Ljf/bgc/5B73BoSGA6B6Cm WYp+uKw4u+NkzAuMwsPAbGiZuwHdzX8Fk2PJ6leIDdEj8fgQQtlIYzYVjb9Z0tduZj15NZIOB2BEp F3xB8Okg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOQ-0000000DOiO-2qHl; Wed, 11 Dec 2024 01:19:58 +0000 Received: from mail-oa1-f42.google.com ([209.85.160.42]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBON-0000000DOhZ-34Y9 for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:19:56 +0000 Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-29fe83208a4so114193fac.0 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=ePBINbfYzGuFr0EBDu6e1NH1jONs+QvytalQnQXLPK/URvFwANP/5JSyrkQVVoIl/D iykoLkrzjncHmQVZueVZ7JSE4l0QZKyvNrwyeks3a+qJKCycQD7si7QO0feTBAHdnSFb pWqdnmbih3yJlfariw83CQq0JIzFpVarn3vh1lHKfYpk1CmMf/iWZN9T540GH5GMIRgY 1wxGo4oVJeWTrIFrlLGAdWp4KPq8A5naw7BL58PMhrEskk30qModny90oe5ro76bxxu/ duFq9Fa5MXlJmw82AyAg72HHj11b7CJFmRMYeQxOIM6N5HgfN/UE0Cng81jXEl8Sd32P z2qQ== X-Forwarded-Encrypted: i=1; AJvYcCURsVNYntUs2UhzSNWF5MQolq9gn0PZkgahCYMMLLRB7oKOTnWUpRXn04HBqL0WMHrMaJr9gg9xYMG0SS/4BA==@lists.infradead.org X-Gm-Message-State: AOJu0Yw4PXdIhs94Fap3DLX47QTScDXNbzcYAQbg6vwL6Pjs8kl0EUrk PRJRchh1msxQW+6U7MbcoqStvK4akejT72PdsyZICcUfpTJ7npRa3r+1zJuyFxs= X-Gm-Gg: ASbGnctZ6rtcc9/o9ifCWslak4YudwuA1dFsik4juJAPh34Ju+PlFwjQU6OfMMiy9CQ EmpDUqLpWC116A+SB8RGfED/K02/0Bb7MlD7KwAKJZ95y0LFYoey2W8BAcze7UC8xR32pCkrBC8 MfrpkzCn/+jGswHDrgMVq0G0g3QTJw5TQqHhRqW6ffxBbOxlUgIjmTTcJl5n7arYDbDJyhydINM sAPQ7As9X7xR7ORw/Iv3TrLpwqf5dtuPMIrJ1YrHgwZ8iXohspIgsw8MxqyVoPCLEBTtbY= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171955_767388_47C3E988 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18566E7717F for ; Wed, 11 Dec 2024 01:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yk49pXqoMYWny8tmzY5u5tahMKAPgzxyn6k/GluClh0=; b=RiqyYVWmzG0B5ip3dqh/imYbBE yucREGXzMXldG3qL5CRYTtsc8lESgZQxjBnAtbQcKXjbG+cifzlA1mvPai6tdDLbvuZJscArIDdGW 0xLqyTqjw3fq4TuuvLZaaUZ4iCKF761fpXzFPj5YaLU//wndjeW74OmHU+vOxpJchJLfmEJki3Uqq QCuQJl4v6y8+w9t+AHZIWA9iwNWxx5chmt+rI6EEvkLKvu7r9EAC52JAh+wSKVV3wRPIWNS3BCkJw fd+Ur0WdwbNFyvPC2HimLjUJwR1KtKALMikTMPCirG01ikP2SnbI7Eq+4BzHLn2L7j44sZlzq6dFr f3TwsdvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOT-0000000DOkA-11fL; Wed, 11 Dec 2024 01:20:01 +0000 Received: from mail-oa1-f44.google.com ([209.85.160.44]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOR-0000000DOig-0TmH for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:00 +0000 Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-29e5c0c46c3so3196195fac.3 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=gFKNyzWaH+UB82SHyj3IwG5SKQKlrOaPJRVLd09ez0tC3J3678n1OpXQH1Gy4IRga6 0dss3+ZqQw5XTdKFpM9xGNwGnfwZL4RKHjt6uYoluNNyu6dB4FfYQkIBuvYqb4zKw6OU sggQok3cQG1H2SeDcw/XjCAccXIub2IC2YpDJ0GvMqJTbPGfNkGuHQc4xaX4u+EJaQmp q5KzaiytYSZnGSNSN2dPMMRXGccCnIhiqlgIahGnuk8XWFBAFNatifQ0crlEzcICAG4H ZgRoBNXxdvtAmZAwFPG4jfTW4e7uNeSAgpTfOhRko4GCqEkMDSh38ZhdSJH8hRLexy/f Pc1g== X-Forwarded-Encrypted: i=1; AJvYcCUYeqVP8HOJRV7FVxLf/oYxWf9OwT9c1gj6kqq5fUaZ1wBTDDv7JpxQDaqHAYwhUobBOlAvobA4/Pp1zQ5Mpw==@lists.infradead.org X-Gm-Message-State: AOJu0YyRqrxTq81/6aWzYOfqqYuKMMiGsgoqLJO2bpZF4dYzA0GrSfz7 zzzj5Af3cHaPitDSIaDW0SdOu/xcOgsY5Cj/TcvDeMni0KtoLvwCrZ2mmeTGxhs= X-Gm-Gg: ASbGncs5MEQXYNpNP4duN6Q/yQFY4xeuTs6bemsS82znPdLpGfVOVC4tyEtAdR39wLp se7GKtBDHTUx5owFxT7lRJLgtAvLZ/121w4gipqYxacVXE6S1JadHZWl7KTBg/4oGixamMhKYCI te8xwXvHgcF4iQyCmlHexzQeISQLTL2UPzo6JEICogUftCiS/XWVxTTs8N5C2VGZtiRIz3w7NK7 OHOlw4eB3EC+vTaaT+x5UdgDeVt1xkhRDSuf4+6wCxL7Rj6pCQ63l8wL9KsLm+dHsPv5T0= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_171959_150165_209E9415 X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58846E7717F for ; Wed, 11 Dec 2024 01:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yl5+M/3Wjfu1WokgjzEWNvkbZlxOvtZ069F9urs3Uak=; b=rVBxdjreYxZE+a5kg/mMtQ9SGW Ah2ucHjj+u+/0O7u+CDiwFj2p4ikvZ9OCi81+GqbwN6ZC/VzOBkfIuhtYk/ILDCQzlXWEy3/W1UKB HKJ9/3hzQ92a3UV+ZWmnYShO/wIZ9zV/t7/fvOnwRMdjeen/kEoF6gF/H14JlvtspfTpE2ZzVqODc whJBi+MlA+4UJSlb1p0hdy0zOHAMVZZVr4UKehPSV5zzsVqF403Unt5+cV461r2I9e3lm8aBRgdv6 /tf7QdzJnQis2gRdKWEdO6AaAoKkylNxEC9PaeWLswUe33x/bXhuSPuJTOpRnoO0qE2hp0Ma1IG/Q bRD8bGyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOX-0000000DOln-2IJi; Wed, 11 Dec 2024 01:20:05 +0000 Received: from mail-oo1-f45.google.com ([209.85.161.45]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOV-0000000DOkh-0sHn for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:04 +0000 Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5f2ae985cc4so1384556eaf.3 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=oS2oltzr30yn3z7zQCDgPrwI+ri92kEWhj/EnQsqMLy3C2XyFbXAvuTJk+PiOS1mbs rY676W/29pChdhUrHXBMsETOVkRWRKmh/nNALGGO0B2+IraOYAQgTnVKknVEsVPizqk+ zok7tmHh9IbKXdFwEw/e6do4ztYW1VbBokH2Crw42JaF3h+U7zOTD/+m9VCZFWRDNhVL M1+WUpRuLnpybYAlzLy/XAARqzUHxyXBrAc65RxmOYfGNP2SzsN0Oj/ST53Rir9odSLx TbhDTYf7w2gGFUgB3WJWHdPZjMirVn6o9IQzizI40SEyHXqp7mElE52HOghdpjhpxxNu jRZw== X-Forwarded-Encrypted: i=1; AJvYcCWgDEr/qqt48srls6dtLVMRKOGuaPLZWRKv3vaHz3smHF8XBNFpnw/7fNK1JBfLQiTxqVqLh3cGJO26l9jXpA==@lists.infradead.org X-Gm-Message-State: AOJu0YzerTi3czSj202BHpmjlqo9FVDS+KVgE+fFw2JSimV4imGBAHFg bhTZ9NK0nIdd5T8CPmUoOOE5qyY45MU7pqKXwKBfRNhXKux04nuC X-Gm-Gg: ASbGncvW65w1/TPu85Wy01hgsrIUSNAdjaJ6QCI2Txs/BrewmScflI9N5dWVyocEgHs fzpGitjcKG27Ku6l8dO6Wh5AsfG2cmIYXtt4oSapeDdxKLHTtAiDuGOL8B04ABH64/cxEoaYvGM CBnQEBaW//KOB5T1tCAmo/htYlVnEpWKDaPDyYP4Nia7DX0MEIXFM9gtA6lfCLpoQfMF3pbOKMT CQJNo2cdDDSefeuiTwO2LHkfjXrlXve+P9BvE4p2jsuQtLaA3uS8NtSeacpUmaciy7NBm4= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172003_247871_82040B9F X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6776E7717F for ; Wed, 11 Dec 2024 01:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UEJ5kdrUNfjAy+icZnm1esu6rZ7qPtHroRsyBXfTsTs=; b=ZrKDWkNm9I5C98T0CpPNegxMJI yvaQzA1W64BBBHP+PsQwjdLGlbFbMzYy0vJsBfyJw71Xi9o7gHQt4/MsWmxCVCG1Ksd4Lcak5MKdJ 3ALHcTL4CTqdX+O0j3tr1QIc1jO/S53dJJBW46B6kn6MHLBgeyKwQyOpMLqNeCE+0oZfU8x7FUgu2 9uhyohO8w9PVjXSrjM7Haip08ePHte6apLmjPE0skPxa6VkxRsH0Rn2PtN75pHV3btj2xhWRqc75h ySVMmSZW/Lu8vx5zvZXohRIygWOZGN5Itxit31nmjvTykRIAMvg716OpOjNdAIrQaQcZxs2g6chmt PA1IGlcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOa-0000000DOn8-3XLO; Wed, 11 Dec 2024 01:20:08 +0000 Received: from mail-oo1-f49.google.com ([209.85.161.49]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOY-0000000DOmD-38yv for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:07 +0000 Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5f2be1430d2so766028eaf.0 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=YAmWrCGyEtaA9MLXYSxQsRiHaLR/293RXrPmu8IFiVAutbnwA+poUUwqd0t1jGZ6HL llDXacPR7qvyEKBdpNCUJ4h012O3AaFYY+aDVXPznsePCz6gqOYYUtvoXicW0CobYUo0 gMuLU4d6RaEYeJ4mFxhioo6kR/wqTqONaFYPoxuSEuE5vsc5EdFmA8sKFzPKuZYIfVll M7CB0t81N5jzVdWb5KEmdvHRA4I4Z1fGPJtXwAC89prRA8ApKjsQ4vvuIFynAaJ67VqW N7UM6As4Pe0WBJWqPVxiMZnDFLTEkSh+hETSXcR8imVISO8WQorXD/GDzwbZAbvfRoVp TxFw== X-Forwarded-Encrypted: i=1; AJvYcCX70WJWEFmYdOgpQxprrrfXK7swM8lk9za+yXdOO3rHtDyq+0tLQ4hUe3JT5Lwy6Lk4j/zGys3wzPmCi3ow+w==@lists.infradead.org X-Gm-Message-State: AOJu0Yw8XF+NEPBeY+DlZVPAfdKw35MEWjMIeerzFLMvL8e5J5CiMtnh SIe7Sqz4R3niK+gM3oJA5UN4ZoZG7dt+MOslMioYdxU2PSWXf7vy X-Gm-Gg: ASbGncteX1VRaU4nxhlOjhg5gXhpI84EH3XonXrk1ZCcXA176hljHTuzR5wT5YeZDCY 4h1bhMT9rooN9n57XVfUwBbv1UI8p6HgqGvvtuWkjZJ6r4rJ4QtsILMhpdfnwIqe7KcxxFg+PP/ SlPISTefX5tNJVg5CwddHVx3t/wUi7JhzB4pWbWjq0twJqx4QiAt9RYWnt2OWarrTILbH7pjeg9 Fa8oha5Uii+Q0nZBLHggKT1BsQdc/f4TQLz4zJBGq3AKEnpNHXzOt7xZhG9dImrOdFkXQQ= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172006_786082_CF2552A2 X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29065E77180 for ; Wed, 11 Dec 2024 01:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=y62PD/q4WifdsD9DWO73O3hL33oH6LRMI1tKvJMAWf0=; b=BPok5kbzqG1pCAt1WUVdnDD8b9 fHZpUYQF+a50OGsiJTnAnf2ngQWgmZwHwNdx3V4ZNf6PYvY6ZbGi3PmLfWEM84D1REIfABmSLSI2t t1ywGDNFPivMjChhHyfUexfbfaWGUf0XOp4npnfMwmd3VMVR0otS0utdDkQ3xQnmWlUg0Nz2sLtaG FHHA9on1WfEfC0J/Q3DZoAKw63OEdH+24ziSKpjcljDZbCvbG82ifyq2WqciOrsV8pNV/yuSkEZyF 0IF7DSX2WzuC1TOet7cFmrhretPbbyWeA4BucBOPsGm2+ilOuP0DWAwGorcNbKs25458mfAmTxPzz Iu8Kmb5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOd-0000000DOoT-0Y2y; Wed, 11 Dec 2024 01:20:11 +0000 Received: from mail-oa1-f47.google.com ([209.85.160.47]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOb-0000000DOnI-1xWv for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:10 +0000 Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-29ff039dab2so875201fac.3 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=pRE4Ap839ZIvfvLdw9deGG87Cst6ZvGuW6Y/Bisr96JfgEH8F4bpa27LjvLwinOsZG 0urrF5b1uPuMLr3ilQapcdjZecbE1gbqpInpZ84ERX1mC8wWNpxN3j4ru5oqyfqjaMyG 2eBy4pgtHMc6ZaZb6zuNdXDuDJUV+xtRmx3L5bIFxSHI9pTljMTeASqr89jb7hyRHCQo mzTsifOF56AgNTDNZ1XzS1vpZaG9eTt/+mYHVvmly/DdGxmk+OVw7L3ibotMWTijcPcP +M+C66PGowUp5Kvgrjt2E5jt04/0wbN+HlPv+Ajz7RdgQ1rvub2mx6IvY29dXeqGO6Bp FyYA== X-Forwarded-Encrypted: i=1; AJvYcCWQ2LAuoPr4gw34clyszE2SeVIQpZbt8RARJ2cckITNYRLeAr/WbU4WEi2g2dccphFGclOBhMEWQcVnSgG4RA==@lists.infradead.org X-Gm-Message-State: AOJu0YwP3CHPm63E3/pF+XPettVLYw2wL7VOcZNK40DEDfRsaaj/74Bx cedasZhheqrZQQUvnmJMtu1O+8sMzJXEx7FyLGwIhKfFaEGGLSVK X-Gm-Gg: ASbGncs5+WSNnJ9iDK8L+PqF6aZgMKRgdfhfGiGwhQaDe0bKbgVNieFGlS5ywQwfWN6 7by0Qf62kt0qjgDthK5H1r/6dBWizHKhFI8wm+p3MmNclmNKz8KpBiWiksyA8kk4cGfrdjRMLuJ oeEI+kSa6nIFyqIBBIw9b+pIvUpGtLKs8MfJvXIVQWijzfK1GuSokrEFzg2KCidYLZkk0UOyRtP XD1Et+lbATyAjzja3NOkDuSZ0c1bM7MnCTdzzM5RqTlZIrCSwK3Sk92/treke/rwLwRuqA= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172009_504003_9900907B X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE5CBE7717F for ; Wed, 11 Dec 2024 01:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FV6wsq5yojUFiUHKK/2cJBWsk228RylpQzgVFP9hkUI=; b=EesblV71kzzAOVuDtAfDd3/GTr 0OVvjbEZk2G5Pl6A6Rs2wo3oHrRhSBHh7UgpNFKDGA8XaCyVdVUx7itKpP2mnlPQnMRPhERF+9Ai1 J/7XN4rMcAaNbgEDJo5uyEiAl6OCYfXbulrf7vZQkzjlpLGx9pf1g3vQI3a/bxzz0TSFmmI3+jkTc RpudteG4Kts1u3Yd4X23vIbGDLaK4k1tV+Dh+qEzX+vPrcm/75tl0ZdjkFYVkUjlixMUQV5pKLS4o IaEpMz/RQpf/xjNBY2/WgxwxpexF6aQD3ZyPziWMdcbPB4b32+ezoTnxsVpQQREktu2u4iJZhT/Hs M/SnOeEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOg-0000000DOqf-3Sb0; Wed, 11 Dec 2024 01:20:14 +0000 Received: from mail-oa1-f45.google.com ([209.85.160.45]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOf-0000000DOpX-0Yl0 for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:14 +0000 Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-29fbba47ca4so1233965fac.3 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=jhaZAFHVWQa4roive1nk+7jsNLGvzDGWKy2Q4QQl+wpAIa7XWDgdG9ZJ79FIe5ZQ/m aZhCQhJETZRB8LbUXqRcHJUvpt9lK61zjldIrQlpzT9Ht7QqT6ZO1LFkJVKzepQEMVcf vJy15czgmFNyiyGwIsQ46BK1zzLeAr5wSmboOZQSGe9Bhp0V+2e2PRY6ApMNEEhNqiXG EWloxn/Vh1xfmMseQzmTPj+7BhhDvpCXYmfYE0gO5n92kz2Kbbtn2FDycx6cyWHOe1sT dlof4XZyX56KopQB4KGiqQlkRoIZh53hU/cHJSE6Q3l5LnjRHvDp35ypQFCSSbDoyQs+ Ckzg== X-Forwarded-Encrypted: i=1; AJvYcCUr8G2a0gYnuxNNNgfZJMKmphdPNsR+VGHbWKfx3jcQFuj9JLZr/EduWOS4AtA+QSSCZROCC//Ty+a50GI9CQ==@lists.infradead.org X-Gm-Message-State: AOJu0YwKcjn8lQGXfNN7uSCyYIRYEIaJ/HqSA4e8/L9kYxRx9DejtcbE gMWLC7YoBVGuiuOjiFsmvh0ZlYXqBioWid6Sl54VRwUgfB/uv01M X-Gm-Gg: ASbGncsiyt6pQMmtLRGP6htaj94J6BUL43galC5QeWrWgPGDVTIo8eWNMMisy5mCpzn L3BXL7LmRNgfqm3YRas46qTbN5D3NjIHjxv6R+yybDt32RELu7w6+ggC/O4FLvtumvZVuS6HYwe r2fakrtJtz7TfrIYW7Pm0PgnjAPWoeEtAokAz5ERBrap2k7oxu9wa547pD9UbNbUv5STeRVHpJe AZzIr6C2dLxthVUuOa0NCkhC5XUUfIuNfRD3BRQQufM0XAcgHrOF8nNhGfhMvsHFeI3Hks= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172013_172424_C427A5A7 X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBFA3E77180 for ; Wed, 11 Dec 2024 01:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BdfYkugeufvaD6bBwr+fMjYhLzDCWCLOV5qz0sJPubA=; b=WP6MOqTMVC5BS8P/OGWnPkUAMH UBjx7uJ+K29+XnyhPse66LO3GETV+QOxJowix0SyZKAfc29LJiLZsHBgPYX1ZSceeOug25n+MMT7g bAdi8DB16ONEc3w9JFPAkOZVp3HL+dS7G3/qHNrQDloTp2gRMBPkq4p2dbOvfcWzlcMDf+FDEpR6Z LG6ZlEjdX4ymv7bj08pcGqtm4ZBxECOWQ4rfSTJwahchgubh6ro4SucTMuKWTFVObWOhBDkmgGe6I xGMgeNkLy2leS/HmNNfcNwvnkJEcfBUE4paaew72P91krgNGiYe+A/3fpmO3pEX7EckydxO8HnVon 5E9df4mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOl-0000000DOtf-0VTd; Wed, 11 Dec 2024 01:20:19 +0000 Received: from mail-oi1-f169.google.com ([209.85.167.169]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOi-0000000DOrQ-32cD for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:18 +0000 Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3eb40876bbfso858701b6e.0 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=J5DWPAkSnjNcSD+wVVqUjU57L08VFtnvFY3/PaggNgngKfCdT14f00ArKM9QW1nYIt htyxjosTdtJUzrQUuCXoHHjxajkTYN2vS1/RcuGwfkOcwPFWASy3VFQGUC0Wfw7+zT8R V1x5Cgt9YTr6ePfGVYPaYRmTURrjK6Gu+NmKFbxPT9ITBtBsc8WeIjzYAhERhCHyZypy 5Pg8NnmB77IlhsWpwHVHyKw42aGRwnlgPgWAIxfiMnxB5cMtziOWK7SMAUsEmO6ey5uq +NPb6KgRd2roDUkqSV7IHA1AtmMaQkiE4U8SFQqtPa/Fa84U4mzGtsAV2EwGSb+SPyCt Sfyw== X-Forwarded-Encrypted: i=1; AJvYcCU1RAx98PWn+FoHQ9HDQ/tnKdSKAbdsMluKk+4/geNeTzMnEwO3YMd6SIJy23sxQnHLjgY6Xeh95MHa6abLNA==@lists.infradead.org X-Gm-Message-State: AOJu0YzuVUz+EWwfFSqxUtze8tX20VreSi/MI4csEorqGD3uDwhMkEh/ XGLG/sODOEP0H9YmUSs71pARmBCPdwM/IsvFXcDpM+RWXaymKtPa X-Gm-Gg: ASbGncuHiiEgJRKMjBtJtAEI3Y3B3LXOntQz+oEH8GL0WZYOU8/bhmfUl3zzfOgJgTY DP7mcwatXuEdzL3PCpxh5xf8yrjlpsjcSIDQgVUZUcylaF5Mrt5Y+M1kSmMJXaf3UN5UNHvM+u3 n4H6WFVTJ2JiX+9GrlSlN8FfUADkZiWWQtKUoXCklbusm1prw/Jt9Shis4QSL1XnY9lgIeMyv42 BxrGFXzG3lb7BYxi/WLkIg43Ci0dTkD/Yz503uVteI61DVhqbcG7qONXoOhuAWhvVGVVzI= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172017_200317_C05D996B X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AFB4E77180 for ; Wed, 11 Dec 2024 01:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YvLYpyR5eCI3+Y1o7ii3SvRbYIqhS4yWBFBtNSrsqIo=; b=ZQ2n9XuK8c3KC0ar59RYA99MGC a6dwLfmBdmhlEnVe+n5qEQTt5a6kcVl6HVzfVHXmXNakVCajrQmqaK4adjdtBcEcZtbbUyG3FApOi 0lN+97jt3aIDJZvjc3W8yAqLHsM2Hkh7WvHfMXQNYcN2ujyjSpMyZko8cm8GMHbEFBWxJxZ2B31OS NHsurLCKUjuC12iYR454RVaWIQxcQ7dkcMwsfXslcddT951RRqpuPSsLltdh6+W0VqpVq/qLU79kx eErpB6MI90C8G4atyNlyqVRL7tT5KyAFQyd2meD/XVDvAA9YMrPmTgJrqJZQwfzvyw90v7T/YlLpf 0ngaDnVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOo-0000000DOw0-1nQO; Wed, 11 Dec 2024 01:20:22 +0000 Received: from mail-oa1-f41.google.com ([209.85.160.41]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOm-0000000DOu7-0BPE for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:21 +0000 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-29e998c70f9so3584533fac.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=gmeHX9pR0U56gDfic6in5lMJ8q3KbrW9VupiU+woe1NgxZWxTtkPiwHBgpIB7E507J e97Jdqz89Eq+2UqbWciot8042cr9s5Pp1XvkeUxstWfOkhiK9jRzjupqukX9F9Hd337E ry2blPbX7pyPBS3zG60WfPX4vIxVL8GJivz0t0CVsJOi7YK5UemlH+vn/06SqMvX+r9E SFyC1G5Tx7x9XZ4QIUoN0+rFDc/bEGJm9pU/0HZvRhrQ+YfGZfrMV68NiZVglA/ZPpII 1Lr0LOrhfPswKD1b/zgGRusVbH12msYGUtapenWDl/M+32qHz2fWn2zHlM5KaBV5sOwd vQIA== X-Forwarded-Encrypted: i=1; AJvYcCWnRrG3jZzImASJWqC453Xd4u8M+gnI73HWzE8RPUq6WE7k48nUM5GGogpqkcVsBPwoVOrhNeCb5V4u017SWw==@lists.infradead.org X-Gm-Message-State: AOJu0Ywj3ll1gkOTcO5NxobZ8GWux/BngpRpf2Bsk4xJ6SNYOYD8CKlc Yld+0FElfBa1YwF5cccxKyOetr1GQmkd9lnBYqgv4yW8JBBUI+SF X-Gm-Gg: ASbGnctaXF9+I7wTn64aDGUdXDuioBbNrIansvz2jC9qAw+K8rX0XjEia3kQtoxb9Aw UIHV0d/Nd3yKwJD1HB898JO7SFlplVxD0CAbrWwosjPQC9HJCHwrZYfKrW6XW8Ikduj6YtNnwMi IEzAEcRQXYKMtVYRSSl9ZYJWT1fuSZaG1qbD5vGnnYt7YZmxKB51K9bgGOZHMX9OWpB3T9fLj45 W2Nw0Cj9SWNaa+d9Wlola5OJUGTz6q0TXB4KcqRpSF082SOzLXJUP8s8FYE2azTjnSU16k= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172020_077819_7CF0D8B3 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88E8BE77180 for ; Wed, 11 Dec 2024 01:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tRF9ugiz33htRxpTQb5KpK3OS4duLbF4MKOYzIA9S2Y=; b=gEvPThAsnUJ28LWsd04CV+lPpF i8ZOBsgYWZLX39OWzTy7LdwXacFCxkUHgJBb2Sriyik5WUcpJHr/Meuce/pJX+42/MEilchSyfch4 Dc6nRlQxhZpJvnJEpGeIced55d81CBuEesinKmadR2F9IJr88fb9RR7+s4pmlrvseGg6Bv/v1bdSj bITsarqo+RezrOhfaeP27u19l+k7DUWjHz7NWoWKvkdNWp8igIYxTUsjsuCxtajCMGRFKeXsqjZeM UaV2bCMuDqXLt3u3fBr3tbqfHajITyyO4UEro5gui0pvZTwRl1Ur0x8t4WvBG6R6a7XEt/3iVcyac NNDExaLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOs-0000000DOyC-33tX; Wed, 11 Dec 2024 01:20:26 +0000 Received: from mail-oa1-f54.google.com ([209.85.160.54]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOq-0000000DOxF-1G9E for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:25 +0000 Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-29fe7ff65e6so784149fac.0 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=hcUENBQDv8sVDfcdb/j6OpVxNdr6BO8biTbbP078NnKWNa6RWrkMQhYm43a7UMSqEo 4uB3f3pjwgif6/30vsSyqhP+YrxiH4bNqjn3+OSk0q8YlaLhFNP+RLTQtRFXJWayJC+n qzbGEv1h/cEOF6cq0DNphUDzsemN0TKLTJXnCv4r8ZvhXaTTqIAjPePsZ3UTgt3IB5x+ 2dMajPHnZIDcgL7g/9UCPrKeb0+mCOgDO+vMf8tceZlLIB6ghIuLybifmpTwgHLjpHvc 9iooUpQ62o6mzU2YZ2k3q0Dy1UGwRstLeQd9pamqKObR+YxmdO3vJb+s3Z8Zgos5Snkn jV9Q== X-Forwarded-Encrypted: i=1; AJvYcCV6gxkt03wy6jgn23tNis4VYdwm1wnaVIGZjivZVAV3ZjUqb57dJha+YkB0Wfg1twPdK7OMj+6C2r+x4AakVQ==@lists.infradead.org X-Gm-Message-State: AOJu0Yx4TXiuW95q86IevXbQUKVojF7xkwhhNji44jBEHrO72UFoVSlz FRc2b4JZz0uOI654js/kTG3M8Z37UwQxe9cHK/M3DvFHZzH5lT2BXlvva1IX4tw= X-Gm-Gg: ASbGnctnJTGtntNtFNtvnaL4otlPsifHzUPKsvE+nAtzzmYXjRSesTpWxwelLU9QT1x p9bKY8yTUo0pH5IqLXbQQRs2vzDIcqNwOFVedBZ4frxgkkxA3167A8FIY58DvKdEaDr6DkYdzW4 b6Dv8UkERl63L2tlMzuJp5IxctC9ty5WYGgO1LRjbKIJfGyWLSHnfDlPmHrHXq+eyd8UJqwxL0s 2yoYOg3E5s7HXT9uVCRCTrWMMDU9Sz/5qTl974906GGoiSkHz27t9p8uGAnoKiBvo8VyQk= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172024_338704_77A56F8B X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32089E7717F for ; Wed, 11 Dec 2024 01:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4sCOLPelO32qVuyU8xDyaBPcPYTcYPDXfN9EW5NAA6Y=; b=nXIhPEtgQLlpI419mJTTPwhrTR EmDIgXDQhOQMCONzjaFTlod8HYpi58x1Ma/M9hRltQbSNvTGHgf1ytaVcOZMw9qqMpQOVK4vhMLbQ vb6HMhJUk/Rf3pgv3Zy3hMoPB7VhpA1oUaTT7G0Dnp2lPKnjoLwNmLR+kRoSBjlDBp8L1M3WXIfO9 OZH7UjuA/0EI9wdyf/rZdSmnCVVtaGo4aZuAXcIal0vmUoBSdJEaZb8b3VxezBGLiUfJAruWQ09A3 xwG1Uav+SjaSpbJgNKWTUwkkVtIfE7pYGEYryeR9PK0V5jEVNurhy/jwatPAILOXjTke+w8nVOwEu ki6cOR8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOv-0000000DP07-1ScD; Wed, 11 Dec 2024 01:20:29 +0000 Received: from mail-oi1-f180.google.com ([209.85.167.180]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOs-0000000DOyB-3uMq for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:27 +0000 Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3eb6b16f1a0so518752b6e.3 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=u8M2OhZTOYLzUFjYJ04RgyXbszdRC7dEpbKQRohOmL3CI4+DT8c9dCBYgwYX+e0csz CaZAO5n4SSTC0Jh6X76/6IqhdYn2jK19/KykN/mWogT4xz1YhUd6jFJQ65sVSCZF5UcY zCUIQminJMpTVw5axJNKPAC/9h4To6c3CraoUnDC3fJKDVDKyaYJ1Lfq7H6XXeGBBzTo yJbWULhWSMAnqlzO+77Tp6t7n8gRTVdTSix4shb65z+u6ITZyRSBV4AxDpGjk7kxf+uQ Ic5xpiY27B2JgoUbGq7j4bGpaTC8HSGgDxiJaJJF4r0bnJtobCgLp1u6VR8WtMgSMzw5 0aIg== X-Forwarded-Encrypted: i=1; AJvYcCV2aRizxsprN5/QPQM+shneu/dVI4TJonGba7KcTCg/SA8BWW+X0EYpbhfe94Tsd5OqpvHUKsgOFKU9siddUA==@lists.infradead.org X-Gm-Message-State: AOJu0YwjzEuLOF55bJm5Y+zLCLc20w03CjLGZInRjuH0IolR8VkJybzh GOv8RgcRxmNYms/vKJQIEVRHilQZrmBAbF6uzZf80U3ztMNLR42RP00At2C3dNs= X-Gm-Gg: ASbGnctGb1Yg2ZDgqbZz9lmLcQuRCPEi5RNKOWNlfGpIpyDLaS7o4+T1n0+4bV8LZOR uMYnCbdE25C1LVVHsF1xTU3VVw7ZFQ9Shhkdu+ZZDwxS7UP/FAGWCsNrsIa+2LzvAvB+NLGh+VX 3qXci+bOW76UPZKKeugvYF2wk/QTUPDLeaSGYL6Ou+5D8EVHxBaf24CvF2cRIXI4elRzSXB86cv dqH4xRTEJzTpYVs/Q5QWUGuq0a5S0ilsWOFYd6IExuEG1jUCpbgZYN6IagI0aQbJVIzrNo= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172026_967497_3B639AA7 X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AF7FE7717F for ; Wed, 11 Dec 2024 01:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MR5d/wysEF0Kf7ZmoLEbw9RGTdi/T9opkbjQB4jDM80=; b=FRCfQ720N1Hm00LBasi5DJfHAt 1knSB/c2/AOIquF+nIuPldR5aSZe9ssDsDn6gMC6sUcCLs6WTgg3llyo2zo1cb232KXzPboZ4GNLW IgobU0aOovtxDNtPdyaLcjyztuIF9Z/gjHuAdQMFfjpml5aofrbDI8M8uOY8nU4nFy27jxPmPs+2L vWwoJCPLY7xWm811zI4w4H58zPKQaO32mEyeN1mYydBzghAcgjoRb/D94Z7WZnA+vIWapoQPN7K0d ycLPLqeVg7yZf7xRsCIar361o1vjHQpI1mDGgUz4hO2c71QQQbMiUW8FgmC+QSm/BNWreiBZGvklT Oqzyn17Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOz-0000000DP3r-2n0F; Wed, 11 Dec 2024 01:20:33 +0000 Received: from mail-oi1-f173.google.com ([209.85.167.173]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBOw-0000000DP0k-3AN9 for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:31 +0000 Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3eb8accbde3so5447b6e.0 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=WWWBHA3mHcb3JULl5QslmNHeeMfKn2gT5PYDni0vUFce0vz7B+vuJ36Y0z2sLbuPfi NeQBsjHGBsoLYNCHnY5OnQN6/N33Jrxeb+/1M+fq/UBErVtAFXp1PBqN8Os143tjs/0b fOMt0jX9OoJzVkJKp6cYil0hzhn8WkaWmR7CIf66FSzSPWmtfBvTYOCnQDdhpiHwTH7p 5wSVa5G86peY/1pP8MHQoLKERldlXCxS+3Wrm0NN4jwWqWP4/VjPyJE7FZkc9XRGdQzU quPR27wqU7WFaC0SlW1IEPTfT2YXUl3XYNxEom8KW2dRD0DqoP0J3c5ALEwusE9YFxZK mRIg== X-Forwarded-Encrypted: i=1; AJvYcCVsgvyBT4iS1jXmvHaPGjkqglN1mXeDxKXv5atiivOiCEpS/CoC0ijhe8WlseLEWa2vtgQNLYy4MqKGLJ7W0A==@lists.infradead.org X-Gm-Message-State: AOJu0YyHMYA9BLhajAkGaqKTBSD6Ml6UN6aq34ODQfHyjAAhtepDuRs6 f2xG/Vce6NI2SNbrjBoM3vwJ7UWxxpl6NtPVP5TgpJbb4Z83+R+i X-Gm-Gg: ASbGnctnakILlaWnTTsJuYwo55zSJFl4qADZwRir11i80dwedy5dFn1+DGFyrciU/je BMaXr425NfuNE94mQc61XWjY1DeLmEPBRSUAMFf4j4AF3K27G0LqX46vyH5TbZr2eixsRR4zXM8 nOI74a0vURmSdX857pobDTZPvXBMHpI3j2fwO618+SHuTHrLU4WLfdUoE8TdMlTQhh0eQZaiFNV ZTeWr5S/8GkXPBYEku9MFucoDFSWrJ19APqdoUPQdSa3HuBZ4/W4DD+QjRUqd6ALrjy0vs= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172030_793148_F9812972 X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C24B9E77182 for ; Wed, 11 Dec 2024 01:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K1YpHXYbDA4VM1WpYLpyHXFxdUkmq+2IyIhunuoKdpQ=; b=wmJ7O5N0KXSI54ZiREH/o5cAAr kadcuzJJsYMJIjs7qXqndvQyOmvHHizdYG3PqEqZwha1GKD/rk0cYJWRWW9HHvjVqorKhAHouOtnh XfKkHUsT82GRFrK20hqW7Bsq+oTJUAvWZSEWOOlPudtbZBd6aEB1sgUu9bb4imd5D11ecxg1FLqNz tsspM6Tsdt0r6csCO1wWIQOfjzlgJR9cBZ3cC93ylrEFpHLRIw/CHBmraLnSXQcdvAzIrruXHbWTO GOQNpnylI0c+Q7zPVVJoT4SqVaYpN/zdi/c90wZBg7caOBRplcJb4bS7FjxfwaI3CPC3LhpcQRNaM pydg23/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBP1-0000000DP5E-3zug; Wed, 11 Dec 2024 01:20:35 +0000 Received: from mail-oa1-f42.google.com ([209.85.160.42]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBP0-0000000DP4H-1Nik for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:35 +0000 Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-29e998c70f9so3584692fac.2 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=NODVNXelxO+InN9cDbDv5R6HZZkDx4dmjBzvrUpyUUpblGxtznTP6dT88dE3NB0qWB YDnfL6e8AnW2pKCKgDZp3K6ai/Mj6WL3cikPp9DiLBE/4LSkhsKYn0nryPbYhC+BT5yb 5e+3loh8YPSkouuR43RKAm1lbW9Q+4hQ55MS/wXdJd4hXlV5vJOvy3QNddfHw/GS+PR+ 3xPop27BGo86EOpn2Cx1Lsl9hHlwmd6h/2w7/2VHWFPthKCxDHhIYBlALlepAI3nPqUW mA6hi2egxUV0GBxkh1g8DMrgj85uNEveGSfTnOuHpIRP2CvnlGHbCHJ6q4UCwduEtRDl qAdQ== X-Forwarded-Encrypted: i=1; AJvYcCW8cgzeddYBGF6M5yX8xBzLCZ+XKWL/UZnBzXrv8laiSeDb8025U0zRBbfIBOxIqJF/WrcUKr59R6MBiGvrkA==@lists.infradead.org X-Gm-Message-State: AOJu0Yxh36GgnsMNrJ/1Ug3f5OCxvzVNVilQGFXvGbrb7jSJWldBZZaK mdR2xrI5TAg1zrye1WjUjNmg8k7al3gW4P92iwG1R8+ps74JYk1L X-Gm-Gg: ASbGnct+whtn/CRKEz54a45v/Ei2JasyhcziNp4Wbx/t6BLyBPez4s5Zw4a4guxpOdY bMcL/x0OKwBQr/Z2MCV0TKqeFCtEoYy+i1TadbDzx3lSQXKOdhHwBY+Yk9UR8As7raZQs29MeBh PIh1iLRlNsoKv9dFkGlWr87ZxZoCoCT9k24dUq5FxniVkxidPNQxKl3wyYZGvvCw5P9b1aIChBS 5J9FjHpcQJU7eg31Not/adow4Z+aDLJwzJrLNqJzmZ75JaVltU5NU0ogzoxKEoO7eUxGyA= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172034_368571_7A24EB04 X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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: 13902729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1ABBCE77180 for ; Wed, 11 Dec 2024 01:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zFt/APP9Kpg1SvU/nP3fnBmzPrWhuM3L++1qvEulSaE=; b=o7eMzx1wAarXU91M7m7Pcq2jF5 fc/w7vmhomQuiCkfPka4W4VK1nGUi/o2omNRoBB/1/GMwzlWxGsYu3mhj1aYJUcKNUj0/m7BVFGoG R1nmviGj8TbR5nqIcpOLBabkhe/Mdu+rLT5xTkZOebstSqOVGy3nLGFAHD3zBUY17/qTnhd9Pw+XS 1UDcP35WZAgdzbU2PdcvwuaA8KeG34vyIOfll9gMbExwc7esumbViBY3QUQ8swL9akL0xREflGCII N7ZSCbp6CdLekVcy1MQGcZb8rRtKpVMSE/Cv+kpsv1OcmhPUAWeSjdDt+Kziekly+60GYDzaFDgH7 2PXaoa+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLBP6-0000000DP7n-15tk; Wed, 11 Dec 2024 01:20:40 +0000 Received: from mail-oo1-f54.google.com ([209.85.161.54]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLBP4-0000000DP65-0A2Y for linux-mediatek@lists.infradead.org; Wed, 11 Dec 2024 01:20:39 +0000 Received: by mail-oo1-f54.google.com with SMTP id 006d021491bc7-5f2ac4a9038so1284485eaf.0 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=gbLj6KFyHRYU5DRXCulEAUb9hypqSC82p/iETEy0qECHw9PQVAHWbFwIJEGDEzMjp1 Or4aJVx8VvBwhHUkSIxJmB3aHIRpYJ15drC662tJ9nfpysJh1Ku4wVJfGoM37nRkJ6cY /hrnl1gYMWi2U0BBneV9c0Shi4fGolk3yGcak1a9asg4KMI1IB2fy94j3V/lsJF5GSBC /Sul70AMu2qL9eqJcOQN8rK9M94OkYSsngJFSsPi3aZN8TOfkRgI0Q2tcp11x7JIy2LS tPTCUe09x3ZC9LFDFwEEo5dU5Ie1UyusIn+sNdxplh154y0MqBSvczyEezudkO+YrRzX iq+Q== X-Forwarded-Encrypted: i=1; AJvYcCU74Xs/PfKXNOrVHEecly1v1KlINFgY2IvXs2KDAqhkxI35pYIuRA4wt4CKcAJzio7vR7bEf3WMd36YpipDkg==@lists.infradead.org X-Gm-Message-State: AOJu0YxC5vlm9FI9SF3YRxyvtY29gB68LOrM3kDXebxaJK4/VdMGYEzs QnCDCyvImWiH3MoVSEEk8a+JGIrxK90ylZGL6ZTgldzrc+335FlM X-Gm-Gg: ASbGnctUOjLZioF1wst4nQjhhf8L1JPrWtc+XJybxKBTkJlJeggG4MBX1Y9zDuS2/la 0V0ba6RXnvdRV/Zj3rZA5IGbmAcCg7qoLANw/ebnm6iit2fOD45EO6kHkPSZ6czRYxp9oD/cQk4 s3gWk0hKTnD9kltZJ+iMDH9QAQTOs+QV5+3JPphdhNkAoN0lFi6DyYFL50MpIWe3D/xDeu8fTJ8 V7RrxSk5cR9ltehSBowGCtuMAIwqSivn1ktkaTrcUeqqLvSOhPFopIULlpkrbjnK229O0E= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_172038_087050_FB002D19 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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