Projects
home:bitstreamout:Essentials
r8168
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 19
View file
r8168.changes
Changed
@@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue May 10 10:30:35 UTC 2022 - Werner Fink <werner@suse.de> + +- Update to new version 8.050.00 +- Port patches r8168-kernel_version.patch and r8168-configuration.patch + +------------------------------------------------------------------- Thu Jan 21 15:49:06 UTC 2021 - Werner Fink <werner@suse.de> - Now we change to github for basic download
View file
r8168.spec
Changed
@@ -18,7 +18,7 @@ #!BuildIgnore: enough-build-resources Name: r8168 -Version: 8.048.03 +Version: 8.050.00 Release: 0 Summary: Device driver for RealTek Gigabit Ethernet controllers License: GPL-2.0-or-later
View file
r8168-configuration.patch
Changed
@@ -3,8 +3,8 @@ 1 file changed, 1 insertion(+) --- src/Makefile -+++ src/Makefile 2018-01-10 14:35:59.981468278 +0000 -@@ -44,6 +44,7 @@ ENABLE_S0_MAGIC_PACKET = n ++++ src/Makefile 2022-05-10 10:26:59.851240712 +0000 +@@ -48,6 +48,7 @@ CONFIG_CTAP_SHORT_OFF = n ifneq ($(KERNELRELEASE),) obj-m := r8168.o r8168-objs := r8168_n.o r8168_asf.o rtl_eeprom.o rtltool.o
View file
r8168-kernel_version.patch
Changed
@@ -4,8 +4,8 @@ 2 files changed, 18 insertions(+), 1 deletion(-) --- src/r8168.h -+++ src/r8168.h 2021-01-25 09:25:12.615124741 +0000 -@@ -116,6 +116,10 @@ do { \ ++++ src/r8168.h 2022-05-10 10:26:28.831787721 +0000 +@@ -121,6 +121,10 @@ do { \ } while (0) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) @@ -17,8 +17,8 @@ #if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present) #define vlan_tx_tag_present skb_vlan_tag_present --- src/r8168_n.c -+++ src/r8168_n.c 2021-01-25 11:42:13.268115241 +0000 -@@ -60,11 +60,16 @@ ++++ src/r8168_n.c 2022-05-10 10:26:28.871787016 +0000 +@@ -61,11 +61,16 @@ #include <linux/rtnetlink.h> #include <linux/completion.h> @@ -35,7 +35,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,37) #include <linux/prefetch.h> #endif -@@ -459,8 +464,12 @@ static void rtl8168_set_rx_mode(struct n +@@ -571,8 +576,12 @@ static void rtl8168_set_rx_mode(struct n #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue); #else @@ -48,7 +48,7 @@ static struct net_device_stats *rtl8168_get_stats(struct net_device *dev); static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget); static int rtl8168_change_mtu(struct net_device *dev, int new_mtu); -@@ -27948,8 +27957,12 @@ static void +@@ -28748,8 +28757,12 @@ static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue) #else static void @@ -61,7 +61,7 @@ { struct rtl8168_private *tp = netdev_priv(dev); unsigned long flags; -@@ -28655,7 +28668,7 @@ process_pkt: +@@ -29435,7 +29448,7 @@ process_pkt: if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) rtl8168_rx_skb(tp, skb);
View file
r8168-8.048.03.tar.gz/Makefile -> r8168-8.050.00.tar.gz/Makefile
Changed
@@ -1,9 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/autorun.sh -> r8168-8.050.00.tar.gz/autorun.sh
Changed
@@ -1,4 +1,5 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only # invoke insmod with all arguments we got # and use a pathname, as insmod doesn't look in . by default
View file
r8168-8.048.03.tar.gz/src/Makefile -> r8168-8.050.00.tar.gz/src/Makefile
Changed
@@ -1,9 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -40,6 +41,9 @@ ENABLE_S5_KEEP_CURR_MAC = n ENABLE_EEE = y ENABLE_S0_MAGIC_PACKET = n +CONFIG_DYNAMIC_ASPM = y +ENABLE_USE_FIRMWARE_FILE = n +CONFIG_CTAP_SHORT_OFF = n ifneq ($(KERNELRELEASE),) obj-m := r8168.o @@ -83,6 +87,16 @@ ifeq ($(ENABLE_S0_MAGIC_PACKET), y) EXTRA_CFLAGS += -DENABLE_S0_MAGIC_PACKET endif + ifeq ($(CONFIG_DYNAMIC_ASPM), y) + EXTRA_CFLAGS += -DCONFIG_DYNAMIC_ASPM + endif + ifeq ($(ENABLE_USE_FIRMWARE_FILE), y) + r8168-objs += r8168_firmware.o + EXTRA_CFLAGS += -DENABLE_USE_FIRMWARE_FILE + endif + ifeq ($(CONFIG_CTAP_SHORT_OFF), y) + EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF + endif else BASEDIR := /lib/modules/$(shell uname -r) KERNELDIR ?= $(BASEDIR)/build
View file
r8168-8.048.03.tar.gz/src/Makefile_linux24x -> r8168-8.050.00.tar.gz/src/Makefile_linux24x
Changed
@@ -1,9 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/r8168.h -> r8168-8.050.00.tar.gz/src/r8168.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -36,6 +37,10 @@ #include "r8168_realwow.h" #include "r8168_fiber.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) +typedef int netdev_tx_t; +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) #define skb_transport_offset(skb) (skb->h.raw - skb->data) #endif @@ -133,6 +138,10 @@ #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +#define eth_random_addr(addr) random_ether_addr(addr) +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) #define netdev_features_t u32 @@ -335,12 +344,12 @@ #define DASH_SUFFIX "" #endif -#define RTL8168_VERSION "8.048.03" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX +#define RTL8168_VERSION "8.050.00" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX #define MODULENAME "r8168" #define PFX MODULENAME ": " #define GPL_CLAIM "\ -r8168 Copyright (C) 2020 Realtek NIC software team <nicfae@realtek.com> \n \ +r8168 Copyright (C) 2022 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 is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n" @@ -423,12 +432,18 @@ #define RTL8168_LINK_TIMEOUT (1 * HZ) #define RTL8168_ESD_TIMEOUT (2 * HZ) -#define NUM_TX_DESC 1024 /* Number of Tx descriptor registers */ -#define NUM_RX_DESC 1024 /* Number of Rx descriptor registers */ +#define MAX_NUM_TX_DESC 1024 /* Maximum number of Tx descriptor registers */ +#define MAX_NUM_RX_DESC 1024 /* Maximum number of Rx descriptor registers */ + +#define MIN_NUM_TX_DESC 32 /* Minimum number of Tx descriptor registers */ +#define MIN_NUM_RX_DESC 32 /* Minimum number of Rx descriptor registers */ + +#define NUM_TX_DESC 256 /* Number of Tx descriptor registers */ +#define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ #define RX_BUF_SIZE 0x05F3 /* 0x05F3 = 1522bye + 1 */ -#define R8168_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) -#define R8168_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) + +#define OCP_STD_PHY_BASE 0xa400 #define NODE_ADDRESS_SIZE 6 @@ -492,6 +507,10 @@ #define ADVERTISE_1000HALF 0x100 #endif +#ifndef ETH_MIN_MTU +#define ETH_MIN_MTU 68 +#endif + /*****************************************************************************/ //#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) @@ -1173,6 +1192,7 @@ PMEnable = (1 << 0), /* Power Management Enable */ /* Config2 register */ + ClkReqEn = (1 << 7), /* Clock Request Enable */ PMSTS_En = (1 << 5), /* Config3 register */ @@ -1194,6 +1214,7 @@ UWF = (1 << 4), /* Accept Unicast wakeup frame */ LanWake = (1 << 1), /* LanWake enable/disable */ PMEStatus = (1 << 0), /* PME status can be reset by PCI RST# */ + ASPM_en = (1 << 0), /* ASPM enable */ /* CPlusCmd */ EnableBist = (1 << 15), @@ -1454,6 +1475,15 @@ u32 pci_sn_h; }; +/* Flow Control Settings */ +enum rtl8168_fc_mode { + rtl8168_fc_none = 0, + rtl8168_fc_rx_pause, + rtl8168_fc_tx_pause, + rtl8168_fc_full, + rtl8168_fc_default +}; + struct rtl8168_private { void __iomem *mmio_addr; /* memory map physical address */ struct pci_dev *pci_dev; /* Index of PCI device */ @@ -1477,12 +1507,14 @@ u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ u32 dirty_rx; u32 dirty_tx; + u32 num_rx_desc; /* Number of Rx descriptor registers */ + u32 num_tx_desc; /* Number of Tx descriptor registers */ struct TxDesc *TxDescArray; /* 256-aligned Tx descriptor ring */ struct RxDesc *RxDescArray; /* 256-aligned Rx descriptor ring */ dma_addr_t TxPhyAddr; dma_addr_t RxPhyAddr; - struct sk_buff *Rx_skbuffNUM_RX_DESC; /* Rx data buffers */ - struct ring_info tx_skbNUM_TX_DESC; /* Tx data buffers */ + struct sk_buff *Rx_skbuffMAX_NUM_RX_DESC; /* Rx data buffers */ + struct ring_info tx_skbMAX_NUM_TX_DESC; /* Tx data buffers */ unsigned rx_buf_sz; struct timer_list esd_timer; struct timer_list link_timer; @@ -1510,6 +1542,7 @@ u8 duplex; u32 speed; u32 advertising; + enum rtl8168_fc_mode fcpause; u16 eeprom_len; u16 cur_page; u32 bios_setting; @@ -1554,9 +1587,6 @@ u8 UseSwPaddingShortPkt; - void *ShortPacketEmptyBuffer; - dma_addr_t ShortPacketEmptyBufferPhy; - u8 RequireAdcBiasPatch; u16 AdcBiasPatchIoffset; @@ -1575,20 +1605,35 @@ u8 HwSuppPhyOcpVer; + u8 HwSuppAspmClkIntrLock; + u16 NicCustLedValue; + u8 HwSuppUpsVer; + u8 HwSuppMagicPktVer; u8 HwSuppCheckPhyDisableModeVer; u8 random_mac; - u8 HwSuppGigaForceMode; - + u16 phy_reg_aner; u16 phy_reg_anlpar; + u16 phy_reg_gbsr; u32 HwPcieSNOffset; + u8 HwSuppEsdVer; + u8 TestPhyOcpReg; + u16 BackupPhyFuseDout_15_0; + u16 BackupPhyFuseDout_31_16; + u16 BackupPhyFuseDout_47_32; + u16 BackupPhyFuseDout_63_48; + + const char *fw_name; + struct rtl8168_fw *rtl_fw; + u32 ocp_base; + //Dash+++++++++++++++++ u8 HwSuppDashVer; u8 DASH; @@ -1618,37 +1663,29 @@ u8 DashFwDisableRx; - void *UnalignedSendToFwBufferVa; void *SendToFwBuffer ; - u64 SendToFwBufferPhy ; + dma_addr_t SendToFwBufferPhy ; u8 SendingToFw; - dma_addr_t UnalignedSendToFwBufferPa; PTX_DASH_SEND_FW_DESC TxDashSendFwDesc;
View file
r8168-8.048.03.tar.gz/src/r8168_asf.c -> r8168-8.050.00.tar.gz/src/r8168_asf.c
Changed
@@ -1,10 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/r8168_asf.h -> r8168-8.050.00.tar.gz/src/r8168_asf.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/r8168_dash.h -> r8168-8.050.00.tar.gz/src/r8168_dash.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -114,25 +115,23 @@ }; typedef struct _RX_DASH_FROM_FW_DESC { - u16 length; - u8 statusLowByte; - u8 statusHighByte; - u32 resv; - u64 BufferAddress; + __le16 length; + __le16 status; + __le32 resv; + __le64 BufferAddress; } RX_DASH_FROM_FW_DESC, *PRX_DASH_FROM_FW_DESC; typedef struct _TX_DASH_SEND_FW_DESC { - u16 length; - u8 statusLowByte; - u8 statusHighByte; - u32 resv; - u64 BufferAddress; + __le16 length; + __le16 status; + __le32 resv; + __le64 BufferAddress; } TX_DASH_SEND_FW_DESC, *PTX_DASH_SEND_FW_DESC; typedef struct _OSOOBHdr { - u32 len; + __le32 len; u8 type; u8 flag; u8 hostReqV; @@ -177,12 +176,11 @@ #define HW_DASH_SUPPORT_TYPE_2(_M) ((_M)->HwSuppDashVer == 2) #define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3) -#define RECV_FROM_FW_BUF_SIZE (1520) -#define SEND_TO_FW_BUF_SIZE (1520) +#define RECV_FROM_FW_BUF_SIZE (2048) +#define SEND_TO_FW_BUF_SIZE (2048) #define RX_DASH_FROM_FW_OWN BIT_15 #define TX_DASH_SEND_FW_OWN BIT_15 -#define TX_DASH_SEND_FW_OWN_HIGHBYTE BIT_7 #define TXS_CC3_0 (BIT_0|BIT_1|BIT_2|BIT_3) #define TXS_EXC BIT_4
View file
r8168-8.048.03.tar.gz/src/r8168_fiber.h -> r8168-8.050.00.tar.gz/src/r8168_fiber.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -43,24 +44,26 @@ enum { FIBER_STAT_NOT_CHECKED = 0, - FIBER_STAT_CONNECT, + FIBER_STAT_CONNECT_EEPROM, FIBER_STAT_DISCONNECT, + FIBER_STAT_CONNECT_GPO, FIBER_STAT_MAX }; #define HW_FIBER_MODE_ENABLED(_M) ((_M)->HwFiberModeVer > 0) +#define HW_FIBER_STATUS_CONNECTED(_M) (((_M)->HwFiberStat == FIBER_STAT_CONNECT_EEPROM) || ((_M)->HwFiberStat == FIBER_STAT_CONNECT_GPO)) +#define HW_FIBER_STATUS_DISCONNECTED(_M) ((_M)->HwFiberStat == FIBER_STAT_DISCONNECT) +struct rtl8168_private; - -void rtl8168_hw_init_fiber_nic(struct net_device *dev); -void rtl8168_hw_fiber_nic_d3_para(struct net_device *dev); -void rtl8168_hw_fiber_phy_config(struct net_device *dev); -void rtl8168_hw_switch_mdi_to_fiber(struct net_device *dev); -void rtl8168_hw_switch_mdi_to_nic(struct net_device *dev); -unsigned int rtl8168_hw_fiber_link_ok(struct net_device *dev); -void rtl8168_check_fiber_link_status(struct net_device *dev); -void rtl8168_check_hw_fiber_mode_support(struct net_device *dev); -void rtl8168_set_fiber_mode_software_variable(struct net_device *dev); - +void rtl8168_hw_init_fiber_nic(struct rtl8168_private *tp); +void rtl8168_hw_fiber_nic_d3_para(struct rtl8168_private *tp); +void rtl8168_hw_fiber_phy_config(struct rtl8168_private *tp); +void rtl8168_hw_switch_mdi_to_fiber(struct rtl8168_private *tp); +void rtl8168_hw_switch_mdi_to_nic(struct rtl8168_private *tp); +unsigned int rtl8168_hw_fiber_link_ok(struct rtl8168_private *tp); +void rtl8168_check_fiber_link_status(struct rtl8168_private *tp); +void rtl8168_check_hw_fiber_mode_support(struct rtl8168_private *tp); +void rtl8168_set_fiber_mode_software_variable(struct rtl8168_private *tp); #endif /* _LINUX_R8168_FIBER_H */
View file
r8168-8.050.00.tar.gz/src/r8168_firmware.c
Added
@@ -0,0 +1,264 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +################################################################################ +# +# r8168 is the Linux device driver released for Realtek Gigabit Ethernet +# controllers with PCI-Express interface. +# +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# +# 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 +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see <http://www.gnu.org/licenses/>. +# +# Author: +# Realtek NIC software team <nicfae@realtek.com> +# No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan +# +################################################################################ +*/ + +/************************************************************************************ + * This product is covered by one or more of the following patents: + * US6,570,884, US6,115,776, and US6,327,625. + ***********************************************************************************/ + +#include <linux/version.h> +#include <linux/delay.h> +#include <linux/firmware.h> + +#include "r8168_firmware.h" + +enum rtl_fw_opcode { + PHY_READ = 0x0, + PHY_DATA_OR = 0x1, + PHY_DATA_AND = 0x2, + PHY_BJMPN = 0x3, + PHY_MDIO_CHG = 0x4, + PHY_CLEAR_READCOUNT = 0x7, + PHY_WRITE = 0x8, + PHY_READCOUNT_EQ_SKIP = 0x9, + PHY_COMP_EQ_SKIPN = 0xa, + PHY_COMP_NEQ_SKIPN = 0xb, + PHY_WRITE_PREVIOUS = 0xc, + PHY_SKIPN = 0xd, + PHY_DELAY_MS = 0xe, +}; + +struct fw_info { + u32 magic; + char versionRTL8168_VER_SIZE; + __le32 fw_start; + __le32 fw_len; + u8 chksum; +} __packed; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,16,0) +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) +#endif +#define FW_OPCODE_SIZE sizeof_field(struct rtl8168_fw_phy_action, code0) + +static bool rtl8168_fw_format_ok(struct rtl8168_fw *rtl_fw) +{ + const struct firmware *fw = rtl_fw->fw; + struct fw_info *fw_info = (struct fw_info *)fw->data; + struct rtl8168_fw_phy_action *pa = &rtl_fw->phy_action; + + if (fw->size < FW_OPCODE_SIZE) + return false; + + if (!fw_info->magic) { + size_t i, size, start; + u8 checksum = 0; + + if (fw->size < sizeof(*fw_info)) + return false; + + for (i = 0; i < fw->size; i++) + checksum += fw->datai; + if (checksum != 0) + return false; + + start = le32_to_cpu(fw_info->fw_start); + if (start > fw->size) + return false; + + size = le32_to_cpu(fw_info->fw_len); + if (size > (fw->size - start) / FW_OPCODE_SIZE) + return false; + + strscpy(rtl_fw->version, fw_info->version, RTL8168_VER_SIZE); + + pa->code = (__le32 *)(fw->data + start); + pa->size = size; + } else { + if (fw->size % FW_OPCODE_SIZE) + return false; + + strscpy(rtl_fw->version, rtl_fw->fw_name, RTL8168_VER_SIZE); + + pa->code = (__le32 *)fw->data; + pa->size = fw->size / FW_OPCODE_SIZE; + } + + return true; +} + +static bool rtl8168_fw_data_ok(struct rtl8168_fw *rtl_fw) +{ + struct rtl8168_fw_phy_action *pa = &rtl_fw->phy_action; + size_t index; + + for (index = 0; index < pa->size; index++) { + u32 action = le32_to_cpu(pa->codeindex); + u32 val = action & 0x0000ffff; + u32 regno = (action & 0x0fff0000) >> 16; + + switch (action >> 28) { + case PHY_READ: + case PHY_DATA_OR: + case PHY_DATA_AND: + case PHY_CLEAR_READCOUNT: + case PHY_WRITE: + case PHY_WRITE_PREVIOUS: + case PHY_DELAY_MS: + break; + + case PHY_MDIO_CHG: + if (val > 1) + goto out; + break; + + case PHY_BJMPN: + if (regno > index) + goto out; + break; + case PHY_READCOUNT_EQ_SKIP: + if (index + 2 >= pa->size) + goto out; + break; + case PHY_COMP_EQ_SKIPN: + case PHY_COMP_NEQ_SKIPN: + case PHY_SKIPN: + if (index + 1 + regno >= pa->size) + goto out; + break; + + default: + dev_err(rtl_fw->dev, "Invalid action 0x%08x\n", action); + return false; + } + } + + return true; +out: + dev_err(rtl_fw->dev, "Out of range of firmware\n"); + return false; +} + +void rtl8168_fw_write_firmware(struct rtl8168_private *tp, struct rtl8168_fw *rtl_fw) +{ + struct rtl8168_fw_phy_action *pa = &rtl_fw->phy_action; + rtl8168_fw_write_t fw_write = rtl_fw->phy_write; + rtl8168_fw_read_t fw_read = rtl_fw->phy_read; + int predata = 0, count = 0; + size_t index; + + for (index = 0; index < pa->size; index++) { + u32 action = le32_to_cpu(pa->codeindex); + u32 data = action & 0x0000ffff; + u32 regno = (action & 0x0fff0000) >> 16; + enum rtl_fw_opcode opcode = action >> 28; + + if (!action) + break; + + switch (opcode) { + case PHY_READ: + predata = fw_read(tp, regno); + count++; + break; + case PHY_DATA_OR: + predata |= data; + break; + case PHY_DATA_AND: + predata &= data; + break; + case PHY_BJMPN: + index -= (regno + 1); + break; + case PHY_MDIO_CHG:
View file
r8168-8.050.00.tar.gz/src/r8168_firmware.h
Added
@@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +################################################################################ +# +# r8168 is the Linux device driver released for Realtek 2.5Gigabit Ethernet +# controllers with PCI-Express interface. +# +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# +# 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 +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see <http://www.gnu.org/licenses/>. +# +# Author: +# Realtek NIC software team <nicfae@realtek.com> +# No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan +# +################################################################################ +*/ + +/************************************************************************************ + * This product is covered by one or more of the following patents: + * US6,570,884, US6,115,776, and US6,327,625. + ***********************************************************************************/ + +#ifndef _LINUX_RTL8168_FIRMWARE_H +#define _LINUX_RTL8168_FIRMWARE_H + +#include <linux/device.h> +#include <linux/firmware.h> + +struct rtl8168_private; +typedef void (*rtl8168_fw_write_t)(struct rtl8168_private *tp, u16 reg, u16 val); +typedef u32 (*rtl8168_fw_read_t)(struct rtl8168_private *tp, u16 reg); + +#define RTL8168_VER_SIZE 32 + +struct rtl8168_fw { + rtl8168_fw_write_t phy_write; + rtl8168_fw_read_t phy_read; + rtl8168_fw_write_t mac_mcu_write; + rtl8168_fw_read_t mac_mcu_read; + const struct firmware *fw; + const char *fw_name; + struct device *dev; + + char versionRTL8168_VER_SIZE; + + struct rtl8168_fw_phy_action { + __le32 *code; + size_t size; + } phy_action; +}; + +int rtl8168_fw_request_firmware(struct rtl8168_fw *rtl_fw); +void rtl8168_fw_release_firmware(struct rtl8168_fw *rtl_fw); +void rtl8168_fw_write_firmware(struct rtl8168_private *tp, struct rtl8168_fw *rtl_fw); + +#endif /* _LINUX_RTL8168_FIRMWARE_H */
View file
r8168-8.048.03.tar.gz/src/r8168_n.c -> r8168-8.050.00.tar.gz/src/r8168_n.c
Changed
@@ -1,10 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -87,16 +88,81 @@ #include "r8168_asf.h" #include "rtl_eeprom.h" #include "rtltool.h" +#include "r8168_firmware.h" #ifdef ENABLE_R8168_PROCFS #include <linux/proc_fs.h> #include <linux/seq_file.h> #endif +#define FIRMWARE_8168D_1 "rtl_nic/rtl8168d-1.fw" +#define FIRMWARE_8168D_2 "rtl_nic/rtl8168d-2.fw" +#define FIRMWARE_8168E_1 "rtl_nic/rtl8168e-1.fw" +#define FIRMWARE_8168E_2 "rtl_nic/rtl8168e-2.fw" +#define FIRMWARE_8168E_3 "rtl_nic/rtl8168e-3.fw" +#define FIRMWARE_8168E_4 "rtl_nic/rtl8168e-4.fw" +#define FIRMWARE_8168F_1 "rtl_nic/rtl8168f-1.fw" +#define FIRMWARE_8168F_2 "rtl_nic/rtl8168f-2.fw" +#define FIRMWARE_8411_1 "rtl_nic/rtl8411-1.fw" +#define FIRMWARE_8411_2 "rtl_nic/rtl8411-2.fw" +#define FIRMWARE_8168G_2 "rtl_nic/rtl8168g-2.fw" +#define FIRMWARE_8168G_3 "rtl_nic/rtl8168g-3.fw" +#define FIRMWARE_8168EP_1 "rtl_nic/rtl8168ep-1.fw" +#define FIRMWARE_8168EP_2 "rtl_nic/rtl8168ep-2.fw" +#define FIRMWARE_8168EP_3 "rtl_nic/rtl8168ep-3.fw" +#define FIRMWARE_8168H_1 "rtl_nic/rtl8168h-1.fw" +#define FIRMWARE_8168H_2 "rtl_nic/rtl8168h-2.fw" +#define FIRMWARE_8168H_3 "rtl_nic/rtl8168h-3.fw" +#define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw" +#define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw" + /* 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; +static const struct { + const char *name; + const char *fw_name; +} rtl_chip_fw_infos = { + /* PCI-E devices. */ + CFG_METHOD_1 = {"RTL8168B/8111", }, + CFG_METHOD_2 = {"RTL8168B/8111", }, + CFG_METHOD_3 = {"RTL8168B/8111", }, + CFG_METHOD_4 = {"RTL8168C/8111C", }, + CFG_METHOD_5 = {"RTL8168C/8111C", }, + CFG_METHOD_6 = {"RTL8168C/8111C", }, + CFG_METHOD_7 = {"RTL8168CP/8111CP", }, + CFG_METHOD_8 = {"RTL8168CP/8111CP", }, + CFG_METHOD_9 = {"RTL8168D/8111D", FIRMWARE_8168D_1}, + CFG_METHOD_10 = {"RTL8168D/8111D", FIRMWARE_8168D_2}, + CFG_METHOD_11 = {"RTL8168DP/8111DP", }, + CFG_METHOD_12 = {"RTL8168DP/8111DP", }, + CFG_METHOD_13 = {"RTL8168DP/8111DP", }, + CFG_METHOD_14 = {"RTL8168E/8111E", FIRMWARE_8168E_1}, + CFG_METHOD_15 = {"RTL8168E/8111E", FIRMWARE_8168E_2}, + CFG_METHOD_16 = {"RTL8168E-VL/8111E-VL", FIRMWARE_8168E_3}, + CFG_METHOD_17 = {"RTL8168E-VL/8111E-VL", FIRMWARE_8168E_4}, + CFG_METHOD_18 = {"RTL8168F/8111F", FIRMWARE_8168F_1}, + CFG_METHOD_19 = {"RTL8168F/8111F", FIRMWARE_8168F_2}, + CFG_METHOD_20 = {"RTL8411", FIRMWARE_8411_1}, + CFG_METHOD_21 = {"RTL8168G/8111G", FIRMWARE_8168G_2}, + CFG_METHOD_22 = {"RTL8168G/8111G", }, + CFG_METHOD_23 = {"RTL8168EP/8111EP", FIRMWARE_8168EP_1}, + CFG_METHOD_24 = {"RTL8168GU/8111GU", }, + CFG_METHOD_25 = {"RTL8168GU/8111GU", FIRMWARE_8168G_3}, + CFG_METHOD_26 = {"8411B", FIRMWARE_8411_2}, + CFG_METHOD_27 = {"RTL8168EP/8111EP", FIRMWARE_8168EP_2}, + CFG_METHOD_28 = {"RTL8168EP/8111EP", FIRMWARE_8168EP_3}, + CFG_METHOD_29 = {"RTL8168H/8111H", FIRMWARE_8168H_1}, + CFG_METHOD_30 = {"RTL8168H/8111H", FIRMWARE_8168H_2}, + CFG_METHOD_31 = {"RTL8168FP/8111FP", }, + CFG_METHOD_32 = {"RTL8168FP/8111FP", FIRMWARE_8168FP_3}, + CFG_METHOD_33 = {"RTL8168FP/8111FP", FIRMWARE_8168FP_4}, + CFG_METHOD_34 = {"RTL8168FP/8111FP", FIRMWARE_8168FP_4}, + CFG_METHOD_35 = {"RTL8168H/8111H", FIRMWARE_8168H_3}, + CFG_METHOD_DEFAULT = {"Unknown", }, +}; + #define _R(NAME,MAC,RCR,MASK, JumFrameSz) \ { .name = NAME, .mcfg = MAC, .RCR_Cfg = RCR, .RxConfigMask = MASK, .jumbo_frame_sz = JumFrameSz } @@ -305,6 +371,18 @@ 0xff7e5880, Jumbo_Frame_9k), + _R("RTL8168FP/8111FP", + CFG_METHOD_34, + RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + + _R("RTL8168H/8111H", + CFG_METHOD_35, + RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + _R("Unknown", CFG_METHOD_DEFAULT, (RX_DMA_BURST << RxCfgDMAShift), @@ -331,6 +409,7 @@ static int rx_copybreak = 0; static int use_dac = 1; static int timer_count = 0x2600; +static int dynamic_aspm_packet_threshold = 10; static struct { u32 msg_enable; @@ -350,6 +429,11 @@ #else static int aspm = 0; #endif +#ifdef CONFIG_DYNAMIC_ASPM +static int dynamic_aspm = 1; +#else +static int dynamic_aspm = 0; +#endif #ifdef ENABLE_S5WOL static int s5wol = 1; #else @@ -394,6 +478,9 @@ module_param(aspm, int, 0); MODULE_PARM_DESC(aspm, "Enable ASPM."); +module_param(dynamic_aspm, int, 0); +MODULE_PARM_DESC(aspm, "Enable Software Dynamic ASPM."); + module_param(s5wol, int, 0); MODULE_PARM_DESC(s5wol, "Enable Shutdown Wake On Lan."); @@ -418,12 +505,37 @@ module_param(s0_magic_packet, int, 0); MODULE_PARM_DESC(s0_magic_packet, "Enable S0 Magic Packet."); +module_param(dynamic_aspm_packet_threshold, int, 0); +MODULE_PARM_DESC(dynamic_aspm_packet_threshold, "Dynamic ASPM packet threshold."); + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) module_param_named(debug, debug.msg_enable, int, 0); MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); #endif//LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) MODULE_LICENSE("GPL"); +#ifdef ENABLE_USE_FIRMWARE_FILE +MODULE_FIRMWARE(FIRMWARE_8168D_1); +MODULE_FIRMWARE(FIRMWARE_8168D_2); +MODULE_FIRMWARE(FIRMWARE_8168E_1); +MODULE_FIRMWARE(FIRMWARE_8168E_2); +MODULE_FIRMWARE(FIRMWARE_8168E_3); +MODULE_FIRMWARE(FIRMWARE_8168E_4); +MODULE_FIRMWARE(FIRMWARE_8168F_1); +MODULE_FIRMWARE(FIRMWARE_8168F_2); +MODULE_FIRMWARE(FIRMWARE_8411_1); +MODULE_FIRMWARE(FIRMWARE_8411_2); +MODULE_FIRMWARE(FIRMWARE_8168G_2); +MODULE_FIRMWARE(FIRMWARE_8168G_3); +MODULE_FIRMWARE(FIRMWARE_8168EP_1); +MODULE_FIRMWARE(FIRMWARE_8168EP_2); +MODULE_FIRMWARE(FIRMWARE_8168EP_3); +MODULE_FIRMWARE(FIRMWARE_8168H_1); +MODULE_FIRMWARE(FIRMWARE_8168H_2); +MODULE_FIRMWARE(FIRMWARE_8168H_3); +MODULE_FIRMWARE(FIRMWARE_8168FP_3); +MODULE_FIRMWARE(FIRMWARE_8168FP_4); +#endif MODULE_VERSION(RTL8168_VERSION); @@ -444,7 +556,7 @@ static void rtl8168_rx_clear(struct rtl8168_private *tp); static int rtl8168_open(struct net_device *dev); -static int rtl8168_start_xmit(struct sk_buff *skb, struct net_device *dev); +static netdev_tx_t rtl8168_start_xmit(struct sk_buff *skb, struct net_device *dev); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static irqreturn_t rtl8168_interrupt(int irq, void *dev_instance, struct pt_regs *regs); #else @@ -467,11 +579,13 @@ static void rtl8168_down(struct net_device *dev); static int rtl8168_set_mac_address(struct net_device *dev, void *p); -void rtl8168_rar_set(struct rtl8168_private *tp, uint8_t *addr); +void rtl8168_rar_set(struct rtl8168_private *tp, const u8 *addr); static void rtl8168_desc_addr_fill(struct rtl8168_private *); static void rtl8168_tx_desc_init(struct rtl8168_private *tp); static void rtl8168_rx_desc_init(struct rtl8168_private *tp);
View file
r8168-8.048.03.tar.gz/src/r8168_realwow.h -> r8168-8.050.00.tar.gz/src/r8168_realwow.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/rtl_eeprom.c -> r8168-8.050.00.tar.gz/src/rtl_eeprom.c
Changed
@@ -1,10 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/rtl_eeprom.h -> r8168-8.050.00.tar.gz/src/rtl_eeprom.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
View file
r8168-8.048.03.tar.gz/src/rtltool.c -> r8168-8.050.00.tar.gz/src/rtltool.c
Changed
@@ -1,10 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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 @@ -55,9 +56,6 @@ ret = 0; switch (my_cmd.cmd) { case RTLTOOL_READ_MAC: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.len==1) my_cmd.data = readb(tp->mmio_addr+my_cmd.offset); else if (my_cmd.len==2) @@ -76,9 +74,6 @@ break; case RTLTOOL_WRITE_MAC: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.len==1) writeb(my_cmd.data, tp->mmio_addr+my_cmd.offset); else if (my_cmd.len==2) @@ -93,9 +88,6 @@ break; case RTLTOOL_READ_PHY: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_mdio_prot_read(tp, my_cmd.offset); spin_unlock_irqrestore(&tp->lock, flags); @@ -108,18 +100,12 @@ break; case RTLTOOL_WRITE_PHY: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8168_mdio_prot_write(tp, my_cmd.offset, my_cmd.data); spin_unlock_irqrestore(&tp->lock, flags); break; case RTLTOOL_READ_EPHY: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_ephy_read(tp, my_cmd.offset); spin_unlock_irqrestore(&tp->lock, flags); @@ -132,9 +118,6 @@ break; case RTLTOOL_WRITE_EPHY: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8168_ephy_write(tp, my_cmd.offset, my_cmd.data); spin_unlock_irqrestore(&tp->lock, flags); @@ -159,12 +142,6 @@ break; case RTLTOOL_WRITE_ERI: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.len==1 || my_cmd.len==2 || my_cmd.len==4) { spin_lock_irqsave(&tp->lock, flags); rtl8168_eri_write(tp, my_cmd.offset, my_cmd.len, my_cmd.data, ERIAR_ExGMAC); @@ -176,9 +153,6 @@ break; case RTLTOOL_READ_PCI: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - my_cmd.data = 0; if (my_cmd.len==1) pci_read_config_byte(tp->pci_dev, my_cmd.offset, @@ -201,9 +175,6 @@ break; case RTLTOOL_WRITE_PCI: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.len==1) pci_write_config_byte(tp->pci_dev, my_cmd.offset, my_cmd.data); @@ -221,9 +192,6 @@ break; case RTLTOOL_READ_EEPROM: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_eeprom_read_sc(tp, my_cmd.offset); spin_unlock_irqrestore(&tp->lock, flags); @@ -236,18 +204,12 @@ break; case RTLTOOL_WRITE_EEPROM: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8168_eeprom_write_sc(tp, my_cmd.offset, my_cmd.data); spin_unlock_irqrestore(&tp->lock, flags); break; case RTL_READ_OOB_MAC: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8168_oob_mutex_lock(tp); my_cmd.data = rtl8168_ocp_read(tp, my_cmd.offset, 4); @@ -261,9 +223,6 @@ break; case RTL_WRITE_OOB_MAC: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.len == 0 || my_cmd.len > 4) return -EOPNOTSUPP; @@ -275,9 +234,6 @@ break; case RTL_ENABLE_PCI_DIAG: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 1; spin_unlock_irqrestore(&tp->lock, flags); @@ -286,9 +242,6 @@ break; case RTL_DISABLE_PCI_DIAG: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 0; spin_unlock_irqrestore(&tp->lock, flags); @@ -297,9 +250,6 @@ break; case RTL_READ_MAC_OCP: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (my_cmd.offset % 2) return -EOPNOTSUPP; @@ -314,9 +264,6 @@ break; case RTL_WRITE_MAC_OCP: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if ((my_cmd.offset % 2) || (my_cmd.len != 2)) return -EOPNOTSUPP; @@ -326,9 +273,6 @@ break; case RTL_DIRECT_READ_PHY_OCP: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_mdio_prot_direct_read_phy_ocp(tp, my_cmd.offset); spin_unlock_irqrestore(&tp->lock, flags); @@ -341,9 +285,6 @@ break; case RTL_DIRECT_WRITE_PHY_OCP: - if (!capable(CAP_NET_ADMIN)) - return -EPERM;
View file
r8168-8.048.03.tar.gz/src/rtltool.h -> r8168-8.050.00.tar.gz/src/rtltool.h
Changed
@@ -1,10 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* ################################################################################ # # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. # # 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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.