From patchwork Wed Mar 5 00:08:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 14001669 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 DFAACC021B8 for ; Wed, 5 Mar 2025 00:09:18 +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=DZq1QVFR2Y4L6SmWL/g11Hjl8Ghbc2LyxG/QBtnz4Ek=; b=z3XucVOZKIgAcY2ctoBF/IbQ+o dEHXC9Pp9Zm4kEknUGUZhfR/Ua4gqRYzA5lMeuIe6eSJQK4vUOeXr0qwZ3gAGbnPU4VhHWw6gW/6l A1HxW/Rl1F6PeOcK9sWQi41B+UoBWQ9ElTGVLjK0ZXFfd95IwdHaEIrTWx1P1MOTV8FNtT2bnf7Ph jt/xyy/4yL/mwsN313pr/N9280ZBx+SheF9XKX61882Dk1CEmw5JtzPTZvTba51/YiIt54mZLZeoJ jOgbBClLR4gxkkxPUCU0tpy6nuju8CkPmWDJD1bbVwXUr3794QLmeDff4W35J0rvhqBDpWUpOEmKz Z1qD+e8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tpcK5-00000006b6u-40c3; Wed, 05 Mar 2025 00:09:17 +0000 Received: from mail-oi1-f174.google.com ([209.85.167.174]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tpcK3-00000006b6K-1t7N for linux-mediatek@lists.infradead.org; Wed, 05 Mar 2025 00:09:16 +0000 Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3f682bb0d77so151720b6e.1 for ; Tue, 04 Mar 2025 16:09:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741133355; x=1741738155; 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=DZq1QVFR2Y4L6SmWL/g11Hjl8Ghbc2LyxG/QBtnz4Ek=; b=updgBk40UrWARMIFug5aZZWMukJRnhdB1RelfiDUX5wlnaolmE1u8C7jX2Ia3oTP2/ 9DNwrcGAmLeQGprYcHDaXfsEeioZQoX6LEb3ULydtznEfFQfViiVMql0ssJOYyvQNrtM jWHQCQDe+26+eJ8EssiK6Lxf+cTpH/GW52qkfzzJY//qMu0SLqEj2N4y9QgCIWEC4zeD IYpvqlKSoR8FYq0Ev2pk168d9o6oomu96BB3Qd5U6u5N8ekfKmHgmYhg86jRJiNUUa+c nJfS8c2cjUZ6L8f69EdPXyPmLyRD4Skn+gn7F5IFGmTRQhZSMBE0WcV48UMHnzm81TNH Hhdw== X-Forwarded-Encrypted: i=1; AJvYcCVNWLR7KWEpoVnz7fUTy7u8oyQa8WcrJLbWLoeNRVpuKTKxBcEOXEjemNppzoZxWdxq3OWwEtyERgESxZ0kNQ==@lists.infradead.org X-Gm-Message-State: AOJu0YzypQpjudxQFIfI0kniEMuQCE+0fuE8moAfqnNdY/HaD5SJtvTj ETIK7VMB3JUTbr9CG5Bh0xpPo5r+5+60l/K6g8vLVK48Jak83rNByRwZAlMB X-Gm-Gg: ASbGnctohqDJATKKijSMxlusc4YXScpW/CaAot27pBCEe0+/NCFftKLMEvUbvzJa7DC yn4DCvB93R0H3GJid13Jmf5qkqGQXoAyBeblyHv2QNUD30axgZR4A5wtYAB56NQrc/NdUnLByPR aANO1UuT+N0S4VFbCG4CHo0BL1/+7KMRqIGt9Ar91+JH/ACp1LxlEMtWc6dbITc5Danl6qLKohi F72dJI8UWjAyoNzOXrxVrYiEx3gNPUrcpw4pv0IVeJvWn644Wa94hl+s0zfbQYG0Tjd+WgzqRlJ fbPGmgVBWxqa4mcvWk9a2TjOfd3z3AFQZR8nW6dCt2SYAk5T+Y43wRJElsonDQ== X-Google-Smtp-Source: AGHT+IHRlYZehCnayI0/SSWxl0V/woi03L0dMl7UT9bDMYd2zx2ye4bxdeydVicDxirQtf76987GeQ== X-Received: by 2002:a05:6808:38c5:b0:3ec:bf55:e33f with SMTP id 5614622812f47-3f682d02020mr776039b6e.9.1741133354724; Tue, 04 Mar 2025 16:09:14 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f67ee8f479sm299985b6e.40.2025.03.04.16.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 16:09:13 -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, stable@vger.kernel.org, Caleb Jorden Subject: [PATCH v5 5/6] wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd Date: Tue, 4 Mar 2025 16:08:50 -0800 Message-Id: <20250305000851.493671-5-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250305000851.493671-1-sean.wang@kernel.org> References: <20250305000851.493671-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-20250304_160915_492771_EF086EE9 X-CRM114-Status: GOOD ( 12.29 ) 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 Integrate *mlo_sta_cmd and *sta_cmd for the MLO firmware. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang Signed-off-by: Sean Wang Tested-by: Caleb Jorden Signed-off-by: Ming Yen Hsieh --- v2: 1) generate the patch based on the latest mt76 tree 2) update the commit message v3: 1) fixed the merge conflict v4: 1) added tested-by tag 2) removed the unrelated files v5: 1) update co-developed-by tag 2) rebase to wireless.git --- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 64 ++----------------- 1 file changed, 4 insertions(+), 60 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 4c133200c70b..34e7165d1a0f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1820,49 +1820,6 @@ mt7925_mcu_sta_mld_tlv(struct sk_buff *skb, } } -static int -mt7925_mcu_sta_cmd(struct mt76_phy *phy, - struct mt76_sta_cmd_info *info) -{ - struct mt76_vif_link *mvif = (struct mt76_vif_link *)info->vif->drv_priv; - struct mt76_dev *dev = phy->dev; - struct sk_buff *skb; - int conn_state; - - skb = __mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid, - MT7925_STA_UPDATE_MAX_SIZE); - if (IS_ERR(skb)) - return PTR_ERR(skb); - - conn_state = info->enable ? CONN_STATE_PORT_SECURE : - CONN_STATE_DISCONNECT; - if (info->link_sta) - mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf, - info->link_sta, - conn_state, info->newly); - if (info->link_sta && info->enable) { - mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta); - mt7925_mcu_sta_ht_tlv(skb, info->link_sta); - mt7925_mcu_sta_vht_tlv(skb, info->link_sta); - mt76_connac_mcu_sta_uapsd(skb, info->vif, info->link_sta->sta); - mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta); - mt7925_mcu_sta_he_tlv(skb, info->link_sta); - mt7925_mcu_sta_he_6g_tlv(skb, info->link_sta); - mt7925_mcu_sta_eht_tlv(skb, info->link_sta); - mt7925_mcu_sta_rate_ctrl_tlv(skb, info->vif, - info->link_sta); - mt7925_mcu_sta_state_v2_tlv(phy, skb, info->link_sta, - info->vif, info->rcpi, - info->state); - mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta); - } - - if (info->enable) - mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta); - - return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true); -} - static void mt7925_mcu_sta_remove_tlv(struct sk_buff *skb) { @@ -1875,8 +1832,8 @@ mt7925_mcu_sta_remove_tlv(struct sk_buff *skb) } static int -mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy, - struct mt76_sta_cmd_info *info) +mt7925_mcu_sta_cmd(struct mt76_phy *phy, + struct mt76_sta_cmd_info *info) { struct mt792x_vif *mvif = (struct mt792x_vif *)info->vif->drv_priv; struct mt76_dev *dev = phy->dev; @@ -1890,12 +1847,10 @@ mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy, if (IS_ERR(skb)) return PTR_ERR(skb); - if (info->enable) + if (info->enable && info->link_sta) { mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf, info->link_sta, info->enable, info->newly); - - if (info->enable && info->link_sta) { mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta); mt7925_mcu_sta_ht_tlv(skb, info->link_sta); mt7925_mcu_sta_vht_tlv(skb, info->link_sta); @@ -1946,7 +1901,6 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev, }; struct mt792x_sta *msta; struct mt792x_link_sta *mlink; - int err; if (link_sta) { msta = (struct mt792x_sta *)link_sta->sta->drv_priv; @@ -1954,17 +1908,7 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev, } info.wcid = link_sta ? &mlink->wcid : &mvif->sta.deflink.wcid; - 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); - else - err = mt7925_mcu_sta_cmd(&dev->mphy, &info); - - return err; + return mt7925_mcu_sta_cmd(&dev->mphy, &info); } int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev,