From patchwork Fri Nov 15 09:54:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13876033 X-Patchwork-Delegate: kuba@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 5FFBE192B9A; Fri, 15 Nov 2024 09:55:10 +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=1731664515; cv=none; b=sQzl7jjNDN7i0q0qNBQmawqRRZw83n4vmTRKhSb7uxovG96HRAh/oiGLpT2qkmUOttZE9vDV9Te+m4KjVFkZCZla1OwHS1h7kw3Swl53Y9S4MBHnfHl2epdY7na6hzx3ahAQ9AHWO9cKwKPXWiuu5mCXf/Lp3KSuyHmjRwi3yOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731664515; c=relaxed/simple; bh=QfVWlreJZg/l0pgy+fenk87ylKvpPC5vFMVGj7hj1Pk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W80dSNBKzFxHVznfryf4YMQh4KyusNZg6PGvyW12OkJ9moJugRY982tCt/Zg/fpyubFY4FzsYY1PP0/kRkuHxS77z3bBnEuZbOkLok9YNP1fjike4RO6YEnFsDvrjVUoZvMdLInpoMnZJ93heE1DhDN/LEtzW5KyYf3McXEXE3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=NRkbd/zB; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="NRkbd/zB" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AF9srBZ3284339, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731664493; bh=QfVWlreJZg/l0pgy+fenk87ylKvpPC5vFMVGj7hj1Pk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=NRkbd/zBiFbpAVh4qtmXTAU8qEP7Mjqs13+bmkM+q43bjq9NUBciknOlhr0zMZYBT 0uccR59bha0qIy+qZmxArnDxLNp1MM6T+CB86kED0TYj9KiZOh9cZVsivJfPJPBR8i cj2EbkX5qDnn8+VGPL4JQcPiPxHrNWL63oX5Rg9ke1VXcUoipvrY6r799fGcSpg7z3 NsxZiwZmh6p3fZj3tw9NpixS1tRo0nvX8sZHQtrYrhBAGWfy37AGQ0VjxbQLl4SBwm gCM3eN/KmB3ehMgAtBz8GYEYvm63ewjPJEtGtQy7yDreUizqEuyN5lQWi1TQAEYL+b znCZqLvUaSVsg== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AF9srBZ3284339 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 17:54:53 +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.39; Fri, 15 Nov 2024 17:54:54 +0800 Received: from RTDOMAIN (172.21.210.74) 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; Fri, 15 Nov 2024 17:54:53 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net v2 1/5] rtase: Refactor the rtase_check_mac_version_valid() function Date: Fri, 15 Nov 2024 17:54:25 +0800 Message-ID: <20241115095429.399029-2-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115095429.399029-1-justinlai0215@realtek.com> References: <20241115095429.399029-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org 1. Sets tp->hw_ver. 2. Changes the return type from bool to int. 3. Modify the error message for an invalid hardware version id. Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase.h | 2 ++ .../net/ethernet/realtek/rtase/rtase_main.c | 22 +++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h index 583c33930f88..547c71937b01 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase.h +++ b/drivers/net/ethernet/realtek/rtase/rtase.h @@ -327,6 +327,8 @@ struct rtase_private { u16 int_nums; u16 tx_int_mit; u16 rx_int_mit; + + u32 hw_ver; }; #define RTASE_LSO_64K 64000 diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index f8777b7663d3..0c19c5645d53 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1972,20 +1972,21 @@ static void rtase_init_software_variable(struct pci_dev *pdev, tp->dev->max_mtu = RTASE_MAX_JUMBO_SIZE; } -static bool rtase_check_mac_version_valid(struct rtase_private *tp) +static int rtase_check_mac_version_valid(struct rtase_private *tp) { - u32 hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK; - bool known_ver = false; + int ret = -ENODEV; - switch (hw_ver) { + tp->hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK; + + switch (tp->hw_ver) { case 0x00800000: case 0x04000000: case 0x04800000: - known_ver = true; + ret = 0; break; } - return known_ver; + return ret; } static int rtase_init_board(struct pci_dev *pdev, struct net_device **dev_out, @@ -2105,9 +2106,12 @@ static int rtase_init_one(struct pci_dev *pdev, tp->pdev = pdev; /* identify chip attached to board */ - if (!rtase_check_mac_version_valid(tp)) - return dev_err_probe(&pdev->dev, -ENODEV, - "unknown chip version, contact rtase maintainers (see MAINTAINERS file)\n"); + ret = rtase_check_mac_version_valid(tp); + if (ret != 0) { + dev_err(&pdev->dev, + "unknown chip version: 0x%08x, contact rtase maintainers (see MAINTAINERS file)\n", + tp->hw_ver); + } rtase_init_software_variable(pdev, tp); rtase_init_hardware(tp); From patchwork Fri Nov 15 09:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13876034 X-Patchwork-Delegate: kuba@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 58178192D8B; Fri, 15 Nov 2024 09:55:34 +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=1731664537; cv=none; b=Aa9txyvjhpIAD+V94ljPRsyHXuVx7hMxwmw5Rymvq4htbaIbEsfS7vfMJQMwS6Ms5AtEYWy5q8awi2Fjv0G6b6vsz2mhMnEwCFuhbiHCbFrMSJQ+vJuzLpbCQvYkx+q12msJ20wZIy7f1dju2Tf4ipemsEXgV7tSi7W/sVz/vnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731664537; c=relaxed/simple; bh=CykH9i7P9pZRTLcdwSphEWfFe4k6k8acMq71zcZ+/tU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nk1UEJXGdrAuWiIn47SQBRllqy0KWG7IOMIytiEbMhtjH32FAV0xoQUGIP+EPfAOo7YjIvxS8/ggPTnEH6BIhB8Lf6lC6SfoQZOUutYr+eksaGIpXBpAnRMIndBYwS6rKa9riT6uCfVqc2M3jtpWQVVFVuOoJiXe12UCGmP+vFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=IkVlDDof; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="IkVlDDof" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AF9tJvG5289966, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731664519; bh=CykH9i7P9pZRTLcdwSphEWfFe4k6k8acMq71zcZ+/tU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=IkVlDDoftYCBUcMDB7akrpHpEsxUqIHc621jkZK00djxkwwlsfwdox9qFtjD2nxE2 6vMlADkbGleo6RYZ7TjJ68w8+HAVNaGRLKUT8OtBl0kFs3ndeEYysdX/L0c0x9L/tu gdnCTtsLwr+9FNrFzyLSZm2oOUbCLMbv4LZz4ANdUwl0Q3n2rttbA6DJgbuKMCqQdh JUlsxMxNhtdHNz3UdRlnajvJP65hWS9XELr+RQQig1rNas1yThk2N6Xb049/CzSCEj armsAFbZUjpkq7aPNQkmQ+Gt2Tt/6Ai9kEYi5kEJSuFEwVnilsuZqYltq/c2OVUBO5 XBaYS6uJNG8FQ== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AF9tJvG5289966 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 17:55:19 +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; Fri, 15 Nov 2024 17:55:17 +0800 Received: from RTDOMAIN (172.21.210.74) 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; Fri, 15 Nov 2024 17:55:16 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net v2 2/5] rtase: Correct the speed for RTL907XD-V1 Date: Fri, 15 Nov 2024 17:54:26 +0800 Message-ID: <20241115095429.399029-3-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115095429.399029-1-justinlai0215@realtek.com> References: <20241115095429.399029-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Correct the speed for RTL907XD-V1. Fixes: dd7f17c40fd1 ("rtase: Implement ethtool function") Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 0c19c5645d53..5b8012987ea6 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1714,10 +1714,21 @@ static int rtase_get_settings(struct net_device *dev, struct ethtool_link_ksettings *cmd) { u32 supported = SUPPORTED_MII | SUPPORTED_Pause | SUPPORTED_Asym_Pause; + const struct rtase_private *tp = netdev_priv(dev); ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, supported); - cmd->base.speed = SPEED_5000; + + switch (tp->hw_ver) { + case 0x00800000: + case 0x04000000: + cmd->base.speed = SPEED_5000; + break; + case 0x04800000: + cmd->base.speed = SPEED_10000; + break; + } + cmd->base.duplex = DUPLEX_FULL; cmd->base.port = PORT_MII; cmd->base.autoneg = AUTONEG_DISABLE; From patchwork Fri Nov 15 09:54:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13876035 X-Patchwork-Delegate: kuba@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 45A1218FC75; Fri, 15 Nov 2024 09:55:52 +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=1731664554; cv=none; b=YeY46v7EWPPcFO3nOi5SEf0cF84v6l7Ce/keRJ+2PbvGD6cpmHGGlixUgTNk+iVMtQqPz/NGd7ifqRZQyzxojFa9qztDKuTAPrR/SpiLXRNnN9qGZdrCK3p6PIsf3SPTHkm3j9EuKd25vZvaBEAgcsq6EzzApMovRYjvjURjH1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731664554; c=relaxed/simple; bh=KqVUQsZudJmLc5BK8kjEGKOC7PoSPhxr6P8Izbi9bYg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dZHSILI879KKEDbAoVwp6sXtOM3JmFrAax8J+04LIylQIqCZfi5MoLf+nJyTec7Qz+U+R1cxHkHBPUMpMzruJD1dWyqvWEwGf0c/0Maet+IjKWF+YqAAEtkZ9B3nTw0J1GhthGuSxGig0pW8NPZQTVY5AkeBpaLZwWg5RXlFqJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=IAwS8wqq; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="IAwS8wqq" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AF9tbA93290716, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731664537; bh=KqVUQsZudJmLc5BK8kjEGKOC7PoSPhxr6P8Izbi9bYg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=IAwS8wqq4CA4xdw1vtLa6JJUKuuZbKBA2iTO2M6PW9kVpVRX98ieGirDyUDL9GnuQ aYKLFXqpeNyEsV3eU1SWfUH0kz8eWsyCrHLmFuJNRbv6odShc+oKX504bfPvjuavEa Nasf/IxJnz59QNyvQPQTUeVMNehCN8D61De9CnSUZECXrlOCJ5WOx0arHzBAZ3i9pp 3grg8osQ/K2EvKQLX5KOS/8E1xUIpuDImDBLlR86yWiE+cGKo/6yyUo3v2clxbEw7c HbgJOV9Gun6RYKQc675/UCed6C6HRqzUyuFJzfKCRUAP416mUYRLmhmmpx83mUYyDB tugEWq/6+UYyQ== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AF9tbA93290716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 17:55:37 +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.39; Fri, 15 Nov 2024 17:55:38 +0800 Received: from RTDOMAIN (172.21.210.74) 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; Fri, 15 Nov 2024 17:55:37 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net v2 3/5] rtase: Add support for RTL907XD-VA PCIe port Date: Fri, 15 Nov 2024 17:54:27 +0800 Message-ID: <20241115095429.399029-4-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115095429.399029-1-justinlai0215@realtek.com> References: <20241115095429.399029-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org 1. Add RTL907XD-VA hardware version id. 2. Add the reported speed for RTL907XD-VA. Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 5b8012987ea6..22389911a7d4 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1725,6 +1725,7 @@ static int rtase_get_settings(struct net_device *dev, cmd->base.speed = SPEED_5000; break; case 0x04800000: + case 0x08000000: cmd->base.speed = SPEED_10000; break; } @@ -1993,6 +1994,7 @@ static int rtase_check_mac_version_valid(struct rtase_private *tp) case 0x00800000: case 0x04000000: case 0x04800000: + case 0x08000000: ret = 0; break; } From patchwork Fri Nov 15 09:54:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13876036 X-Patchwork-Delegate: kuba@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 C2D0C192D8B; Fri, 15 Nov 2024 09:56:13 +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=1731664575; cv=none; b=rgu55ghQeiTt60fnoFEF8mk4PqzCF7olQ08zWz6tODcLZF6ppcjOmU6b5g2ZkE3+1m8a2tsic0D7iDjSoUhMT1RKKE/sWVXeXA0tOCRR0LuT2LUuslFrNawGa8ETTp+dwReB1/YXR/QYNJEIwtrHCzkZh8SFpkzYBisoy/etgpM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731664575; c=relaxed/simple; bh=iNEkoZdxO96vD4vM5hSViTE1pWccSIWCSA1SLIHKBbw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RsHP4JsrFp6PXZtdzwg5cnoN7aFplxY4EIh5RT2ONG7GGbjDdSFlozcHa/DEF8t1r3nnlwgjiQk9cagRRSgG+wUWcc+YX++AQUYnxCUePkNHJQCcyc6kgComfwMI25zblf/NTxOH6vJkJM9C6AEmcIySXQRLh2ZpvK4Ozu/iUoQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=uB4rMB9Q; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="uB4rMB9Q" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AF9twzvF290974, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731664558; bh=iNEkoZdxO96vD4vM5hSViTE1pWccSIWCSA1SLIHKBbw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=uB4rMB9QsmSVCBTB72AKrQY/iBhyffjhdwcIJDVu32zFrIU6cA3Em7EJGvQu/f0er AR4Ic7MCBeqkPwk7nVIK+Ar0dERysLHDKziZb3BC/x/lLYBAydofleBpzpssYp+nJN FUtluGNt61JisgwANY76XaRatplyw+0dscYNPl61F0C/sKhtnXEzyxmDafKRCr/TjK I3KHqs50PPJmRti2JFmXICeFdQhQ9PfYLDN+MuTItzMC0yHKox6Wi+zGO3wo6P+TBa j03MnxoUn21SlGpvqhHdmO+ubgPU+Dwn2A9KX49FSocLsLQHzBAV5F2anBrqo+a+6U lBjHhsQSvgYWw== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AF9twzvF290974 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 17:55:58 +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.39; Fri, 15 Nov 2024 17:55:58 +0800 Received: from RTDOMAIN (172.21.210.74) 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; Fri, 15 Nov 2024 17:55:57 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net v2 4/5] rtase: Corrects error handling of the rtase_check_mac_version_valid() Date: Fri, 15 Nov 2024 17:54:28 +0800 Message-ID: <20241115095429.399029-5-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115095429.399029-1-justinlai0215@realtek.com> References: <20241115095429.399029-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Corrects error handling of the rtase_check_mac_version_valid(). Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this module") Signed-off-by: Justin Lai Reviewed-by: Andrew Lunn --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 22389911a7d4..91ad19e80f67 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -2124,6 +2124,7 @@ static int rtase_init_one(struct pci_dev *pdev, dev_err(&pdev->dev, "unknown chip version: 0x%08x, contact rtase maintainers (see MAINTAINERS file)\n", tp->hw_ver); + goto err_out_release_board; } rtase_init_software_variable(pdev, tp); @@ -2198,6 +2199,7 @@ static int rtase_init_one(struct pci_dev *pdev, netif_napi_del(&ivec->napi); } +err_out_release_board: rtase_release_board(pdev, dev, ioaddr); return ret; From patchwork Fri Nov 15 09:54:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13876037 X-Patchwork-Delegate: kuba@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 20CDF18F2DB; Fri, 15 Nov 2024 09:56:29 +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=1731664591; cv=none; b=DWTF1iLQfyQ64yu27ocSk2r1VYVFcolJ+UYxdZ/r3v0lIW+sSXMfuxp+9qvG/NPzfbZ9/hXWA/E0angWzUYLDdHtUyKhNzwqvLHksVYlBV8jMhx4syEWm6v3Uvr93VyOo02nBESLrIAzx7Nm2Ogzfro/NqpS5CAqdvd8d4a81xw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731664591; c=relaxed/simple; bh=rlK6/TKWzQfmmePLCrYCt+4gkQOodUnsoIGZbd96Vkk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G1Cp1fCoOE17m+MI9rvgMkJ1ORNiPnw19P9No9KFvaKp4yYssXPcUnqwyrnGKDBoyWcfwwp1LEnP1/FAVB4RLknCzO0lwAHOOysl9IW+RHtZtLDBRqNZTKdas3/DUqfp12NWvIlKWObzjJy8zgjqRH6jjH0Wqn3/0Gf5MXxjYao= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=Atwaw1Sf; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="Atwaw1Sf" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AF9uEdQ5291473, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731664574; bh=rlK6/TKWzQfmmePLCrYCt+4gkQOodUnsoIGZbd96Vkk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=Atwaw1Sfle4b4nug4+l/z2z/cJkd+vuqXZRp1jYAPLEdiIOwNAXHzDpKTXJCeJNBL CJUSSqUqv2VUSbKDPOn0B083R8cIhCndzKR9pjy4N9RuZ9GZ0Ged4NljnuuXJx1iGs 9J/34Q6xN8aOoTxLJz4hqg/Tpe8+Zm1QFrVwZQnIadxJ7PJ2Wdw5r1WdI75XYgZ6J0 eCZ65l+mTrKbKdZI/P1BmHa6qdnB6gE6AsSAPNT2WGX3sYRObSJYErNWykwd4MOeaa VUS9ySMGxyvpoyvy+n6RR+VLzC+SxkPh1p6a8ieBvpUjSj9n0RnnCQdIjU3Fv0GAMV UNtxXYaQXnUNA== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AF9uEdQ5291473 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 17:56:14 +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; Fri, 15 Nov 2024 17:56:14 +0800 Received: from RTDOMAIN (172.21.210.74) 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; Fri, 15 Nov 2024 17:56:14 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net v2 5/5] rtase: Add defines for hardware version id Date: Fri, 15 Nov 2024 17:54:29 +0800 Message-ID: <20241115095429.399029-6-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115095429.399029-1-justinlai0215@realtek.com> References: <20241115095429.399029-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Add defines for hardware version id. Signed-off-by: Justin Lai Reviewed-by: Andrew Lunn --- drivers/net/ethernet/realtek/rtase/rtase.h | 6 +++++- drivers/net/ethernet/realtek/rtase/rtase_main.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h index 547c71937b01..6dfb839d78f0 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase.h +++ b/drivers/net/ethernet/realtek/rtase/rtase.h @@ -9,7 +9,11 @@ #ifndef RTASE_H #define RTASE_H -#define RTASE_HW_VER_MASK 0x7C800000 +#define RTASE_HW_VER_MASK 0x7C800000 +#define RTASE_HW_VER_906X_7XA 0x00800000 +#define RTASE_HW_VER_906X_7XC 0x04000000 +#define RTASE_HW_VER_907XD_V1 0x04800000 +#define RTASE_HW_VER_907XD_VA 0x08000000 #define RTASE_RX_DMA_BURST_256 4 #define RTASE_TX_DMA_BURST_UNLIMITED 7 diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 91ad19e80f67..d352e25fd9af 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1720,12 +1720,12 @@ static int rtase_get_settings(struct net_device *dev, supported); switch (tp->hw_ver) { - case 0x00800000: - case 0x04000000: + case RTASE_HW_VER_906X_7XA: + case RTASE_HW_VER_906X_7XC: cmd->base.speed = SPEED_5000; break; - case 0x04800000: - case 0x08000000: + case RTASE_HW_VER_907XD_V1: + case RTASE_HW_VER_907XD_VA: cmd->base.speed = SPEED_10000; break; } @@ -1991,10 +1991,10 @@ static int rtase_check_mac_version_valid(struct rtase_private *tp) tp->hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK; switch (tp->hw_ver) { - case 0x00800000: - case 0x04000000: - case 0x04800000: - case 0x08000000: + case RTASE_HW_VER_906X_7XA: + case RTASE_HW_VER_906X_7XC: + case RTASE_HW_VER_907XD_V1: + case RTASE_HW_VER_907XD_VA: ret = 0; break; }