Skip to content

Commit

Permalink
kernel: r8126: update to v10.015.00
Browse files Browse the repository at this point in the history
Changelog: openwrt/rtl8126@10.014.01...10.015.00

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
(cherry picked from commit 3d3328b)
  • Loading branch information
Noltari committed Feb 27, 2025
1 parent 1ec8d8e commit abd0841
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package/kernel/r8126/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ Signed-off-by: Álvaro Fernández Rojas <[email protected]>

--- 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),
Expand All @@ -37,11 +39,11 @@ Signed-off-by: Álvaro Fernández Rojas <[email protected]>
#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;
+
Expand All @@ -55,16 +57,16 @@ Signed-off-by: Álvaro Fernández Rojas <[email protected]>
+ 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;
Expand All @@ -78,14 +80,14 @@ Signed-off-by: Álvaro Fernández Rojas <[email protected]>
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",
Expand Down

0 comments on commit abd0841

Please sign in to comment.