Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1512240rdb; Mon, 8 Jan 2024 01:13:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5ycrh8S34AtFsn2wW3HEfw7TY4SeHNgyCm0wso/wDDjLJsYb6B/jX4Xi83UbQ3DRoyxUY X-Received: by 2002:a19:9118:0:b0:50e:5266:1007 with SMTP id t24-20020a199118000000b0050e52661007mr1009194lfd.135.1704705213753; Mon, 08 Jan 2024 01:13:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704705213; cv=none; d=google.com; s=arc-20160816; b=GOyF+/k1sGZZnZdyzoa8ZAzJhYaEBvAhaAyG1eh36ezasRraAm26eSkRVqmMWv6yCA 3E58HgWQyc58JKUQoKq+WwTzu86ybhB7HtvhToI8wfwHIEzx1jY5a3AF0Txr1KYzTllF pekRhxVX80TnKFHRNu7otU8T7R9DJKegW5UKBIO93qEngNz31OOKRbnDSELRrJFjOKvh kX0cDf0p0AULyeU0VGLbxdi2nW0YHKdglWIq5tMgNxLrs6X+YbUxvz7l8rd7W6KB4hs/ pzIekOyqKJHr9C7BWEV1HPr6CXdZpUuCF1rLree+xTwCMb7MpRG+YD9ReA33O+L4XPO5 JMkA== ARC-Message-Signature: i=1; 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; bh=BXfZohvUYVJ4eXzBuj7rX5NvgtWNAnHStam3sNpq0gI=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=MGHqNP0iRuuhkxzPIGW8dvHlQEaWcxMtfeARfPzjlVUJ2MPuhzyT7gNUC4YVdOU5/N re227KnTN8lr+8sH6M/GppoO7HZiCfA9AFGC9lW4ZNvrEfsBFEwKWTNllGeOvrPcKkc+ JL+rbuEGP+1JtvIaeg/ncTC7eFsc8WJF6twvkpbRh+kdfqYn4e0Qxa7wy/OckJR2dUN0 mHNiLw+UTaDExU4Y+1zGoiFd55QQQtAT0SedkAOXt/r9TBL2tAYuZwszUu4eOumLX84D ZZSUzgb+YzAWP1trk9y8CHoKVldItyx3DGL/J9KpNGgALVtdmUJVhwdKJeKNTxYaoN/q G96A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-1580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1580-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 k17-20020a508ad1000000b0055411a2bb22si3124498edk.371.2024.01.08.01.13.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:13:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1580-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; spf=pass (google.com: domain of linux-wireless+bounces-1580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1580-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 8C5341F20C16 for ; Mon, 8 Jan 2024 09:13:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1832411CB0; Mon, 8 Jan 2024 09:13:19 +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 B498211C87 for ; Mon, 8 Jan 2024 09:13:17 +0000 (UTC) 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 4089DCVB03873272, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4089DCVB03873272 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jan 2024 17:13:12 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Mon, 8 Jan 2024 17:13:12 +0800 Received: from [127.0.1.1] (172.21.69.94) by RTEXDAG02.realtek.com.tw (172.21.6.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 8 Jan 2024 17:13:12 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 06/10] wifi: rtw89: refine H2C command that pause transmitting by MAC ID Date: Mon, 8 Jan 2024 17:13:07 +0800 Message-ID: <20240108091307.67296-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240108091134.67007-1-pkshih@realtek.com> References: <20240108091134.67007-1-pkshih@realtek.com> 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 RTEXDAG02.realtek.com.tw (172.21.6.101) X-KSE-ServerInfo: RTEXDAG02.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback To reuse this function to support extended H2C command that is used by newer chip, change to use a pointer to fill pause ID and mask. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/fw.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 61ae8e584a3b..991c42c4e509 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -2489,20 +2489,23 @@ int rtw89_fw_h2c_notify_dbcc(struct rtw89_dev *rtwdev, bool en) int rtw89_fw_h2c_macid_pause(struct rtw89_dev *rtwdev, u8 sh, u8 grp, bool pause) { - struct rtw89_fw_macid_pause_grp h2c = {{0}}; - u8 len = sizeof(struct rtw89_fw_macid_pause_grp); + struct rtw89_fw_macid_pause_grp *h2c; + __le32 set = cpu_to_le32(BIT(sh)); + u8 len = sizeof(*h2c); struct sk_buff *skb; int ret; - skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, H2C_JOIN_INFO_LEN); + skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len); if (!skb) { - rtw89_err(rtwdev, "failed to alloc skb for h2c join\n"); + rtw89_err(rtwdev, "failed to alloc skb for h2c macid pause\n"); return -ENOMEM; } - h2c.mask_grp[grp] = cpu_to_le32(BIT(sh)); + skb_put(skb, len); + h2c = (struct rtw89_fw_macid_pause_grp *)skb->data; + + h2c->mask_grp[grp] = set; if (pause) - h2c.pause_grp[grp] = cpu_to_le32(BIT(sh)); - skb_put_data(skb, &h2c, len); + h2c->pause_grp[grp] = set; rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C, H2C_CAT_MAC, H2C_CL_MAC_FW_OFLD, -- 2.25.1