Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2373483lqp; Sun, 24 Mar 2024 16:25:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2UTMa5jM4lI3+YD08PXpC6BdKjh0H4pOSnrbQh4hdzo0V/s8kxF2le3ST0ibpNeK0kz7p+IY4UqC/gPqEmVZIyOa2wtZ5JhWFzToXNQ== X-Google-Smtp-Source: AGHT+IG4FpQ3ebGSXwdt5LGHKDu+y28A8G1zfh/hbR1Sq8SscpAYAn7RDrnRWUOjsDsyvKlHkXtP X-Received: by 2002:a05:6870:1a8b:b0:222:62d4:e858 with SMTP id ef11-20020a0568701a8b00b0022262d4e858mr4929427oab.6.1711322753641; Sun, 24 Mar 2024 16:25:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711322753; cv=pass; d=google.com; s=arc-20160816; b=GusTY7v36M+RNnq1ny+twj+PLWIQ6CdvhD9nMpyEcrYMVXFTqmZaIFW9dT3fhZSp+X ZRpMlCzR4+G/9TaC14Gs761vbnIO22bzhi3RhUlvQaNK0XfpZ2PwPqzUQkoQ695NxTYC IKSx6EO9gB2NKAO4WC8WnqHuYUzZpEGSb4xvChSM9n/w+prfQtH4rYSoLiOmPxWJeV8L fLnxdDNchcuBHKL0YO9RWuQEELKdSq7GKVPjI+cEmfJb4yZ6NHa7LQ0VCqYyNewpTcIT QoogN73bpL93/1xJx98NN3Ij18zfLe160oPDvoer7pUj/IRe1XPgp685hAIizj6MDuss bYcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TjtSrwggd/iNQ56fYa0vgie20dOJCk47yaJTMz96wP4=; fh=Fmpyiyy1etQsSyEu/EUVm4ZrHOy5jk2WN6VB/3tijeA=; b=l3U6EEOUM5TYrV0ou9LEDKco/p+fqoKGxUi8VMN/UqmRFvlJq4l7AK3xNns+mYGuRG YOiB1Cn4ZSkQo5vEmfviLyTLdzRWPNPQ1rT75SnIWOe5xugCaZf6dlpR4xWR/IsnlQGX 8wecALcWMOGhcvzwrfW3BavfEmVN5/CRLAbWzUVB0lPcxro0fglRK9S6X7+61l/vtgFz mPoaBAb4hc4w2eDnUARdSjvpZogXnGNM80VcSdGbBxQfwauNlDqYnDh2CzA0v2f36xdx Ddfu5FKfN9AvYkcLH+gKIPv1bDmCDhoB7IpE+hpWkoa8PrPiVRNdhPdac1625yDMkjQi Z1kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O2GDAEI7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113122-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gc13-20020a05622a59cd00b00430eea17489si4296757qtb.454.2024.03.24.16.25.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O2GDAEI7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113122-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4EFD81C21C85 for ; Sun, 24 Mar 2024 23:25:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C25A415CD57; Sun, 24 Mar 2024 22:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O2GDAEI7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD03215B997; Sun, 24 Mar 2024 22:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319929; cv=none; b=QP7U9Ns/18wiZLzVyW8Kuo1NovEnrV+S8RvNMjFYmY801L/feWZVFHia/usNexF89xAJUYhnLPCdnFSfu+qQUuKQqhL9pZVrAOwRFhbi4sAXob0V3iLsrCg8cR7VAvvcrzPPlFPbSfXpfeWmx4xqy7GZzuHn3Wcq9pYpxYYPWqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319929; c=relaxed/simple; bh=n/QDKm2Is9NtqPda8nZ0fr078Cx7AGlR/QVlfMhzCj4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hqp3a8noVwMuhv/ynAYbex4pdCERXz0hc1CgqRDsN2koxEADlPoBFNySYi/ldF+3MLA5JkbhlKoFS9objB6KQU/6m7TLbucM31zGL/ZsnYOa41hC+F43sfrLdxp08EVxF2TT65N/0kgxXBu5uUzpFOiiDhqDGDs79rd5oRvenbY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O2GDAEI7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7BE0C43390; Sun, 24 Mar 2024 22:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319929; bh=n/QDKm2Is9NtqPda8nZ0fr078Cx7AGlR/QVlfMhzCj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2GDAEI7lDpIO4gdItRrM9+3KsvtfQwhZAic+U5DqmTpDIZKnrNXl3b7CKnk1094e ajsF+XfrCiKz+hGbLvFB793vvY2R0VfVlJUC+PM9AET2kJz9Ba3aO3Yc2slqvSzdIO B4Pg01xzxh+XWstTSgUOf3a0i72tEE+VyAEBuUBxrkNxfvDZrdONfL0pnMXyxaI+wR lChIX5mHp1G/YjrMw+HduaE85LNO6t2EQMXgYvzGGl5YtMDE3uolB1wMgpUfdGucjf Yk+iFjf/AVGz27+iHN23UCBhqutrthfClpVsRyNLS2BPzQYSEJ1SqidWN4JAyAtc5l XR0r5PRjSJV/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "rong.yan" , Ming Yen Hsieh , Felix Fietkau , Sasha Levin Subject: [PATCH 6.8 235/715] wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band Date: Sun, 24 Mar 2024 18:26:54 -0400 Message-ID: <20240324223455.1342824-236-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: "rong.yan" [ Upstream commit 243cecc857735344473ea33a713cd5c2ec1fe347 ] Driver should configure basic rate and phy mode for SAP mode. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: rong.yan Signed-off-by: Ming Yen Hsieh Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 3 +++ drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt7925/mcu.h | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h index ae6d0179727df..db96ddbeb9e70 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h @@ -935,6 +935,9 @@ enum { PHY_TYPE_INDEX_NUM }; +#define HR_DSSS_ERP_BASIC_RATE GENMASK(3, 0) +#define OFDM_BASIC_RATE (BIT(6) | BIT(8) | BIT(10)) + #define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) #define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) #define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 1fc9ecb96bc43..9a8db9b1a4f2b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -2047,9 +2047,9 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb, struct cfg80211_chan_def *chandef = ctx ? &ctx->def : &phy->chandef; enum nl80211_band band = chandef->chan->band; struct mt76_connac_bss_basic_tlv *basic_req; - u8 idx, basic_phy; struct tlv *tlv; int conn_type; + u8 idx; tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_BASIC, sizeof(*basic_req)); basic_req = (struct mt76_connac_bss_basic_tlv *)tlv; @@ -2060,8 +2060,10 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb, basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band, sta); - basic_phy = mt76_connac_get_phy_mode_v2(phy, vif, band, sta); - basic_req->nonht_basic_phy = cpu_to_le16(basic_phy); + if (band == NL80211_BAND_2GHZ) + basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_ERP_INDEX); + else + basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_OFDM_INDEX); memcpy(basic_req->bssid, vif->bss_conf.bssid, ETH_ALEN); basic_req->phymode = mt76_connac_get_phy_mode(phy, vif, band, sta); @@ -2165,6 +2167,11 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy, bmc = (struct bss_rate_tlv *)tlv; + if (band == NL80211_BAND_2GHZ) + bmc->basic_rate = cpu_to_le16(HR_DSSS_ERP_BASIC_RATE); + else + bmc->basic_rate = cpu_to_le16(OFDM_BASIC_RATE); + bmc->short_preamble = (band == NL80211_BAND_2GHZ); bmc->bc_fixed_rate = idx; bmc->mc_fixed_rate = idx; diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h index 3c41e21303b1f..0218fd2a0eb01 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h @@ -334,7 +334,8 @@ struct bss_req_hdr { struct bss_rate_tlv { __le16 tag; __le16 len; - u8 __rsv1[4]; + u8 __rsv1[2]; + __le16 basic_rate; __le16 bc_trans; __le16 mc_trans; u8 short_preamble; -- 2.43.0