From patchwork Wed Feb 26 02:56:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 13991439 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 5B112C021BE for ; Wed, 26 Feb 2025 02:57: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=ky/E/gk2IbGf3P6mKrf8CYE7N91ey2oDG6HZ3mRTMOw=; b=hhkBJFbfDCcktg5oUuBxkgrBEj o+DNdHGmmSHNCKtq2WUvRJiqngr3odKNSH0s/GUHSVhcPcG3/CZ15Vei4yGp3kfgU6rX9h648RnOo ZIIgTaGjFED90m07zDN1rUx1dgXvDmGzxuYvJNsaQuYCAIsvqhASdbO38+dX/v5nqIKwQzu0ivcyr 56dTun3jw12fuWDYp4DjFV7+fckiXob2K0gdZZe7RD6J9h3OyI0wBnBoTESyNoAxh8LyGXUQZjRx/ ksPv4RpHePNk5OFWA46sESGAfAIkeGFDSxdAh/pBpRNMjRDcadY1564BDpJHCyHRkCmT/8rwIHZuy U3xA7aWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tn7bj-00000002ERA-1sPr; Wed, 26 Feb 2025 02:57:11 +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 1tn7bh-00000002EQA-1Lkw for linux-mediatek@lists.infradead.org; Wed, 26 Feb 2025 02:57:10 +0000 Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-2c11ddc865eso294443fac.3 for ; Tue, 25 Feb 2025 18:57:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740538628; x=1741143428; 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=ky/E/gk2IbGf3P6mKrf8CYE7N91ey2oDG6HZ3mRTMOw=; b=D5RJQlA0UWqVN3b60mHObJPhe8kXy3F65qom8d5w+9BKVGwf8jHRliA6L1cK7GnTlk /JX4vw7M+bCKflB+5mUAptKA/eM4tt+i9A11qGO7unr7T/2vbgXMuJbFZbVMaFfB74jn OcY9TZxLgzoD7t7mLQK/iSKpeJDbpgScVXbDz6R1wmQfKWI8ybofNBNCGbFSy2KKx47i 3yrpuc1D5FOfz3nziv1FonOlkZg6zLCBwrSJJ/AxQW/QZDvXRzfNPZios6MNjxko9sBw WlhPWNNTPZrSl4e7qSpeG28qXPTy3tDE34EtMpUzPD/THwb8IHt4/qN80PythSezdiix s80g== X-Forwarded-Encrypted: i=1; AJvYcCUQXhcIirQ58mDjy/NeWfhLQeYGjYnEDOX6Wzzkky0rwqK/cs6aYfHlWrDQzJzP7ba/vwN/ycoSBLUOn1eH0Q==@lists.infradead.org X-Gm-Message-State: AOJu0Yx5Zyt3GmsJOuX9ElIZh8KPWZGRfW38uPSb3BNrYZrZAh+uL3FO dYH425q5xFzWKIN9zewBlSW7Vk1UGC9jiMJh0AVvTfUE0NzDfU3b X-Gm-Gg: ASbGnct7jmNSqlviHwyLQ1K5upIAc+2aPtSvytCKQf6avqFS+I/qxCLJzOLG4BS2B1q X0/U3McYCAutJQvunSLTIzHRNKS8L38HBiwVCNHJqKhQNztIhDu1FLt7s2Vnb5H+AYTMyyD/XF5 dfwfXGahssm50SDqkrrNzPSq3Rx72PKo9fR7OgPw0vCFjb57DtvlDpuCfD7R1rfLgYUTYvFcdDU SLb6baYB72iDeyoCZwsMbvQQzlQd8fa+hY8s45IOZbPnW3M2MnnbYuYJy8aZkRoGAtG27byXUUk /GJ98pRw5SsK1/BMXyNj3W94PvKVrCCQFQmJkbbin1E= X-Google-Smtp-Source: AGHT+IEtZju1Rl1egzmGRBcenriEnSnl7o/IjuwHVbSdPyLu15BX9lgZop131Px3youvTRzGGC10tQ== X-Received: by 2002:a05:6871:d217:b0:29e:7a13:1341 with SMTP id 586e51a60fabf-2c10f1d2310mr3493852fac.8.1740538628675; Tue, 25 Feb 2025 18:57:08 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2c1113f0135sm676360fac.27.2025.02.25.18.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 18:57:07 -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 v4 5/6] wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd Date: Tue, 25 Feb 2025 18:56:46 -0800 Message-Id: <20250226025647.102904-5-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250226025647.102904-1-sean.wang@kernel.org> References: <20250226025647.102904-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-20250225_185709_362708_66CAAA42 X-CRM114-Status: GOOD ( 12.48 ) 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 Signed-off-by: Ming Yen Hsieh Tested-by: Caleb Jorden Signed-off-by: Sean Wang --- 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 --- .../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,