kernel: r8125: update to v9.015.00

Changelog: https://github.com/openwrt/rtl8125/compare/9.014.01...9.015.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= 2025-02-27 08:04:50 +01:00
parent d0fa42a6bc
commit ae9e8d4c84
4 changed files with 27 additions and 29 deletions

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=r8125
PKG_VERSION:=9.014.01
PKG_VERSION:=9.015.00
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8125/releases/download/$(PKG_VERSION)
PKG_HASH:=f006aa95501738ca55c522812c9d1b473ac781675f3ad88ce341a09316b8aa13
PKG_HASH:=7d6906336c3ad960c3e7c0299ad655659d7110bdc933c5b568b7f2536cb8ffc3
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2

View File

@ -1,8 +1,8 @@
--- a/src/r8125_n.c
+++ b/src/r8125_n.c
@@ -7478,7 +7478,11 @@
@@ -7314,7 +7314,11 @@ out:
}
#else
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata)
@ -12,8 +12,8 @@
{
struct rtl8125_private *tp = netdev_priv(net);
struct ethtool_eee *eee = &tp->eee;
@@ -7511,9 +7515,15 @@
@@ -7347,9 +7351,15 @@ rtl_ethtool_get_eee(struct net_device *n
edata->eee_enabled = !!val;
edata->eee_active = !!(supported & adv & lp);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
@ -27,10 +27,10 @@
+#endif
edata->tx_lpi_enabled = edata->eee_enabled;
edata->tx_lpi_timer = tx_lpi_timer;
@@ -7521,11 +7531,18 @@
@@ -7357,11 +7367,18 @@ rtl_ethtool_get_eee(struct net_device *n
}
static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata)
@ -45,11 +45,11 @@
+ u32 adv;
+#endif
int rc = 0;
if (!HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp) ||
@@ -7557,6 +7574,18 @@
@@ -7393,6 +7410,18 @@ rtl_ethtool_set_eee(struct net_device *n
*/
advertising = tp->advertising;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+ ethtool_convert_link_mode_to_legacy_u32(&adv, edata->advertised);
@ -66,12 +66,12 @@
if (!edata->advertised) {
edata->advertised = advertising & eee->supported;
} else if (edata->advertised & ~advertising) {
@@ -7565,13 +7594,23 @@
@@ -7401,18 +7430,32 @@ rtl_ethtool_set_eee(struct net_device *n
rc = -EINVAL;
goto out;
}
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+ if (!linkmode_empty(edata->advertised) & ~eee->supported) {
+ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n",
@ -87,13 +87,10 @@
goto out;
}
+#endif
//tp->eee.eee_enabled = edata->eee_enabled;
//tp->eee_adv_t = ethtool_adv_to_mmd_eee_adv_t(edata->advertised);
@@ -7579,7 +7618,11 @@
dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE tx_lpi_timer %x must be a subset of support %x\n",
edata->tx_lpi_timer, eee->tx_lpi_timer);
//tp->eee_adv_t = rtl8125_ethtool_adv_to_mmd_eee_adv_cap1_t(edata->advertised);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
+ ethtool_convert_link_mode_to_legacy_u32(&eee->advertised, edata->advertised);
+#else

View File

@ -17,11 +17,12 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/src/r8125.h
+++ b/src/r8125.h
@@ -1672,6 +1672,8 @@ enum RTL8125_register_content {
@@ -1687,6 +1687,9 @@ enum RTL8125_register_content {
LinkStatus = 0x02,
FullDup = 0x01,
+#define RTL8125_FULL_DUPLEX_MASK (_2500bpsF | _1000bpsF | FullDup)
+#define RTL8125_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL)
+
/* DBG_reg */
Fix_Nak_1 = (1 << 4),
@ -36,11 +37,11 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
@@ -5116,6 +5117,38 @@ rtl8125_link_down_patch(struct net_devic
@@ -5023,6 +5024,38 @@ rtl8125_link_down_patch(struct net_devic
#endif
}
+static unsigned int rtl8125_phy_duplex(u16 status)
+static unsigned int rtl8125_phy_duplex(u32 status)
+{
+ unsigned int duplex = DUPLEX_UNKNOWN;
+
@ -54,14 +55,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+ return duplex;
+}
+
+static int rtl8125_phy_speed(u16 status)
+static int rtl8125_phy_speed(u32 status)
+{
+ int speed = SPEED_UNKNOWN;
+
+ if (status & LinkStatus) {
+ if (status & _2500bpsF)
+ speed = SPEED_2500;
+ else if (status & _1000bpsF)
+ else if (status & RTL8125_SPEED_1000_MASK)
+ speed = SPEED_1000;
+ else if (status & _100bps)
+ speed = SPEED_100;
@ -75,14 +76,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static void
_rtl8125_check_link_status(struct net_device *dev, unsigned int link_state)
{
@@ -5128,11 +5161,18 @@ _rtl8125_check_link_status(struct net_de
@@ -5035,11 +5068,18 @@ _rtl8125_check_link_status(struct net_de
if (link_state == R8125_LINK_STATE_ON) {
rtl8125_link_on_patch(dev);
- if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) {
+ const u16 phy_status = RTL_R16(tp, PHYstatus);
+ const u32 phy_status = RTL_R32(tp, PHYstatus);
+ const unsigned int phy_duplex = rtl8125_phy_duplex(phy_status);
+ const int phy_speed = rtl8125_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",

View File

@ -8,7 +8,7 @@
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/interrupt.h>
@@ -14756,6 +14757,22 @@ rtl8125_setup_mqs_reg(struct rtl8125_pri
@@ -14265,6 +14266,22 @@ rtl8125_setup_mqs_reg(struct rtl8125_pri
}
static void
@ -31,7 +31,7 @@
rtl8125_init_software_variable(struct net_device *dev)
{
struct rtl8125_private *tp = netdev_priv(dev);
@@ -15358,6 +15375,7 @@ rtl8125_init_software_variable(struct ne
@@ -14720,6 +14737,7 @@ rtl8125_init_software_variable(struct ne
else if (tp->InitRxDescType == RX_DESC_RING_TYPE_4)
tp->rtl8125_rx_config &= ~EnableRxDescV4_1;