Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1018489lqb; Wed, 17 Apr 2024 19:12:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJ8gEVWB8nRa0dfjLZZ52tjPO2gY0G6kdWb7Kwf6NuiL9OroFF48ZSwf0n3KxUmCCM/bod9LPwHwhRjhabPNGZ9QBPPtCfi+fm1qScUQ== X-Google-Smtp-Source: AGHT+IERkubRDDVBde+xqYvG1FyKf+8vilMvUAXzeMP888n7cgg/LvhBPITpre5FSU90ZDBFJv/j X-Received: by 2002:a50:cd0a:0:b0:56e:3571:189c with SMTP id z10-20020a50cd0a000000b0056e3571189cmr900783edi.18.1713406368719; Wed, 17 Apr 2024 19:12:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713406368; cv=pass; d=google.com; s=arc-20160816; b=V13Jjvl3EHBxttvCGf4ErMFU8FzGaX+wvDL4p9EAn6hyM8fEJwlKYCpfSBh7EgcAU4 Nl8XjrJ3wMQp5j6CavU+dZRReOhJTqOh7J/EDAi4hhXJmJObH9pEyMAmXb0oL1/sizZ/ p8X96u2WJ/+M1OU/8A74YhnpUFjv9GBMVNikFvc1OaUisl1WX7UERJNmE81hoWnVRg0E qfDGFBmV/YCqqjArZAay/wFVNI0lHSVUEuD7ncM1rO9V/Typ9wzIjTQFswRavuwTPId9 AgFJV8XvSFtIMWoI+XkvaAMp6SNJYTt73jXU29ZwIjv5Md4MFOUjPwT2TEOV/abcPi4U buhw== 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; bh=d3UfpODzW2c2qoWidKkBMVxOG7prviQ/vQSzHhZMa9c=; fh=MNKRx4WJmBaVWzQe39dfqMazHXuwPQWBzq8iA6LUjvg=; b=alg7cqk6u/6w4tkCBoVFqPwtb2kdyjsOMRHku//DpttdNN7D+fH1VqBuXUd0BIeD/3 wXi9FVQORARNlHoErSBVgBEpmH1bWbWShWu0R4tFhrsWewXMsTfyhtZBzM+y6qc3FPJs reR03eryIxQHavjm5PnT/tDFoz3q+7jB2GNh9eX2l9G8mXYplYxAk+9Zj2XUHQmjmwbv dmCie4xtFG5sYGzJ0RKzqeZdVZBYodXiBYMJAGvw72nrMa3z++YavlCLyZeA8kpY9VYy EQD0r0HQGLuq3KfLnZUtRJ/8Wkbz3KwfUK3QvaFSn9k7/pYqbe2S+pLCtNI54ox5a0n3 j39w==; 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-6481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6481-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a98-20020a509eeb000000b00571bc1f48casi96235edf.660.2024.04.17.19.12.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 19:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6481-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 578EB1F222BA for ; Thu, 18 Apr 2024 02:12:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 936F04EB58; Thu, 18 Apr 2024 02:12:43 +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 75BA34EB23 for ; Thu, 18 Apr 2024 02:12:40 +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=1713406363; cv=none; b=ZP4eMHzYe5xrk3Rew3ImB4+JjXX0rtA/crDWHK9acaLFmMPWpm4++LD9VcsdL7gP0ZuEBjJQ+CV3KaYfUZkOv3rYgcphDjOCeZuBLhXh6sZ3VcNCkfwCG62Amy4vFnsHpu9wIPWQCEK/3zoIiWIX6h1QvBefHkiIUOHDkU0rgSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713406363; c=relaxed/simple; bh=0oPL5b7BNK2VDfQOD97anN6VovNyPtDCHhQZ8sZnCTs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tXLXSHfuNCZHHM1YJm5iPSZWGrav3zUxzZpJCFep9PyEaiGQwfgGzl32ZT/mQWdGxLjMcJoPI2stnefxmXdRyCIJdRPC995AhgR0tCQc5I2s1oot2xjLlvhS/uJmI3WWRvym5Eq6I+riWur/X7e0ZnH58JmKtcgxM/pUgY+0l8c= 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 43I2Cdg663994701, 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 43I2Cdg663994701 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 18 Apr 2024 10:12:39 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 18 Apr 2024 10:12:39 +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; Thu, 18 Apr 2024 10:12:38 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 3/9] wifi: rtw89: coex: Add version 3 report map of H2C command Date: Thu, 18 Apr 2024 10:12:01 +0800 Message-ID: <20240418021207.32173-4-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240418021207.32173-1-pkshih@realtek.com> References: <20240418021207.32173-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 RTEXMBS04.realtek.com.tw (172.21.6.97) 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 From: Ching-Te Ku The map is the H2C index for driver forward the driver status to firmware. The status is for firmware to make mechanism decision, if driver provided the wrong index to firmware, it will make parse the status incorrectly. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/coex.c | 40 ++++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index 3da4f54126dd..37eb85d63657 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -133,7 +133,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = { .fcxbtcrpt = 8, .fcxtdma = 7, .fcxslots = 7, .fcxcysta = 7, .fcxstep = 7, .fcxnullsta = 7, .fcxmreg = 7, .fcxgpiodbg = 7, .fcxbtver = 7, .fcxbtscan = 7, .fcxbtafh = 7, .fcxbtdevinfo = 7, - .fwlrole = 8, .frptmap = 7, .fcxctrl = 7, .fcxinit = 7, + .fwlrole = 8, .frptmap = 3, .fcxctrl = 7, .fcxinit = 7, .drvinfo_type = 1, .info_buf = 1800, .max_role_num = 6, }, {RTL8851B, RTW89_FW_VER_CODE(0, 29, 29, 0), @@ -252,13 +252,24 @@ enum btc_btf_set_report_en { RPT_EN_MONITER, }; -#define BTF_SET_REPORT_VER 1 -struct rtw89_btc_btf_set_report { +struct rtw89_btc_btf_set_report_v1 { u8 fver; __le32 enable; __le32 para; } __packed; +struct rtw89_btc_btf_set_report_v8 { + u8 type; + u8 fver; + u8 len; + __le32 map; +} __packed; + +union rtw89_fbtc_rtp_ctrl { + struct rtw89_btc_btf_set_report_v1 v1; + struct rtw89_btc_btf_set_report_v8 v8; +}; + #define BTF_SET_SLOT_TABLE_VER 1 struct rtw89_btc_btf_set_slot_table { u8 fver; @@ -2187,7 +2198,7 @@ static void rtw89_btc_fw_en_rpt(struct rtw89_dev *rtwdev, struct rtw89_btc *btc = &rtwdev->btc; struct rtw89_btc_wl_smap *wl_smap = &btc->cx.wl.status.map; struct rtw89_btc_btf_fwinfo *fwinfo = &btc->fwinfo; - struct rtw89_btc_btf_set_report r = {0}; + union rtw89_fbtc_rtp_ctrl r; u32 val, bit_map; int ret; @@ -2208,11 +2219,24 @@ static void rtw89_btc_fw_en_rpt(struct rtw89_dev *rtwdev, if (val == fwinfo->rpt_en_map) return; - r.fver = BTF_SET_REPORT_VER; - r.enable = cpu_to_le32(val); - r.para = cpu_to_le32(rpt_state); + if (btc->ver->fcxbtcrpt == 8) { + r.v8.type = SET_REPORT_EN; + r.v8.fver = btc->ver->fcxbtcrpt; + r.v8.len = sizeof(r.v8.map); + r.v8.map = cpu_to_le32(val); + ret = _send_fw_cmd(rtwdev, BTFC_SET, SET_REPORT_EN, &r.v8, + sizeof(r.v8)); + } else { + if (btc->ver->fcxbtcrpt == 105) + r.v1.fver = 5; + else + r.v1.fver = btc->ver->fcxbtcrpt; + r.v1.enable = cpu_to_le32(val); + r.v1.para = cpu_to_le32(rpt_state); + ret = _send_fw_cmd(rtwdev, BTFC_SET, SET_REPORT_EN, &r.v1, + sizeof(r.v1)); + } - ret = _send_fw_cmd(rtwdev, BTFC_SET, SET_REPORT_EN, &r, sizeof(r)); if (!ret) fwinfo->rpt_en_map = val; } -- 2.25.1