Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp83291lqp; Tue, 21 May 2024 19:46:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYMobebRd7QOP17W37j0u+dO9CeVlSacwHJXQAsUnU+xcMOH9pTi+NPFySLEss0d2Hspm2/U36ZSaNN/nkZQTN3H7+yHDEHZ3Bd/QXtQ== X-Google-Smtp-Source: AGHT+IGdil85OUQU8Cd+i2cmnpDc9ke+qA5DDKbVoENRgRt1fIjG+Bl3FTjNGqzPNPcCcyUcUdiE X-Received: by 2002:a17:906:a43:b0:a59:af85:17ed with SMTP id a640c23a62f3a-a62232b587bmr64982366b.28.1716345965415; Tue, 21 May 2024 19:46:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716345965; cv=pass; d=google.com; s=arc-20160816; b=F1K0U5gGa5aQNIC9vlx3lT0oKtIkUWMTbRLbez4wdVZA9qgaPEZRutPtuAg3xxNslx wSfKobvWxJ/Sj8fwUSqj6lqJTgffULa8oNMbhJD7GYJthJQ/ss23U53BQvkYG9Qxston EqjlA/0ws8ezCXFVgEKoHUqS1/AFog/qxcTx4NkZqIie//n000nl76Idl3FHB3z6anhV MdyeaX2xbz/DeWduCmVQPI1/B/URbAEjiXrOlN10Q/EvWdCORwLTTDlgUsK7DKoNH0Qn /qeYZTPSNTCzDDoNfMiRBCC/MTyUfAoSJGExZNtDD0S9UZIBcwkT6JLSigN40s73FoWF ywOQ== 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:message-id:date:subject:cc:to :from; bh=Wc5mjrlKd/lrnAxSZysxmgBl7kjEbSnP9yItvYz6M4s=; fh=cE7VFXx5RvyJxKbMJtti0i3fvFBM4JUdcpU8K9zYwFY=; b=KdanPEnP3szlwfzsLMcNbH5C/7DY+diMH0ElHKjtS+qphCyh8nNB7XlGZc8XzJd7my Q6OEM4Mj+XkECvAMiGP3UPN+bJB5tIQrmnlHkr1PKUjsTR7JO/o8xRa+pyDfBqkBpXKs JmA32yKJXhiDy8A0rWvwtTWWJIE3V+SabrQUvXbxdaKPKN2YKIhriE00hLx52R9ztJBj AqXE+zvJjt2VPV/V0dgsnQL0LnshMGCD9LEM/+LIGeGWYc1pqW5FrZ6mxBk61+2S8Ei/ V73Weiy/FqXVA7jMiwQm6W/9uOuFOsFzI8QM4JW1+nI+U6yqDMvY93tcxw+M+SQAd53S nmdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-7928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7928-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba57d7si1402252466b.656.2024.05.21.19.46.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 19:46:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-7928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7928-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2487E1F234BF for ; Wed, 22 May 2024 02:46:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31E7D1E894; Wed, 22 May 2024 02:45:56 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 DC76B33C9 for ; Wed, 22 May 2024 02:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716345956; cv=none; b=YwU+dLA11zV6tL8xuUejo0mALL+Lkbj1wO+8znITUjyRkPP1CI536iQ8+rRwv/10hVbBRVk7ZUYhKIHS7J9kp6+N4b8zwJJYOlMH0jOFXJLq9GAyiSow7I7JVxgCxgZMiFDp/nguHH3wdpwYok8vrkmsMB3hSz4kJhVcof29lqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716345956; c=relaxed/simple; bh=WWMoPUR2n6MxARQArGDNNKqYaQAkQGg4TMpkFw6BdmA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=G9MIDv2DFbSri6+y6ueoVWMGmHHPNkpVe3bD49s+Ke7SiIuR6vequ1j0nx8hfEDYdGFTUxD0hz/ifFgMVmX9wGM0tYtg+bX5k5NRvnrNhxPoHAOyq5zeHFl2O6eFd66OqNvkFxjbKmUDlC5GbiX57IsOUOKtiLG926Dxvg6h1Cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 44M2jpe173364134, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 44M2jpe173364134 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 May 2024 10:45:51 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 22 May 2024 10:45:51 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 22 May 2024 10:45:51 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH] wifi: rtw89: Fix P2P behavior for WiFi 7 chips Date: Wed, 22 May 2024 10:45:31 +0800 Message-ID: <20240522024531.11401-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) From: Po-Hao Huang Previously we used CCK rate when scanning for P2P on WiFi 7 chips. Fix this by explicitly setting the rate to OFDM 6Mbps. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/fw.c | 10 ++++++++++ drivers/net/wireless/realtek/rtw89/fw.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 044a5b90c7f4..ec559191db1f 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -4850,6 +4850,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, { struct rtw89_hw_scan_info *scan_info = &rtwdev->scan_info; struct rtw89_wait_info *wait = &rtwdev->mac.fw_ofld_wait; + struct cfg80211_scan_request *req = rtwvif->scan_req; struct rtw89_h2c_scanofld_be_macc_role *macc_role; struct rtw89_chan *op = &scan_info->op_chan; struct rtw89_h2c_scanofld_be_opch *opch; @@ -4923,6 +4924,15 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, RTW89_H2C_SCANOFLD_BE_W6_CHAN_PROHIB_LOW); h2c->w7 = le32_encode_bits(option->prohib_chan >> 32, RTW89_H2C_SCANOFLD_BE_W7_CHAN_PROHIB_HIGH); + if (req->no_cck) { + h2c->w0 |= le32_encode_bits(true, RTW89_H2C_SCANOFLD_BE_W0_PROBE_WITH_RATE); + h2c->w8 = le32_encode_bits(RTW89_HW_RATE_OFDM6, + RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_2GHZ) | + le32_encode_bits(RTW89_HW_RATE_OFDM6, + RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_5GHZ) | + le32_encode_bits(RTW89_HW_RATE_OFDM6, + RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_6GHZ); + } ptr += sizeof(*h2c); for (i = 0; i < option->num_macc_role; i++) { diff --git a/drivers/net/wireless/realtek/rtw89/fw.h b/drivers/net/wireless/realtek/rtw89/fw.h index 4151c9d566bd..01fea0b004d3 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.h +++ b/drivers/net/wireless/realtek/rtw89/fw.h @@ -2722,6 +2722,7 @@ struct rtw89_h2c_scanofld_be { #define RTW89_H2C_SCANOFLD_BE_W0_MACID GENMASK(23, 8) #define RTW89_H2C_SCANOFLD_BE_W0_PORT GENMASK(26, 24) #define RTW89_H2C_SCANOFLD_BE_W0_BAND GENMASK(28, 27) +#define RTW89_H2C_SCANOFLD_BE_W0_PROBE_WITH_RATE BIT(29) #define RTW89_H2C_SCANOFLD_BE_W1_NUM_MACC_ROLE GENMASK(7, 0) #define RTW89_H2C_SCANOFLD_BE_W1_NUM_OP GENMASK(15, 8) #define RTW89_H2C_SCANOFLD_BE_W1_NORM_PD GENMASK(31, 16) @@ -2738,6 +2739,9 @@ struct rtw89_h2c_scanofld_be { #define RTW89_H2C_SCANOFLD_BE_W5_MLO_MODE GENMASK(31, 0) #define RTW89_H2C_SCANOFLD_BE_W6_CHAN_PROHIB_LOW GENMASK(31, 0) #define RTW89_H2C_SCANOFLD_BE_W7_CHAN_PROHIB_HIGH GENMASK(31, 0) +#define RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_2GHZ GENMASK(7, 0) +#define RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_5GHZ GENMASK(15, 8) +#define RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_6GHZ GENMASK(23, 16) static inline void RTW89_SET_FWCMD_P2P_MACID(void *cmd, u32 val) { -- 2.25.1