From patchwork Wed Dec 11 01:19:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849720 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15DE12451D0 for ; Wed, 11 Dec 2024 01:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879983; cv=none; b=I303Q7kjTIYqrL6ZLt4jurTrqXXTmX+HZCuBYoJOk9uCbQDny3o1OWZkMgO/G6hHFAB/oMseBLF/iwNW9hIy2fdCVeIMmOOhplYCZuZF9uXaEz3VG+kUV2fBp68k992Frigqhic4vnYqtUp3bGWG9p5BE6SHPd9wG2SmIC+fn3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879983; c=relaxed/simple; bh=HsDP+ktQDnTCTV73AHp2cMqdWdKNB1b2/EmOlwMgjA0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qn+Ih++HkH7o1CYBAAPMFz08gRbkVf+p1M7FPisY30SbCe9o9rsWa0QvsnLSjrp5lXyKNTD9ObTCQYAwSo0Py0JKvxOuQL93LtqiPUnWl4O0aIbUZx18f9WM3n8kuZMp32rcegi4a+GhMuIhj8hwCct8VksXHnGSLn89KtdrIRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-29e5c0c46c3so3195990fac.3 for ; Tue, 10 Dec 2024 17:19:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879981; x=1734484781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zAlj/teGsDEq9AqLoVCNv/Q4QETD233FzVs6JHfwoUg=; b=ZC1trDGDkrQN/RkMuL7v2Xo2klNSR7aeWJn6ur2JGFCI7cNkxNmwdwImFKPX1ppP7C gnoYiH+XoiCzeDgPMhJTGQ4wZd9azdYJ8kG7S6ADDeRzODnhN7LBGRbDrpmF3fpjik0R RCmQ2DZ+3blLNTHdYTKfAqZNzj9BLSj2/cDUbyYvr0KhpmFcA57qRARa8yyEJxEKipk8 5+Nu3oJdINNbkmuXKQlDItUW3Tbbh5l3LCxBhLiqUh5H2cZNn5uNtJwtuxfrT0v9sFkl UsKfYALbPBkSq5ig0r/+qeKtQHxKtZTPexkTVgduQKrjiLotxPlLGpc3GDoJotdxT7Ys aVGg== X-Forwarded-Encrypted: i=1; AJvYcCXw4BfivDplrB8b3jQACxiFzPHqJ3sDdZosqu9IANxFPOkdRagzokMybmM1InkmfKSRoNjsJUpjyG1nZ2QbxA==@vger.kernel.org X-Gm-Message-State: AOJu0Yx3KDUIwQSn9uCr1EULKlaUmrXACCdSzxshGXCmnV/3JDEOqai0 W7v3ZvpZdigPrtYvgIzzXxBMHEuKi4AeF3CMmxr7KZLqddr8w7Yy/TSBGd6g6NI= X-Gm-Gg: ASbGnctKXS9d7G1ULJkz0Fu+/7TvNWZDAOpf5plLGcCwrtNAcsZvZMlH1FcANwtycZp 7vc6dt2R8kEhs03JVPq077UqyRiPR+qKjZW0mp3geZhpIBwHNwSVGQEV2vYyY/56l7Nr7BRA8+Z Xu40s42AGlWiFoBdugecK1YBx317yVA4r1Nr2DGqXok+wTDVRrmPnHcxaBOYBL6vnA3eGAeKRmd QMO4FdTUBLbBa3pROjOcfnDEjaMGG4pZPf+cQv/5A2hrk+1boGhqyD1UOzGuv+x6Nd8dro= X-Google-Smtp-Source: AGHT+IEKGtkKMDcOAvSZPb9fRrb8ifnKVB5UFdmFjXR1LR7QbnJ19pUR1iRC2SZdihLd7LrZZ/euWA== X-Received: by 2002:a05:6870:3286:b0:289:2126:6826 with SMTP id 586e51a60fabf-2a012d9ce35mr796668fac.30.1733879981290; Tue, 10 Dec 2024 17:19:41 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:39 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 02/17] wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support Date: Tue, 10 Dec 2024 17:19:11 -0800 Message-Id: <20241211011926.5002-2-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh For this TLV, the address should be set to the MLD address rather than the link address. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 0c2a2337c313..7189d4f6dd4c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -2463,6 +2463,7 @@ static void mt7925_mcu_bss_mld_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf) { + struct ieee80211_vif *vif = link_conf->vif; struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf); struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv; struct bss_mld_tlv *mld; @@ -2483,7 +2484,7 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb, mld->eml_enable = !!(link_conf->vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP); - memcpy(mld->mac_addr, link_conf->addr, ETH_ALEN); + memcpy(mld->mac_addr, vif->addr, ETH_ALEN); } static void From patchwork Wed Dec 11 01:19:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849719 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEE042451D0 for ; Wed, 11 Dec 2024 01:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879993; cv=none; b=mh2rusWdxMiXKYo7vkKNYPlu+HM2RtiHxlqKk63hJfHSovFWHqHsLY7MtEglhPo2bHOY2O8Ue6jiKaM9F109EcPxsSGY73AWj+4aOhmCdJTVX6/F6Z8YB+qsHpVzWg46BRJLkt5d5SCfB1++pWkFk4W9JoS7933GOKOjzBA7ydo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733879993; c=relaxed/simple; bh=veCj8jswodCHOWoK/0Hw2g6RuJ5G96o8XzB7nZpGOFk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TiIfWzHeC5t4v1MBMjTTn31ZjeKnaW8oKMU4WwdrbcbvEodell/zHvgzTiFzUowV1BRlARekHDnG5MTaPSx6DOAm7lcs53n/O2T5MA8Euon/mkA8C5yRkCZQAHPwFQDiLrMMhNWcRHAXun7gpJtF7O2v7vgQdtutbLVcicwXHXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-71e02eda71dso903910a34.0 for ; Tue, 10 Dec 2024 17:19:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879991; x=1734484791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rpVhxS7jqXsBo8scTDy0x+y6eI+LhzVWJoven7CoWuY=; b=KK+Wx8v9mUeTKUvph6+GJeASMHc5a+Ll7G0FcTyK6JpyPIop/7k2EKozK8/z4j1fSq raFEL3yAf0Wvrls1hbOR8YxB1B5rX7fCLrOHdNGGAu9EfeRmZNhozkmC/YshiRxtjNmV 8njKfk9QHx73qTsjCU8RenesLQjL8A780VjieHrWUcdG/HI73gstETJZ+q1eGUk+w1fX wI4ez99PPhsUkXvhYj7fcOJaj2AIpOB2Rc33NrA9/V5KC3gIrIp2iNisQpEonbb+2ykd Bh5SNGfQS7ac+JwrFSbPT/H4H1TAxViG2YxBTT9ILFJ+HBqapKOp3NVYGi9w0LDc8ThQ Kifw== X-Forwarded-Encrypted: i=1; AJvYcCW5Y5+0tYSh89NthWF3FmCB2j+akiWsWSoFKWpDw9Ry3Z8dtUPKPl3T9DVfBVZm+6kmLUE3UbsZe+tq8pz1Jw==@vger.kernel.org X-Gm-Message-State: AOJu0YwKTYD05ms1/Mr3C8yKKjiY4wVhmN31pyaD/Cp/fu0pv2HMqpCf Rl6wuywQg0VUWtfVmbzqznNLl38JUq4s1kFfBoauJtmp2MSgDzpgwh1pzCrwqwA= X-Gm-Gg: ASbGncun/jiuuDI4rfmsSNaD72XW+4ijpU3su/xLzODaRJ6H0K6lCgFOnu4d8hIgs23 0hQhGcCXOCEkYZ32Lnf0YPx28w+vp8Ue7l3GdCJJRH/p9bNajsWWg8eGgnnRDOzETMAp6RcXOAo xOIEWPnvlZEqt3z+yexhw1d3bWXJ29rKr96MxDvePzsLa48Bhl9FT9RrnCCzdDR/LdMNix3+oPc vNDm/f7gfugHvoalaNeLa88JRqxKlq+xuBQrzJiCqUSIIMeAyVtJxJMRtYpufYPZKquwew= X-Google-Smtp-Source: AGHT+IF5I9BChu/+PnBYCjP290N4JLBxE7ykFbbUyl855H1vZYnMKRE0FkIgujm7qjIVOEwqqEU5Sw== X-Received: by 2002:a05:6870:a104:b0:29e:255e:9540 with SMTP id 586e51a60fabf-2a012f9fd92mr745313fac.35.1733879991082; Tue, 10 Dec 2024 17:19:51 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:49 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, Eric-SY Chang Subject: [PATCH 04/17] wifi: mt76: mt7925: Fix incorrect band_idx setting when enabling sniffer mode Date: Tue, 10 Dec 2024 17:19:13 -0800 Message-Id: <20241211011926.5002-4-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Eric-SY Chang In the current sniffer mode, the band_idx must be set to 0. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Eric-SY Chang Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 7189d4f6dd4c..83f237d49c26 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1976,8 +1976,6 @@ int mt7925_get_txpwr_info(struct mt792x_dev *dev, u8 band_idx, struct mt7925_txp int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif, bool enable) { - struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; - struct { struct { u8 band_idx; @@ -1991,7 +1989,7 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif, } __packed enable; } __packed req = { .hdr = { - .band_idx = mvif->bss_conf.mt76.band_idx, + .band_idx = 0, }, .enable = { .tag = cpu_to_le16(UNI_SNIFFER_ENABLE), From patchwork Wed Dec 11 01:19:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849718 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D1E522098 for ; Wed, 11 Dec 2024 01:19:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880000; cv=none; b=RRsnI2LgR742pixj0uInYDTrGEVwGNkOquP7Q71L2Kxn5ygaCAWNpwLUb8CuMSfVbmlVDS192mfpFFRbqShxojRvi8SbwoLHur9EpszAqlQNKfLhN/74XodlneyEDNvtBf/g2ez7sOUOOBhCmG6g2ww8LKoB3aO0/HzRXpwrziA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880000; c=relaxed/simple; bh=tKxK8ku2yAnUtRd0m+X8zKnILJlXjJaoAvpA9novS2M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=i340nq/nmc2H6ZTxDZXv4Yt/Ut+JTiZG4OOUTTwoDqnsHWnk6vY7+AIgcWY4+s076R8OUs/M86i1R9sIn9POWumEwao8kEee/NpN0UuOhhcuQju/U259pRoDZ4LPSMD2NLIQALL4qMG2G7EndinlimAfXfRZRAWi2ZIdnE0Aptk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-29e2a50586dso3245710fac.0 for ; Tue, 10 Dec 2024 17:19:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879998; x=1734484798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yk49pXqoMYWny8tmzY5u5tahMKAPgzxyn6k/GluClh0=; b=LvrHCqmUyflEI/PNoUQCK5c7HDBrjVg5SkllPJbghWFQmgrAsnlcU01zBX7trwt79V sG4+pvVFRyI3GOUDybVWfijABvNAtGdL/aMddlHVELR+DFqRplgSJidWURn2rDCZwxu7 2cYno9dmOst1pcVsHPQ0Rqq73h4drFauVE1oPO9bXfR7jLJ3frXVQVoc/Rj9U7PeDmYx 1/GovMSi4vPjBwFnDp6edKrKysGiEoq8cs6pLzfZEPkFeHguiU+iOXJ2wA++gRK0vKbV WDoLHfb+0PyDo1bmo2cc8jtJRcLyO1fYHaFk48NQ2f7wrw78DmU711v6Zrw8Ix2kh32o swpw== X-Forwarded-Encrypted: i=1; AJvYcCXE5XxE9hnOwn20k9zOfhmAIgcQ57U4kG0UXlg/uOGUQHyGoBRkTXFSSGCIktTJCx9ZehC+2JLlXKKOFaN+ow==@vger.kernel.org X-Gm-Message-State: AOJu0YyzdPGAxEgbFErwOl2kqwmTX/xdAVBwo/fubQPwycSkSON3JPHy cBQwV0BJdCUWW+lbsAqmTv5bIsh+DOo0VAVTgyvRPpbziaIC8ZgV X-Gm-Gg: ASbGncuFvB1ZQlViHmqQfHo5dFn+bBmW7XnbEw1ksY9rlCD3qslkdPPab/PgDroCFdV HWbwhpM71F/D5KThqan6LY72roNSNZWa/4Q8eyc2mnDZfo1Iq3rQRpAMyz74kVGoVXvNO9R8ckR 4ZKvnPB8aED5mTIQWFEz7a5OhncKaLMfCLY4E38a9RlLL/f1fklsVCL2cMho5BNSQoH6F63Qabs iTMcILLa+Nb94KbBgK9a5EfPobcrnWSnCjOFJ1gvIVxoux8g/umAlVRKLfg4qiErrer/kU= X-Google-Smtp-Source: AGHT+IGqPCatQj/2c2jZ6uQhg94tt5NOTEosEEskQiKERWxs5QGjzv/Q6ATe/f81GUUeNedQJy5aqg== X-Received: by 2002:a05:6870:7b49:b0:29f:8a1b:f76a with SMTP id 586e51a60fabf-2a012d9cdb7mr583515fac.28.1733879998456; Tue, 10 Dec 2024 17:19:58 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:19:57 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 06/17] wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info Date: Tue, 10 Dec 2024 17:19:15 -0800 Message-Id: <20241211011926.5002-6-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Fix incorrect parameters for the related channel information command. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 83f237d49c26..f6aa052ca802 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1200,6 +1200,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links, req.roc[i].bw_from_ap = CMD_CBW_20MHZ; req.roc[i].center_chan = center_ch; req.roc[i].center_chan_from_ap = center_ch; + req.roc[i].center_chan2 = 0; + req.roc[i].center_chan2_from_ap = 0; /* STR : 0xfe indicates BAND_ALL with enabling DBDC * EMLSR : 0xff indicates (BAND_AUTO) without DBDC @@ -2177,11 +2179,27 @@ void mt7925_mcu_bss_rlm_tlv(struct sk_buff *skb, struct mt76_phy *phy, req = (struct bss_rlm_tlv *)tlv; req->control_channel = chandef->chan->hw_value; req->center_chan = ieee80211_frequency_to_channel(freq1); - req->center_chan2 = ieee80211_frequency_to_channel(freq2); + req->center_chan2 = 0; req->tx_streams = hweight8(phy->antenna_mask); req->ht_op_info = 4; /* set HT 40M allowed */ req->rx_streams = hweight8(phy->antenna_mask); - req->band = band; + req->center_chan2 = 0; + req->sco = 0; + req->band = 1; + + switch (band) { + case NL80211_BAND_2GHZ: + req->band = 1; + break; + case NL80211_BAND_5GHZ: + req->band = 2; + break; + case NL80211_BAND_6GHZ: + req->band = 3; + break; + default: + break; + } switch (chandef->width) { case NL80211_CHAN_WIDTH_40: @@ -2192,6 +2210,7 @@ void mt7925_mcu_bss_rlm_tlv(struct sk_buff *skb, struct mt76_phy *phy, break; case NL80211_CHAN_WIDTH_80P80: req->bw = CMD_CBW_8080MHZ; + req->center_chan2 = ieee80211_frequency_to_channel(freq2); break; case NL80211_CHAN_WIDTH_160: req->bw = CMD_CBW_160MHZ; From patchwork Wed Dec 11 01:19:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849717 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B197313C914 for ; Wed, 11 Dec 2024 01:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880008; cv=none; b=sNgpwTeC/yyw/S9pBk+gMW8EMj4s962g1BP3IXix1HH0pRsBoIIOjkSyP0qKruLP49azxiwhoAat376MEkewOyJLlRJLv8irK3YadOTu17dSOnLp4stF5f+rP+5pt6jggASJjJ3MbmfayvWOZs/5sv5qIdI2oJOw2abX/4z7EOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880008; c=relaxed/simple; bh=pK++0OLvgOIrMemRBrSy+rWTQfCSK6vdyInOX1CbyFY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OMQcgyzot7BiubjM+dFqpSx9PmvZfEKr6/YF+wo8CK+uPsw9RECzVWKD9RxIIXgc3ketbosEPwk4bqc4Ay4to03TE3j98wsIikOpDx/Oba8u1imb8kAyAtrabtX07jgaPmFtE6RrmV3ctLRg80DtBhYLQFEYZNOhWh3NDSlStMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-29fcbf3d709so1001539fac.2 for ; Tue, 10 Dec 2024 17:20:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880006; x=1734484806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UEJ5kdrUNfjAy+icZnm1esu6rZ7qPtHroRsyBXfTsTs=; b=czkUdKMwIx7dgtjyvbVbMobs+RDw9ItGbznXLQ6RjuHl+6HpWguXzE+7x9VpAvfB9v XvJl8Nirpolynh7QjldDZqlJYBT/5Uje1/Pi/fok0yqnxE8sXK4q9YnGOb6Dh7AzishC qWL8kOpWRAPWHoCvIGZjaFlXuCwaG+bO5jN/S3jHjKG+WV7/M0geonfGQIpwcQkgRfBz VvH9Er9/FVlWyDGwFf6LhMGbU4tfH/TQ+yKebVAMiZ+N58wVnOMe+Z7zd3V6Xxl8e/3E NWfS5W6vswSO03VNGwX8S3WzR8FVs0VrXKBE1Xq0J7FOn78ZWaVgSUF8qO7fsKAaKULJ 49Lw== X-Forwarded-Encrypted: i=1; AJvYcCUWSKt+2ATMMsltXCiAB8ncdxUzw3mhu+tE483TTvt0IFbQmOEcZD3yPIGvQZoROvMM8Q9UkVnJluD3KzQgGA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw6377kMZLs3WpTMg1B1pIJ+TWXSo79Q2Uepd+aGWAXLzCiU2bN ZVr2q4DrdfgHkXksziqRgkvGLwtSnC5VRcpf3RZd5s2W1r10AStd X-Gm-Gg: ASbGnctR/bxH+6xJtFbwFfzAySm7+klDqFZ/G5hVP1dDMp1/0R6e2ecOmRWn0Qa5wvK emZUpUMKL1Sf/SpC9HMESd9diZazsckdAaw2kY0vJqweTQNHn9/ynjYjiO8GsZxSbilBf1oZLv8 ZJXP9XFjUQrdAVFmRxoaGV5ZvUo60fnr1/tqHxppDfZ6aQM5f90opkallrFTvmxR7dNk1hRiIT5 bH32Dwyi2L/DTll7Ui3F34ffl2lKmVcs3HHkAGt04ri6P1fSG0/TcPX5tzcy6/PyT+Ibxo= X-Google-Smtp-Source: AGHT+IFcQ3gUsYitlfCkN5kLRyrQGJyfYcf884guORROPcDHh0Lvi4yEHkFTf9jFWu3U8jkQsLxilg== X-Received: by 2002:a05:6870:4990:b0:29e:671b:6003 with SMTP id 586e51a60fabf-2a012dc69ddmr561652fac.32.1733880005778; Tue, 10 Dec 2024 17:20:05 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:04 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 08/17] wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO Date: Tue, 10 Dec 2024 17:19:17 -0800 Message-Id: <20241211011926.5002-8-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh In mt7925_mac_link_bss_add(), the mt76_connac_mcu_uni_add_dev() function must be executed only after all parameters have been properly initialized. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 97b48fda5595..93e00a3840fe 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -365,18 +365,14 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, mconf->mt76.omac_idx = ieee80211_vif_is_mld(vif) ? 0 : mconf->mt76.idx; mconf->mt76.band_idx = 0xff; - mconf->mt76.wmm_idx = mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS; + mconf->mt76.wmm_idx = ieee80211_vif_is_mld(vif) ? + 0 : mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS; if (mvif->phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ) mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL + 4; else mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL; - ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, - &mlink->wcid, true); - if (ret) - goto out; - dev->mt76.vif_mask |= BIT_ULL(mconf->mt76.idx); mvif->phy->omac_mask |= BIT_ULL(mconf->mt76.omac_idx); @@ -395,6 +391,12 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev, ewma_rssi_init(&mconf->rssi); rcu_assign_pointer(dev->mt76.wcid[idx], &mlink->wcid); + + ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76, + &mlink->wcid, true); + if (ret) + goto out; + if (vif->txq) { mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq->wcid = idx; From patchwork Wed Dec 11 01:19:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849716 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169D62451D0 for ; Wed, 11 Dec 2024 01:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880014; cv=none; b=O14aNSkTab2rKr02vVtkbwWvI19CjBOhQqW9kbWz6YXoqBr3vz6vgY+iKX2dKT6lOuGZQQNUIXlU3N6+5bYG5JArN5xrauhikUcj4f/m/ytUxe+GZH8DGzL1qBWIJxxS7/wM7H5o4I35diKeRa8GO3muIpvTJYzPjOYiHxHUH2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880014; c=relaxed/simple; bh=Yx9QfPZWzD/XAaCOS2MRiAaAKnxA7XL5d9w+SWB7iwE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JOXnOa5SWOLfiVHtXPKYMHzXrthyu0d54H6NOTtd4P/FZQ1HEnnbavKtHTep6ObAea/qkNz5v11n28V7nq1v//2nYxQguzCRp9QNDQEi1LYFbXhVV1/nq3rO3iAl9XmTyIp5vX8RnENJjszt4bpTRDHO6fOlwm5snhN6jvCgszg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-29e7516ee77so3236835fac.1 for ; Tue, 10 Dec 2024 17:20:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880012; x=1734484812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FV6wsq5yojUFiUHKK/2cJBWsk228RylpQzgVFP9hkUI=; b=ZKZUn8nsdbFZk/lyzQJe5GORxd0LZJJ0xHTJ1NfWgUHER0z44gQB7k1mUWRlPC7sht z8+ylAszOBMyL1Rzu/e7I373XSI3JmwDSldehkei8ZUuo8738iQ7e1JF0Qn+ICunSZyF PlXotIHvYeGPFnpLXOVXzREwLaq+MiYSbJ4XcgFnIIxPQQMSJ3iiIEMh1hcukvKHT3eA F7m4Z0Hux6Z4Hni5JQmzdeKsu3ncHAEAf+T2dPwPFV/M1oKCwPcdlVfHz0ETtix6idZ9 XX53kHedFovFrH0XldF+LQfPZ6YyDJk0hvergyH1OU5XL6XQfczmjVRYFqRKKgXGdThP XA7w== X-Forwarded-Encrypted: i=1; AJvYcCU8xB5Dgq0gcStPNTDhE7dV+Hy4WTDAtyjPYXKFaS/o2SFQyEQP3xnJH3dRGMOFXSn3smks2n6HGUXVX+5k3Q==@vger.kernel.org X-Gm-Message-State: AOJu0Yw9c8JEPsENfUexxwXjImTPsWVQ5GLYSJENf1NjoXGqOuw076qd 2zo7WqJ5XCcFJAOwcXQCtDy34aw7uQA9K7tTxCfwOltF2mBJSpSV X-Gm-Gg: ASbGnctRPE+sULer2kOf6krar5MUFR2y9U1UWRFC+TE9Oii7Ui7Vm+lolH3FqpVZZuu DQdHbBc2dad4uw0578zcSnLkCV4hyh5KBBjfbOnpwoN6bVwm/PynTEPQbuJIUbrJ6JNZ/+g58bw Py2QcuA1GdOFcwJXQLVrozN/tolU5bvExCmyPdTrWSMgbTtZiZR/P+qSsl0BmW+CDqCJIxfZLq8 6sWQt79uRiyqQrbx31h6hAu1TgXD+9N6WW9s/7+w8NMBKcE4Tzhpk5JAID4nkA1dSpCx8o= X-Google-Smtp-Source: AGHT+IGqlBfpoRHgY6cQ59RfOO97L29fROSkxpXSP4o/y0JiWpNvhu6DePzNcIePlys5f39S81NDGg== X-Received: by 2002:a05:6871:e48d:b0:29f:de75:d178 with SMTP id 586e51a60fabf-2a012c541d7mr747405fac.19.1733880012250; Tue, 10 Dec 2024 17:20:12 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:10 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 10/17] wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state Date: Tue, 10 Dec 2024 17:19:19 -0800 Message-Id: <20241211011926.5002-10-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt7925_mcu_sta_update for broadcast (BC) in the ASSOC state. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index d0bfc7711a80..a0df9a4c4b23 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1905,7 +1905,11 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev, mlink = mt792x_sta_to_link(msta, link_sta->link_id); } info.wcid = link_sta ? &mlink->wcid : &mvif->sta.deflink.wcid; - info.newly = link_sta ? state != MT76_STA_INFO_STATE_ASSOC : true; + + if (link_sta) + info.newly = state != MT76_STA_INFO_STATE_ASSOC; + else + info.newly = state == MT76_STA_INFO_STATE_ASSOC ? false : true; if (ieee80211_vif_is_mld(vif)) err = mt7925_mcu_mlo_sta_cmd(&dev->mphy, &info); From patchwork Wed Dec 11 01:19:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849715 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06D0013A265 for ; Wed, 11 Dec 2024 01:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880021; cv=none; b=s14p6fab/D9Oqd2IZcgfoDCYozvhlR+c3YTLDv3y7JoOnhNYTcl69Q7vf3ZJ3GOGLdy8CtThJOfawqOH2UW8kVycZCQbFqHX3I4qngGghaNn3ObG7VGGCo3JtvAPqc9JJtjO3arU2p5QsbMd5b3Tx9ovTXCOT0TNkgPzpumlvok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880021; c=relaxed/simple; bh=lyaVV3yCnlMBmjN18jgHBsblzu4gFx3AJCNAUUj80ms=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OMmzKoCzG64mEO4fYCGDbXN7uq22KhBvSxZQLCigXs1rL+yAhv04EivRkr/UoIA3BEyZM/ipf2RVUGtVciLdmW5FyAMjvKgXkM/l8zuESH/dDBTl8ccum76l2MOkuZih8zQDw/ckiOCaxQCdvxoAgJN02zTN+3QgDb+0dz3zDMM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3eb7934a948so428247b6e.2 for ; Tue, 10 Dec 2024 17:20:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880019; x=1734484819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YvLYpyR5eCI3+Y1o7ii3SvRbYIqhS4yWBFBtNSrsqIo=; b=FkKO+Of84UEhQDPFVnc6VQpZsBv1V6XWM6/xg/VgFRgVl5Sw2Hsxmqvpy54qxDKXWt SmSjaLHbllvzUbzNMZ08s9lT+kzGJ6aclp3NYRys3LDQic+87qEpmyI/wVPEkd/Uq5yj cm0sjBurRNDMo79hzNhe5QZqcvc/p7jB1td8LmVZwhi9/uQv1PTMl9+vEJCfcH5G8Vco fIVlnI2pWExMwDdks++ci4FcYSkDtfV9BoQq+NqqJ6wuQSSO3t8pVrwr3aPxf/fSK6zu qktHRGJ6DKf8oUFQxPWkdwxyGAtoN4a5uZti34MRVC8qEsOonxrcXAJFAxDAtjlOsYb6 tEKw== X-Forwarded-Encrypted: i=1; AJvYcCXjzizRg2dxZzEVpPHmX3PydOCdQK9NSMgEf+bdbboL7LFwaU1eAuwGyMTF5RyNwQWRTWChpIFmgn8Ko4LV1g==@vger.kernel.org X-Gm-Message-State: AOJu0YzT+WsLResjv56Ive63vjd9HfJOPqEyzTxqF1NY66WGWtu388ac 9b3qT661CZMLoXeF6TrWWWPfJe2sBvoI+2lQ4ZaWANTi2kdqpq+sz67j5hS8+ck= X-Gm-Gg: ASbGncsgCGAH4x6RrXtLft4shfGkpz0WB7zSc74UV06CZ/7lxen2apFIRwIJ/AlYYNw gvec7K0BkOmX27wXYsOwbmmS4FGrWJkurFIemlKJ9GcTyJLNdhZl1j8TzWZ5bUaOmSL1lWjtRKV bLKADdsEi/ffKL3uR3bvKKcTyd934g6cWnDuDZ5vpttNr1WmJZD+KuCD9z3YiC3qHXpDR+ZdkYX xcsmKDKaQu3zEGRSIe78MjC0YYb/gUiIoTL2Qsb7OPhX0pnL7uojZfX8kg1T4e+wYjRpf8= X-Google-Smtp-Source: AGHT+IFvjvpgdG+j02OXVpvjD6zMw/zx1NdUsngbozfn/+B6x1XAX1y4CJhegoGRL3gvUB+sxUc79Q== X-Received: by 2002:a05:6870:55d2:b0:287:4904:7125 with SMTP id 586e51a60fabf-2a012db0fd6mr678464fac.14.1733880019143; Tue, 10 Dec 2024 17:20:19 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:17 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 12/17] wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS Date: Tue, 10 Dec 2024 17:19:21 -0800 Message-Id: <20241211011926.5002-12-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Update mt7925_unassign_vif_chanctx to support per-link BSS. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 9e9f33b6a1bb..615d7a370923 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -2090,7 +2090,7 @@ static void mt7925_unassign_vif_chanctx(struct ieee80211_hw *hw, if (vif->type == NL80211_IFTYPE_STATION && mconf == &mvif->bss_conf) - mt7925_mcu_add_bss_info(&dev->phy, NULL, pri_link_conf, + mt7925_mcu_add_bss_info(&dev->phy, NULL, link_conf, NULL, false); } else { mconf = &mvif->bss_conf; From patchwork Wed Dec 11 01:19:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849714 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF0F6175D29 for ; Wed, 11 Dec 2024 01:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880028; cv=none; b=DA0ePB+Zeu0oIwOk6uenUxGLps+BKPsopK2mZyFKL8gFLfRwb3e3HjDY2iIrewqo7uDY7lbQuBBBNlnWY71D0KwEm+mJG86BKgLzhdqJLRWALeXeDvANXMRpSRVcU+8mzt+lRDJAnz8O2Sr3XykQFAIegHeGDmzob1PuAqx+TCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880028; c=relaxed/simple; bh=oAQXu85edx6ZFlDR0EZowb7+o9vXF2s/tU27/RQ9VFM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fip43cTFYpR8m2jJFOBuGtG6VH8aGfQ19c9qvk32A6J1EJ9Dp46q/tAfqkKcDmq5Q3uS69tJjp4+Gk0KSrANKBGiHMdILR7IE5ZesIx5/KZGSRSK0IPVqrJRal7jDExaEBXp1MMvIy/FyJgCS45mX8lb522uG/1522WOJJexuKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3eb569ec0d9so793608b6e.1 for ; Tue, 10 Dec 2024 17:20:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880026; x=1734484826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4sCOLPelO32qVuyU8xDyaBPcPYTcYPDXfN9EW5NAA6Y=; b=fDv2KJU88uYaXvoiI306aBZcNAad1DhWKOwoxJZb7LRcFanD0U5n/6R5SfFfq3VolO 16ihc+fmOPlRpYGancsU4vmxAY8TmjQVH3AGQSpwg7VcWkg53GqVF/EQJvCa8vBLL8Vi ZQt4hGO02jCUcWGNGXoUOZ1B72E+IxMopJkyx1qE0XxUQe7/Rl7g4QdmLnOAgL06gT8G VwjECsTBFKUmzZRtMtwWE66TXUJ2fAFpVECTVZVx988DlxKV2hFsvJYZrs3u+0t1C4y1 FEyPaTjkeZBca450w1jp0xRuACJc1cBLReGL1zNZ0mXJNDmi6y+Eu+Zq7yHLz9ZnAXFf +5WQ== X-Forwarded-Encrypted: i=1; AJvYcCXsCWQp9ZYeZYC7bI+Sb5+MgPuqG9ImM7xTVnEKHjyUIsNmyD8n2FZImBV1wS5UQ8rS7+1Ri+PlzS0tYdhu1A==@vger.kernel.org X-Gm-Message-State: AOJu0Yx4yRCV/MmdkR4hHLGt2XCKiyCFsbNKUEi9do1Tb4kaaS/zQaDd M80V08xt8Chh7VcLmokaskPMbVqhcZBNWtJJ73jwlJ03rAebTyAH X-Gm-Gg: ASbGncsTi03SJfoekflmrP1U47UP6tQ3hS+hmbuhgJQXA+ojqYQNINmnAR8N7J8F5Aw 6LRW/txMHJtbhvjyXhkThGUIFXvZNO+gp0a8UeCnNOxGqjrVoeyGjw7lXJSva+zr9O01jxbyRzK MKVRY/ZK/oDP4+Dc+d6ROiWCv1GMEUIs00mby6hUTMUmvOf6O0ysOEIcAfgQr5s33yMSQJamFWT +5RpMMBJwFF6vJBqo5B8ZLD+JKcC3OW98VG83wZGET+o3VjUNqMungcipCuuzL9tBV+OM4= X-Google-Smtp-Source: AGHT+IG8GhzuwchpKQMFJgrUxyXInhFmPd8FCXfE2Y/ubZ3c+ERwZS6Wcs+IRVz6tFSwIZGIH1lR/Q== X-Received: by 2002:a05:6871:821:b0:29e:3132:5897 with SMTP id 586e51a60fabf-2a012d35af8mr656068fac.5.1733880026039; Tue, 10 Dec 2024 17:20:26 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:25 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 14/17] wifi: mt76: mt7925: Init secondary link PM state Date: Tue, 10 Dec 2024 17:19:23 -0800 Message-Id: <20241211011926.5002-14-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Initialize secondary link PM state. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index f2a0159be9c1..6b2b91a0475e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1989,6 +1989,8 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto free; if (mconf != &mvif->bss_conf) { + mt7925_mcu_set_bss_pm(dev, link_conf, true); + err = mt7925_set_mlo_roc(phy, &mvif->bss_conf, vif->active_links); if (err < 0) From patchwork Wed Dec 11 01:19:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 849713 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8382310A3E for ; Wed, 11 Dec 2024 01:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880036; cv=none; b=fOa8l1UXh+K05E9TA71Gl8PexlDvsIYgbzJzCaDSOgtbN00t1BHUgKHggYNmE3kwxGyY5iCVT0KHWGkfMilWbZKf2hr8LDK/JjrY80h/6IbmcCS04rplLIG4MWmkkZgWqzhzBZNThgPgoyqU7BIM/HMzalsJLKVp+r7CUMbrOFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880036; c=relaxed/simple; bh=Z5fxSJKp/mhKCgl0ICjjXv+timoPQ/BNep2XxOOZKV8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AETuf06CW3c6hj+uVkxSAdovFqm/kdntAAlMzc6shWraYULkHZBTBxL4Jqwn20snBOCMKVgKkhd3jC7dGtzfHvEiGdJ6eMVlqs/u1vVonJvJNolL64jWzrIPW7AO1lDQQOOSFqBq51DFzaaL+PDRRUeDDCkln7XiBpl+1wCfzAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-29737adb604so3134323fac.1 for ; Tue, 10 Dec 2024 17:20:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733880033; x=1734484833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K1YpHXYbDA4VM1WpYLpyHXFxdUkmq+2IyIhunuoKdpQ=; b=doHHsCpysZgplCosULcu/8bBJO2XXzsj27g9rqYfn8dz8Dba4GyOyx/G4m2cryWKz3 IVVjPgmGjjg/VPGO8E/aMmx5FZnmEeu2wTBn+3J0fFhl2TL5NFgJpxgbXM1hIRPwuUEy p1xFU/GuhfN9JHaifoyCLoeazoT/W3h7qsh3MDYCvjbmEquFKUev1TbfIM8rO9Lfa6vm dS40vUde8zhUgvvL5LXP+0j+i2Pj7vpdpGjnqyw37MCw8OvwivBmDVHiy3N/IQw4aKks B1hrJtfAPYE9XoxI9nGCAU0VtZQ22v06ccUK02FEkKe1U4/M7MY2ooaBhvd39OlWGIj6 g76w== X-Forwarded-Encrypted: i=1; AJvYcCWWcn1+btuRFSQopOWOtFABUbt71P0TcIc91n4UQ1mjSbHx622DMF1TVq1Sdg1gyivqkqbURjCOu1ELfE5nYw==@vger.kernel.org X-Gm-Message-State: AOJu0YwAGeO38PXhDcLlbqgttpGiK/DEz8Cb0vqrmVAXgKIDii+uMJZs /xtxNAjeBJLwQAlypTaxkIgThrFvGkapRyiTjgGig6d4TGkXKwN3kXTbC3b5Tok= X-Gm-Gg: ASbGncvA1Gvm3u+g0SQEEF3biCLI6cjh+HJL4uurUx1olXJytyexGNXexFAi/157RiV BYOaLDVZJT4bCw/0W4MKTXhMwb/778teB8/ECazCzFWnRGcsXGytUqt2z7ZdZhJa1EBZ4vSYhQ5 sKQXqLjZ9C7+X86dubulhAL2lwuHwcJTZjcg8oBMtVpqzzgbtg8DuUoWHQtiGvwDlTWADB47tHr voGqQuIYChmfwOoe3b1S0jbL1xXLDLqcaBaqeobPq4FHWzM6/xBxUel/ucHA+fMM5I+vj4= X-Google-Smtp-Source: AGHT+IF0gUkHuRCaOh8UGDwrWZiHIizEzdf2Z5358lrfRXUW5B3uSGUMCpL6znNlITwq0TrtI1wC4w== X-Received: by 2002:a05:6871:430e:b0:27b:55af:ca2b with SMTP id 586e51a60fabf-2a012db1083mr711621fac.11.1733880033574; Tue, 10 Dec 2024 17:20:33 -0800 (PST) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29f93552d34sm2705701fac.24.2024.12.10.17.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 17:20:32 -0800 (PST) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 16/17] wifi: mt76: mt7925: Cleanup MLO settings post-disconnection Date: Tue, 10 Dec 2024 17:19:25 -0800 Message-Id: <20241211011926.5002-16-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241211011926.5002-1-sean.wang@kernel.org> References: <20241211011926.5002-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ming Yen Hsieh Clean up MLO settings after disconnection. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/main.c | 37 ++++++++++++++++++- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 4 +- .../net/wireless/mediatek/mt76/mt7925/mcu.h | 2 +- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index da7a2a798545..9c43437ad9d0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1149,8 +1149,7 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev, struct mt792x_bss_conf *mconf; mconf = mt792x_link_conf_to_mconf(link_conf); - mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, link_conf, - link_sta, false); + mt792x_mac_link_bss_remove(dev, mconf, mlink); } spin_lock_bh(&mdev->sta_poll_lock); @@ -1208,12 +1207,46 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, { struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76); struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv; + struct { + struct { + u8 omac_idx; + u8 band_idx; + __le16 pad; + } __packed hdr; + struct req_tlv { + __le16 tag; + __le16 len; + u8 active; + u8 link_idx; /* hw link idx */ + u8 omac_addr[ETH_ALEN]; + } __packed tlv; + } dev_req = { + .hdr = { + .omac_idx = 0, + .band_idx = 0, + }, + .tlv = { + .tag = cpu_to_le16(DEV_INFO_ACTIVE), + .len = cpu_to_le16(sizeof(struct req_tlv)), + .active = true, + }, + }; unsigned long rem; rem = ieee80211_vif_is_mld(vif) ? msta->valid_links : BIT(0); mt7925_mac_sta_remove_links(dev, vif, sta, rem); + if (ieee80211_vif_is_mld(vif)) { + mt7925_mcu_set_dbdc(&dev->mphy, false); + + /* recovery omac address for the legacy interface */ + memcpy(dev_req.tlv.omac_addr, vif->addr, ETH_ALEN); + mt76_mcu_send_msg(mdev, MCU_UNI_CMD(DEV_INFO_UPDATE), + &dev_req, sizeof(dev_req), true); + + } + if (vif->type == NL80211_IFTYPE_STATION) { struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 551b1827bb40..6675492ec9a8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -2662,7 +2662,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy, MCU_UNI_CMD(BSS_INFO_UPDATE), true); } -int mt7925_mcu_set_dbdc(struct mt76_phy *phy) +int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable) { struct mt76_dev *mdev = phy->dev; @@ -2682,7 +2682,7 @@ int mt7925_mcu_set_dbdc(struct mt76_phy *phy) tlv = mt76_connac_mcu_add_tlv(skb, UNI_MBMC_SETTING, sizeof(*conf)); conf = (struct mbmc_conf_tlv *)tlv; - conf->mbmc_en = 1; + conf->mbmc_en = enable; conf->band = 0; /* unused */ err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SET_DBDC_PARMS), diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h index 31bb8ed2ec51..fe6a613ba008 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h @@ -616,7 +616,7 @@ mt7925_mcu_get_cipher(int cipher) } } -int mt7925_mcu_set_dbdc(struct mt76_phy *phy); +int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable); int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, struct ieee80211_scan_request *scan_req); int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy,