From: Howard Wang <howard_wang@realsil.com.cn>
To: <dev@dpdk.org>
Cc: <pro_nic_dpdk@realtek.com>, Howard Wang <howard_wang@realsil.com.cn>
Subject: [PATCH v1 4/8] net/r8169: remove cmac feature for RTL8125AP
Date: Tue, 10 Jun 2025 14:22:37 +0800 [thread overview]
Message-ID: <20250610062241.4517-5-howard_wang@realsil.com.cn> (raw)
In-Reply-To: <20250610062241.4517-1-howard_wang@realsil.com.cn>
Signed-off-by: Howard Wang <howard_wang@realsil.com.cn>
---
drivers/net/r8169/r8169_dash.c | 23 +++++++++++------------
drivers/net/r8169/r8169_dash.h | 1 +
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/r8169/r8169_dash.c b/drivers/net/r8169/r8169_dash.c
index c26d7a5280..1fdbe5c4ae 100644
--- a/drivers/net/r8169/r8169_dash.c
+++ b/drivers/net/r8169/r8169_dash.c
@@ -63,18 +63,23 @@ _rtl_check_dash(struct rtl_hw *hw)
if (!hw->AllowAccessDashOcp)
return 0;
- if (HW_DASH_SUPPORT_TYPE_2(hw) || HW_DASH_SUPPORT_TYPE_3(hw) ||
- HW_DASH_SUPPORT_TYPE_4(hw)) {
+ switch (hw->HwSuppDashVer) {
+ case 2:
+ if (rtl_is_8125(hw))
+ return 0;
+ /* Fall through */
+ case 3:
+ case 4:
if (rtl_ocp_read(hw, 0x128, 1) & BIT_0)
return 1;
else
return 0;
- } else if (HW_DASH_SUPPORT_TYPE_1(hw)) {
+ case 1:
if (rtl_ocp_read(hw, 0x10, 2) & 0x00008000)
return 1;
else
return 0;
- } else {
+ default:
return 0;
}
}
@@ -193,7 +198,7 @@ rtl8168_csi_to_cmac_w8(struct rtl_hw *hw, u32 reg, u8 value)
static void
rtl_cmac_w8(struct rtl_hw *hw, u32 reg, u8 value)
{
- if (HW_DASH_SUPPORT_TYPE_2(hw) || HW_DASH_SUPPORT_TYPE_4(hw))
+ if (HW_DASH_SUPPORT_TYPE_2(hw))
RTL_CMAC_W8(hw, reg, value);
else if (HW_DASH_SUPPORT_TYPE_3(hw))
rtl8168_csi_to_cmac_w8(hw, reg, value);
@@ -202,7 +207,7 @@ rtl_cmac_w8(struct rtl_hw *hw, u32 reg, u8 value)
static u8
rtl_cmac_r8(struct rtl_hw *hw, u32 reg)
{
- if (HW_DASH_SUPPORT_TYPE_2(hw) || HW_DASH_SUPPORT_TYPE_4(hw))
+ if (HW_DASH_SUPPORT_TYPE_2(hw))
return RTL_CMAC_R8(hw, reg);
else if (HW_DASH_SUPPORT_TYPE_3(hw))
return rtl8168_csi_to_cmac_r8(hw, reg);
@@ -270,9 +275,6 @@ rtl8125_notify_dash_oob_cmac(struct rtl_hw *hw, u32 cmd)
static void
rtl8125_notify_dash_oob_ipc2(struct rtl_hw *hw, u32 cmd)
{
- if (!HW_DASH_SUPPORT_TYPE_4(hw))
- return;
-
rtl_ocp_write(hw, IB2SOC_DATA, 4, cmd);
rtl_ocp_write(hw, IB2SOC_CMD, 4, 0x00);
rtl_ocp_write(hw, IB2SOC_SET, 4, 0x01);
@@ -554,9 +556,6 @@ rtl8125_driver_stop(struct rtl_hw *hw)
if (!hw->AllowAccessDashOcp)
return;
- if (HW_DASH_SUPPORT_CMAC(hw))
- rtl_dash2_disable_txrx(hw);
-
rtl8125_notify_dash_oob(hw, OOB_CMD_DRIVER_STOP);
rtl_wait_dash_fw_ready(hw);
diff --git a/drivers/net/r8169/r8169_dash.h b/drivers/net/r8169/r8169_dash.h
index 47c5d6906e..7c31658573 100644
--- a/drivers/net/r8169/r8169_dash.h
+++ b/drivers/net/r8169/r8169_dash.h
@@ -20,6 +20,7 @@
#define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3)
#define HW_DASH_SUPPORT_TYPE_4(_M) ((_M)->HwSuppDashVer == 4)
#define HW_DASH_SUPPORT_CMAC(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || HW_DASH_SUPPORT_TYPE_3(_M))
+#define HW_DASH_SUPPORT_IPC2(_M) (HW_DASH_SUPPORT_TYPE_4(_M))
#define HW_DASH_SUPPORT_GET_FIRMWARE_VERSION(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || \
HW_DASH_SUPPORT_TYPE_3(_M) || \
HW_DASH_SUPPORT_TYPE_4(_M))
--
2.34.1
next prev parent reply other threads:[~2025-06-10 6:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 6:22 [PATCH v1 0/8] net/r8169: support more cards Howard Wang
2025-06-10 6:22 ` [PATCH v1 1/8] net/r8169: add support for RTL8168 series Howard Wang
2025-06-10 6:22 ` [PATCH v1 2/8] net/r8169: update HW configurations for 8125 and 8126 Howard Wang
2025-06-10 14:26 ` Stephen Hemminger
2025-06-10 6:22 ` [PATCH v1 3/8] net/r8169: add support for RTL8127 Howard Wang
2025-06-10 6:22 ` Howard Wang [this message]
2025-06-10 6:22 ` [PATCH v1 5/8] net/r8169: add RTL8127AP dash support Howard Wang
2025-06-10 6:22 ` [PATCH v1 6/8] net/r8169: add support for RTL8125CP Howard Wang
2025-06-10 6:22 ` [PATCH v1 7/8] net/r8169: add support for RTL8127ATF serdes interface Howard Wang
2025-06-10 6:22 ` [PATCH v1 8/8] net/r8169: update HW configuration for 8127 Howard Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250610062241.4517-5-howard_wang@realsil.com.cn \
--to=howard_wang@realsil.com.cn \
--cc=dev@dpdk.org \
--cc=pro_nic_dpdk@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).