kernel: r8126: update to v10.015.00
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled

Changelog: https://github.com/openwrt/rtl8126/compare/10.014.01...10.015.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 3d3328bf5f019507896bfa9ffeb53777fc5bfeaa)
This commit is contained in:
Álvaro Fernández Rojas 2025-02-27 08:06:27 +01:00
parent 1ec8d8ea5c
commit abd08419de
2 changed files with 12 additions and 10 deletions

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=r8126 PKG_NAME:=r8126
PKG_VERSION:=10.014.01 PKG_VERSION:=10.015.00
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION)
PKG_HASH:=dbb10a7abd0972e4abd1b89ea4eb22fc55d6c1dc2f711b5acf4a3bc376275e21 PKG_HASH:=fac513aa925264a95b053e7532fcda56022d29db288f6625fafee2759a8a6124
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPLv2 PKG_LICENSE:=GPLv2

View File

@ -18,11 +18,13 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/src/r8126.h --- a/src/r8126.h
+++ b/src/r8126.h +++ b/src/r8126.h
@@ -1740,6 +1740,8 @@ enum RTL8126_register_content { @@ -1756,6 +1756,10 @@ enum RTL8126_register_content {
LinkStatus = 0x02, LinkStatus = 0x02,
FullDup = 0x01, FullDup = 0x01,
+#define RTL8126_FULL_DUPLEX_MASK (_5000bpsF | _2500bpsF | _1000bpsF | FullDup) +#define RTL8126_FULL_DUPLEX_MASK (_5000bpsF | _2500bpsF | _1000bpsF | FullDup)
+#define RTL8126_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL)
+#define RTL8126_SPEED_2500_MASK (_2500bpsF | _5000bpsL)
+ +
/* DBG_reg */ /* DBG_reg */
Fix_Nak_1 = (1 << 4), Fix_Nak_1 = (1 << 4),
@ -37,11 +39,11 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
@@ -4744,6 +4745,40 @@ rtl8126_link_down_patch(struct net_devic @@ -4661,6 +4662,40 @@ rtl8126_link_down_patch(struct net_devic
#endif #endif
} }
+static unsigned int rtl8126_phy_duplex(u16 status) +static unsigned int rtl8126_phy_duplex(u32 status)
+{ +{
+ unsigned int duplex = DUPLEX_UNKNOWN; + unsigned int duplex = DUPLEX_UNKNOWN;
+ +
@ -55,16 +57,16 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+ return duplex; + return duplex;
+} +}
+ +
+static int rtl8126_phy_speed(u16 status) +static int rtl8126_phy_speed(u32 status)
+{ +{
+ int speed = SPEED_UNKNOWN; + int speed = SPEED_UNKNOWN;
+ +
+ if (status & LinkStatus) { + if (status & LinkStatus) {
+ if (status & _5000bpsF) + if (status & _5000bpsF)
+ speed = SPEED_5000; + speed = SPEED_5000;
+ else if (status & _2500bpsF) + else if (status & RTL8126_SPEED_2500_MASK)
+ speed = SPEED_2500; + speed = SPEED_2500;
+ else if (status & _1000bpsF) + else if (status & RTL8126_SPEED_1000_MASK)
+ speed = SPEED_1000; + speed = SPEED_1000;
+ else if (status & _100bps) + else if (status & _100bps)
+ speed = SPEED_100; + speed = SPEED_100;
@ -78,14 +80,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
static void static void
_rtl8126_check_link_status(struct net_device *dev, unsigned int link_state) _rtl8126_check_link_status(struct net_device *dev, unsigned int link_state)
{ {
@@ -4756,11 +4791,18 @@ _rtl8126_check_link_status(struct net_de @@ -4673,11 +4708,18 @@ _rtl8126_check_link_status(struct net_de
if (link_state == R8126_LINK_STATE_ON) { if (link_state == R8126_LINK_STATE_ON) {
rtl8126_link_on_patch(dev); rtl8126_link_on_patch(dev);
- if (netif_msg_ifup(tp)) - if (netif_msg_ifup(tp))
- printk(KERN_INFO PFX "%s: link up\n", dev->name); - printk(KERN_INFO PFX "%s: link up\n", dev->name);
+ if (netif_msg_ifup(tp)) { + 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 = rtl8126_phy_duplex(phy_status); + const unsigned int phy_duplex = rtl8126_phy_duplex(phy_status);
+ const int phy_speed = rtl8126_phy_speed(phy_status); + const int phy_speed = rtl8126_phy_speed(phy_status);
+ printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n", + printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",