r8101: bump to 1.039.00
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
149102ccd9
commit
9550acf5a5
4
Makefile
4
Makefile
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=r8101
|
PKG_NAME:=r8101
|
||||||
PKG_VERSION:=1.038.02
|
PKG_VERSION:=1.039.00
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
@ -28,7 +28,7 @@ define Package/r8101/description
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(KERNEL_MAKE) M=$(PKG_BUILD_DIR) modules
|
+$(KERNEL_MAKE) M=$(PKG_BUILD_DIR) modules
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call KernelPackage,r8101))
|
$(eval $(call KernelPackage,r8101))
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
--- a/r8101.h
|
|
||||||
+++ b/r8101.h
|
|
||||||
@@ -492,7 +492,11 @@ typedef int *napi_budget;
|
|
||||||
typedef struct napi_struct *napi_ptr;
|
|
||||||
typedef int napi_budget;
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
|
|
||||||
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
|
|
||||||
+#else
|
|
||||||
+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight)
|
|
||||||
+#endif
|
|
||||||
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
|
|
||||||
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
|
|
||||||
#define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
|
|
@ -1,13 +0,0 @@
|
|||||||
--- a/r8101_n.c
|
|
||||||
+++ b/r8101_n.c
|
|
||||||
@@ -69,6 +69,10 @@ This driver is modified from r8169.c in Linux kernel 2.6.18
|
|
||||||
#include <linux/mdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0)
|
|
||||||
+# include <net/gso.h>
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/irq.h>
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
10
src/r8101.h
10
src/r8101.h
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
@ -321,12 +321,12 @@ do { \
|
|||||||
#define NAPI_SUFFIX ""
|
#define NAPI_SUFFIX ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RTL8101_VERSION "1.038.02" NAPI_SUFFIX
|
#define RTL8101_VERSION "1.039.00" NAPI_SUFFIX
|
||||||
#define MODULENAME "r8101"
|
#define MODULENAME "r8101"
|
||||||
#define PFX MODULENAME ": "
|
#define PFX MODULENAME ": "
|
||||||
|
|
||||||
#define GPL_CLAIM "\
|
#define GPL_CLAIM "\
|
||||||
r8101 Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com> \n \
|
r8101 Copyright (C) 2024 Realtek NIC software team <nicfae@realtek.com> \n \
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. \n \
|
This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. \n \
|
||||||
This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n"
|
This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n"
|
||||||
|
|
||||||
@ -492,7 +492,11 @@ typedef int *napi_budget;
|
|||||||
typedef struct napi_struct *napi_ptr;
|
typedef struct napi_struct *napi_ptr;
|
||||||
typedef int napi_budget;
|
typedef int napi_budget;
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
|
||||||
|
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight)
|
||||||
|
#else
|
||||||
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
|
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
|
||||||
|
#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
|
||||||
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
|
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
|
||||||
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
|
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
|
||||||
#define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
|
#define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
|
||||||
|
211
src/r8101_n.c
211
src/r8101_n.c
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
@ -69,6 +69,10 @@ This driver is modified from r8169.c in Linux kernel 2.6.18
|
|||||||
#include <linux/mdio.h>
|
#include <linux/mdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
|
||||||
|
#include <net/gso.h>
|
||||||
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10) */
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
@ -82,10 +86,6 @@ This driver is modified from r8169.c in Linux kernel 2.6.18
|
|||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
|
||||||
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
|
|
||||||
static const int multicast_filter_limit = 32;
|
|
||||||
|
|
||||||
#define _R(NAME,MAC,MASK) \
|
#define _R(NAME,MAC,MASK) \
|
||||||
{ .name = NAME, .mcfg = MAC, .RxConfigMask = MASK }
|
{ .name = NAME, .mcfg = MAC, .RxConfigMask = MASK }
|
||||||
|
|
||||||
@ -1647,7 +1647,7 @@ static u32 rtl8101_mdio_real_read_phy_ocp(struct rtl8101_private *tp,
|
|||||||
return mdio_real_direct_read_phy_ocp(tp, ocp_addr);
|
return mdio_real_direct_read_phy_ocp(tp, ocp_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 mdio_real_read(struct rtl8101_private *tp,
|
static u32 mdio_real_read(struct rtl8101_private *tp,
|
||||||
u32 RegAddr)
|
u32 RegAddr)
|
||||||
{
|
{
|
||||||
int i, value = 0;
|
int i, value = 0;
|
||||||
@ -2371,7 +2371,7 @@ rtl8101_hw_clear_timer_int(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8101_enable_EEE(struct rtl8101_private *tp)
|
static int rtl8101_enable_eee(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u16 data;
|
u16 data;
|
||||||
@ -2542,7 +2542,7 @@ static int rtl8101_enable_EEE(struct rtl8101_private *tp)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8101_disable_EEE(struct rtl8101_private *tp)
|
static int rtl8101_disable_eee(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u16 data;
|
u16 data;
|
||||||
@ -2859,7 +2859,7 @@ rtl8101_check_link_status(struct net_device *dev)
|
|||||||
if (tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_12 ||
|
if (tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_12 ||
|
||||||
tp->mcfg == CFG_METHOD_13) {
|
tp->mcfg == CFG_METHOD_13) {
|
||||||
if ((RTL_R8(tp, PHYstatus) & FullDup) == 0 && tp->eee_enabled == 1)
|
if ((RTL_R8(tp, PHYstatus) & FullDup) == 0 && tp->eee_enabled == 1)
|
||||||
rtl8101_disable_EEE(tp);
|
rtl8101_disable_eee(tp);
|
||||||
|
|
||||||
if (RTL_R8(tp, PHYstatus) & _10bps) {
|
if (RTL_R8(tp, PHYstatus) & _10bps) {
|
||||||
rtl8101_eri_write(tp, 0x1D0, 2, 0x4D02, ERIAR_ExGMAC);
|
rtl8101_eri_write(tp, 0x1D0, 2, 0x4D02, ERIAR_ExGMAC);
|
||||||
@ -2921,6 +2921,7 @@ rtl8101_check_link_status(struct net_device *dev)
|
|||||||
rtl8101_mdio_write(tp, 0x1F, 0x0004);
|
rtl8101_mdio_write(tp, 0x1F, 0x0004);
|
||||||
data32 = rtl8101_mdio_read( tp, 0x10);
|
data32 = rtl8101_mdio_read( tp, 0x10);
|
||||||
data32 &= ~0x0C00;
|
data32 &= ~0x0C00;
|
||||||
|
rtl8101_mdio_write(tp, 0x10, data32);
|
||||||
rtl8101_mdio_write(tp, 0x1F, 0x0000);
|
rtl8101_mdio_write(tp, 0x1F, 0x0000);
|
||||||
}
|
}
|
||||||
if (netif_msg_ifdown(tp))
|
if (netif_msg_ifdown(tp))
|
||||||
@ -3351,7 +3352,7 @@ rtl8101_hw_d3_para(struct net_device *dev)
|
|||||||
|
|
||||||
if ((tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_12 ||
|
if ((tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_12 ||
|
||||||
tp->mcfg == CFG_METHOD_13) && (tp->eee_enabled == 1))
|
tp->mcfg == CFG_METHOD_13) && (tp->eee_enabled == 1))
|
||||||
rtl8101_disable_EEE(tp);
|
rtl8101_disable_eee(tp);
|
||||||
|
|
||||||
rtl8101_set_pci_99_180_exit_driver_para(dev);
|
rtl8101_set_pci_99_180_exit_driver_para(dev);
|
||||||
|
|
||||||
@ -3821,7 +3822,7 @@ rtl8101_get_drvinfo(struct net_device *dev,
|
|||||||
|
|
||||||
strcpy(info->driver, MODULENAME);
|
strcpy(info->driver, MODULENAME);
|
||||||
strcpy(info->version, RTL8101_VERSION);
|
strcpy(info->version, RTL8101_VERSION);
|
||||||
strcpy(info->bus_info, pci_name(tp->pci_dev));
|
strncpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info) - 1);
|
||||||
info->regdump_len = R8101_REGS_DUMP_SIZE;
|
info->regdump_len = R8101_REGS_DUMP_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4703,7 +4704,102 @@ static int rtl_nway_reset(struct net_device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
rtl8101_support_eee(struct rtl8101_private *tp)
|
||||||
|
{
|
||||||
|
switch (tp->mcfg) {
|
||||||
|
case CFG_METHOD_17 ... CFG_METHOD_20:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
|
||||||
|
static int
|
||||||
|
rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata)
|
||||||
|
{
|
||||||
|
__ETHTOOL_DECLARE_LINK_MODE_MASK(common);
|
||||||
|
struct rtl8101_private *tp = netdev_priv(net);
|
||||||
|
unsigned long flags;
|
||||||
|
u16 val;
|
||||||
|
|
||||||
|
if (!rtl8101_support_eee(tp))
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&tp->lock, flags);
|
||||||
|
|
||||||
|
if (unlikely(tp->rtk_enable_diag)) {
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
rtl8101_mdio_write(tp, 0x1F, 0x0A5C);
|
||||||
|
val = rtl8101_mdio_read(tp, 0x12);
|
||||||
|
val &= BIT_1;
|
||||||
|
mii_eee_cap1_mod_linkmode_t(edata->supported, val);
|
||||||
|
|
||||||
|
rtl8101_mdio_write(tp, 0x1F, 0x0A5D);
|
||||||
|
val = rtl8101_mdio_read(tp, 0x10);
|
||||||
|
mii_eee_cap1_mod_linkmode_t(edata->advertised, val);
|
||||||
|
|
||||||
|
val = rtl8101_mdio_read(tp, 0x11);
|
||||||
|
mii_eee_cap1_mod_linkmode_t(edata->lp_advertised, val);
|
||||||
|
|
||||||
|
val = rtl8101_eri_read(tp, 0x1B0, 2, ERIAR_ExGMAC);
|
||||||
|
val &= BIT_1 | BIT_0;
|
||||||
|
|
||||||
|
rtl8101_mdio_write(tp, 0x1F, 0x0000);
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
|
||||||
|
edata->eee_enabled = !!val;
|
||||||
|
linkmode_and(common, edata->advertised, edata->lp_advertised);
|
||||||
|
edata->eee_active = !linkmode_empty(common);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *eee)
|
||||||
|
{
|
||||||
|
struct rtl8101_private *tp = netdev_priv(net);
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
if (!rtl8101_support_eee(tp))
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
if (!HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp))
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&tp->lock, flags);
|
||||||
|
|
||||||
|
if (unlikely(tp->rtk_enable_diag)) {
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tp->autoneg != AUTONEG_ENABLE) {
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tp->eee_enabled = eee->eee_enabled;
|
||||||
|
tp->eee_adv_t = linkmode_to_mii_eee_cap1_t(eee->advertised);
|
||||||
|
|
||||||
|
if (eee->eee_enabled)
|
||||||
|
rtl8101_enable_eee(tp);
|
||||||
|
else
|
||||||
|
rtl8101_disable_eee(tp);
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
|
||||||
|
rtl_nway_reset(net);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static int
|
static int
|
||||||
rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *eee)
|
rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *eee)
|
||||||
{
|
{
|
||||||
@ -4783,13 +4879,18 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *eee)
|
|||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tp->autoneg != AUTONEG_ENABLE) {
|
||||||
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
tp->eee_enabled = eee->eee_enabled;
|
tp->eee_enabled = eee->eee_enabled;
|
||||||
tp->eee_adv_t = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
|
tp->eee_adv_t = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
|
||||||
|
|
||||||
if (tp->eee_enabled)
|
if (tp->eee_enabled)
|
||||||
rtl8101_enable_EEE(tp);
|
rtl8101_enable_eee(tp);
|
||||||
else
|
else
|
||||||
rtl8101_disable_EEE(tp);
|
rtl8101_disable_eee(tp);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&tp->lock, flags);
|
spin_unlock_irqrestore(&tp->lock, flags);
|
||||||
|
|
||||||
@ -4797,8 +4898,20 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *eee)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) */
|
||||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
|
||||||
|
static void rtl8101_get_channels(struct net_device *dev,
|
||||||
|
struct ethtool_channels *channel)
|
||||||
|
{
|
||||||
|
channel->max_rx = 1;
|
||||||
|
channel->max_tx = 1;
|
||||||
|
channel->rx_count = 1;
|
||||||
|
channel->tx_count = 1;
|
||||||
|
}
|
||||||
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) */
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
|
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
|
||||||
static const struct ethtool_ops rtl8101_ethtool_ops = {
|
static const struct ethtool_ops rtl8101_ethtool_ops = {
|
||||||
.get_drvinfo = rtl8101_get_drvinfo,
|
.get_drvinfo = rtl8101_get_drvinfo,
|
||||||
@ -4852,6 +4965,9 @@ static const struct ethtool_ops rtl8101_ethtool_ops = {
|
|||||||
.get_eee = rtl_ethtool_get_eee,
|
.get_eee = rtl_ethtool_get_eee,
|
||||||
.set_eee = rtl_ethtool_set_eee,
|
.set_eee = rtl_ethtool_set_eee,
|
||||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
|
||||||
|
.get_channels = rtl8101_get_channels,
|
||||||
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) */
|
||||||
.nway_reset = rtl_nway_reset,
|
.nway_reset = rtl_nway_reset,
|
||||||
};
|
};
|
||||||
#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
|
#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
|
||||||
@ -5039,15 +5155,17 @@ rtl8101_tally_counter_clear(struct rtl8101_private *tp)
|
|||||||
RTL_W32(tp, CounterAddrLow, ((u64)tp->tally_paddr & (DMA_BIT_MASK(32))) | CounterReset);
|
RTL_W32(tp, CounterAddrLow, ((u64)tp->tally_paddr & (DMA_BIT_MASK(32))) | CounterReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/*
|
||||||
|
static void
|
||||||
rtl8101_enable_now_is_oob(struct rtl8101_private *tp)
|
rtl8101_enable_now_is_oob(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
if( tp->HwSuppNowIsOobVer == 1 ) {
|
if( tp->HwSuppNowIsOobVer == 1 ) {
|
||||||
RTL_W8(tp, MCUCmd_reg, RTL_R8(tp, MCUCmd_reg) | Now_is_oob);
|
RTL_W8(tp, MCUCmd_reg, RTL_R8(tp, MCUCmd_reg) | Now_is_oob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
rtl8101_disable_now_is_oob(struct rtl8101_private *tp)
|
rtl8101_disable_now_is_oob(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
if( tp->HwSuppNowIsOobVer == 1 ) {
|
if( tp->HwSuppNowIsOobVer == 1 ) {
|
||||||
@ -5773,19 +5891,6 @@ rtl8101_hw_init(struct net_device *dev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (tp->mcfg) {
|
|
||||||
case CFG_METHOD_18:
|
|
||||||
case CFG_METHOD_19:
|
|
||||||
case CFG_METHOD_20:
|
|
||||||
if (aspm) {
|
|
||||||
if ((rtl8101_mac_ocp_read(tp, 0xDC00) & BIT_3) || (RTL_R8(tp, Config0) & 0x07)) {
|
|
||||||
RTL_W8(tp, 0x6E, RTL_R8(tp, 0x6E) | BIT_6);
|
|
||||||
rtl8101_eri_write(tp, 0x1AE, 2, 0x0403, ERIAR_ExGMAC);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (tp->mcfg) {
|
switch (tp->mcfg) {
|
||||||
case CFG_METHOD_17:
|
case CFG_METHOD_17:
|
||||||
rtl8101_eri_write(tp, 0x174, 2, 0x00FF, ERIAR_ExGMAC);
|
rtl8101_eri_write(tp, 0x174, 2, 0x00FF, ERIAR_ExGMAC);
|
||||||
@ -10050,9 +10155,9 @@ rtl8101_hw_phy_config(struct net_device *dev)
|
|||||||
|
|
||||||
if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
|
if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
|
||||||
if (tp->eee_enabled == 1)
|
if (tp->eee_enabled == 1)
|
||||||
rtl8101_enable_EEE(tp);
|
rtl8101_enable_eee(tp);
|
||||||
else
|
else
|
||||||
rtl8101_disable_EEE(tp);
|
rtl8101_disable_eee(tp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10380,9 +10485,12 @@ rtl8101_init_software_variable(struct net_device *dev)
|
|||||||
dev->min_mtu = ETH_MIN_MTU;
|
dev->min_mtu = ETH_MIN_MTU;
|
||||||
dev->max_mtu = ETH_DATA_LEN;
|
dev->max_mtu = ETH_DATA_LEN;
|
||||||
#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
||||||
|
|
||||||
|
if (rtl8101_support_eee(tp)) {
|
||||||
tp->eee_enabled = eee_enable;
|
tp->eee_enabled = eee_enable;
|
||||||
tp->eee_adv_t = MDIO_EEE_100TX;
|
tp->eee_adv_t = MDIO_EEE_100TX;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtl8101_release_board(struct pci_dev *pdev,
|
rtl8101_release_board(struct pci_dev *pdev,
|
||||||
@ -10455,7 +10563,7 @@ rtl8101_get_mac_address(struct net_device *dev)
|
|||||||
/* keep the original MAC address */
|
/* keep the original MAC address */
|
||||||
memcpy(tp->org_mac_addr, dev->dev_addr, MAC_ADDR_LEN);
|
memcpy(tp->org_mac_addr, dev->dev_addr, MAC_ADDR_LEN);
|
||||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
|
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
|
||||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
memcpy(dev->perm_addr, dev->dev_addr, MAC_ADDR_LEN);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -11681,10 +11789,35 @@ rtl8101_link_timer(struct timer_list *t)
|
|||||||
mod_timer(timer, jiffies + RTL8101_LINK_TIMEOUT);
|
mod_timer(timer, jiffies + RTL8101_LINK_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
|
||||||
|
static int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
|
||||||
|
int minvec, int maxvec)
|
||||||
|
{
|
||||||
|
int nvec = maxvec;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
if (maxvec < minvec)
|
||||||
|
return -ERANGE;
|
||||||
|
|
||||||
|
do {
|
||||||
|
rc = pci_enable_msix(dev, entries, nvec);
|
||||||
|
if (rc < 0) {
|
||||||
|
return rc;
|
||||||
|
} else if (rc > 0) {
|
||||||
|
if (rc < minvec)
|
||||||
|
return -ENOSPC;
|
||||||
|
nvec = rc;
|
||||||
|
}
|
||||||
|
} while (rc);
|
||||||
|
|
||||||
|
return nvec;
|
||||||
|
}
|
||||||
|
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) */
|
||||||
|
|
||||||
static int rtl8101_enable_msix(struct rtl8101_private *tp)
|
static int rtl8101_enable_msix(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
int nvecs = 0;
|
int nvecs = 0;
|
||||||
struct msix_entry msix_ent[1] = {0};
|
struct msix_entry msix_ent[1] = {{0}};
|
||||||
|
|
||||||
nvecs = pci_enable_msix_range(tp->pci_dev, msix_ent,
|
nvecs = pci_enable_msix_range(tp->pci_dev, msix_ent,
|
||||||
1, 1);
|
1, 1);
|
||||||
@ -12212,9 +12345,8 @@ rtl8101_hw_set_rx_packet_filter(struct net_device *dev)
|
|||||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
||||||
AcceptAllPhys;
|
AcceptAllPhys;
|
||||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
||||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit)
|
} else if (dev->flags & IFF_ALLMULTI) {
|
||||||
|| (dev->flags & IFF_ALLMULTI)) {
|
/* accept all multicasts. */
|
||||||
/* Too many to filter perfectly -- accept all multicasts. */
|
|
||||||
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
||||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
||||||
} else {
|
} else {
|
||||||
@ -12786,10 +12918,7 @@ rtl8101_hw_config(struct net_device *dev)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (tp->mcfg) {
|
switch (tp->mcfg) {
|
||||||
case CFG_METHOD_17:
|
case CFG_METHOD_17: {
|
||||||
case CFG_METHOD_18:
|
|
||||||
case CFG_METHOD_19:
|
|
||||||
case CFG_METHOD_20: {
|
|
||||||
int timeout;
|
int timeout;
|
||||||
for (timeout = 0; timeout < 10; timeout++) {
|
for (timeout = 0; timeout < 10; timeout++) {
|
||||||
if ((rtl8101_eri_read(tp, 0x1AE, 2, ERIAR_ExGMAC) & BIT_13)==0)
|
if ((rtl8101_eri_read(tp, 0x1AE, 2, ERIAR_ExGMAC) & BIT_13)==0)
|
||||||
@ -13873,7 +14002,7 @@ process_pkt:
|
|||||||
RTLDEV->stats.rx_dropped++;
|
RTLDEV->stats.rx_dropped++;
|
||||||
RTLDEV->stats.rx_length_errors++;
|
RTLDEV->stats.rx_length_errors++;
|
||||||
rtl8101_mark_to_asic(desc, tp->rx_buf_sz);
|
rtl8101_mark_to_asic(desc, tp->rx_buf_sz);
|
||||||
continue;
|
goto release_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb = tp->Rx_skbuff[entry];
|
skb = tp->Rx_skbuff[entry];
|
||||||
@ -13910,6 +14039,8 @@ process_pkt:
|
|||||||
RTLDEV->stats.rx_bytes += pkt_size;
|
RTLDEV->stats.rx_bytes += pkt_size;
|
||||||
RTLDEV->stats.rx_packets++;
|
RTLDEV->stats.rx_packets++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release_descriptor:
|
||||||
cur_rx++;
|
cur_rx++;
|
||||||
entry = cur_rx % tp->num_rx_desc;
|
entry = cur_rx % tp->num_rx_desc;
|
||||||
desc = tp->RxDescArray + entry;
|
desc = tp->RxDescArray + entry;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
@ -93,7 +93,7 @@ void rtl8101_eeprom_cleanup(struct rtl8101_private *tp)
|
|||||||
rtl8101_lower_clock(tp, &x);
|
rtl8101_lower_clock(tp, &x);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtl8101_eeprom_cmd_done(struct rtl8101_private *tp)
|
static int rtl8101_eeprom_cmd_done(struct rtl8101_private *tp)
|
||||||
{
|
{
|
||||||
u8 x;
|
u8 x;
|
||||||
int i;
|
int i;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
# r8101 is the Linux device driver released for Realtek Fast Ethernet
|
||||||
# controllers with PCI-Express interface.
|
# controllers with PCI-Express interface.
|
||||||
#
|
#
|
||||||
# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved.
|
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the Free
|
# under the terms of the GNU General Public License as published by the Free
|
||||||
|
Loading…
Reference in New Issue
Block a user