kernel: r8126: update to v10.015.00
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 27 Feb 2025 07:06:27 +0000 (08:06 +0100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 27 Feb 2025 10:56:50 +0000 (11:56 +0100)
Changelog: https://github.com/openwrt/rtl8126/compare/10.014.01...10.015.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
package/kernel/r8126/Makefile
package/kernel/r8126/patches/200-r8126-print-link-speed-and-duplex-mode.patch

index a8f60f9dbb664b73e138036dc938b2f735a14a5b..da43697bfb9e2341ed3beca7550cbe584369523a 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=r8126
-PKG_VERSION:=10.014.01
+PKG_VERSION:=10.015.00
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION)
-PKG_HASH:=dbb10a7abd0972e4abd1b89ea4eb22fc55d6c1dc2f711b5acf4a3bc376275e21
+PKG_HASH:=fac513aa925264a95b053e7532fcda56022d29db288f6625fafee2759a8a6124
 
 PKG_BUILD_PARALLEL:=1
 PKG_LICENSE:=GPLv2
index 27b3d626c152be84e680646d82d3af5eb2d8089b..236f80c7fd0e122163c6d0864d532ff90e34b2e5 100644 (file)
@@ -18,11 +18,13 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
 
 --- a/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,
          FullDup = 0x01,
  
 +#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 */
          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/etherdevice.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
  }
  
-+static unsigned int rtl8126_phy_duplex(u16 status)
++static unsigned int rtl8126_phy_duplex(u32 status)
 +{
 +        unsigned int duplex = DUPLEX_UNKNOWN;
 +
@@ -55,16 +57,16 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
 +        return duplex;
 +}
 +
-+static int rtl8126_phy_speed(u16 status)
++static int rtl8126_phy_speed(u32 status)
 +{
 +        int speed = SPEED_UNKNOWN;
 +
 +        if (status & LinkStatus) {
 +                if (status & _5000bpsF)
 +                        speed = SPEED_5000;
-+                else if (status & _2500bpsF)
++                else if (status & RTL8126_SPEED_2500_MASK)
 +                        speed = SPEED_2500;
-+                else if (status & _1000bpsF)
++                else if (status & RTL8126_SPEED_1000_MASK)
 +                        speed = SPEED_1000;
 +                else if (status & _100bps)
 +                        speed = SPEED_100;
@@ -78,14 +80,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  static void
  _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) {
                  rtl8126_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 = rtl8126_phy_duplex(phy_status);
 +                        const int phy_speed = rtl8126_phy_speed(phy_status);
 +                        printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n",