Projects
Essentials
r8168
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 30
View file
r8168.changes
Changed
@@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Tue May 21 10:35:10 UTC 2024 - Dr. Werner Fink <werner@suse.de> + +- Update to new version r8168-8.053.00 +- Remove patches now upstream + * r8168-gcc14.patch +- Port patches + * r8168-kernel_version.patch + * r8168-support-dev0x8136.patch + * r8168-support-linux-5.19.patch +- Add patch r8168-support-ethtool_keee.patch + * Port struct ethtool_eee to new kernel struct ethtool_eee + and hopefully this works + +------------------------------------------------------------------- Thu Mar 28 12:50:15 UTC 2024 - Dr. Werner Fink <werner@suse.de> - Use kernel version of the include diretory instead of the used
View file
r8168.spec
Changed
@@ -18,7 +18,7 @@ #!BuildIgnore: enough-build-resources Name: r8168 -Version: 8.052.01 +Version: 8.053.00 Release: 0 Summary: Device driver for RealTek Gigabit Ethernet controllers License: GPL-2.0-or-later @@ -32,7 +32,7 @@ Patch0: r8168-kernel_version.patch Patch1: r8168-configuration.patch Patch2: r8168-support-linux-5.19.patch -Patch3: r8168-gcc14.patch +Patch3: r8168-support-ethtool_keee.patch Patch4: r8168-support-dev0x8136.patch Patch5: r8168-support-linux-L15.5.patch BuildRequires: kernel-source @@ -65,7 +65,6 @@ %patch -P 0 -b .p0 %patch -P 1 -b .p1 %patch -P 2 -p1 -b .p2 -%patch -P 3 -b .p3 %patch -P 4 -p1 -b .p4 if test -e /usr/src/linux/include/linux/ethtool.h then @@ -74,6 +73,11 @@ then %patch -P 5 -b .p5 fi + argc=$(sed -rn '/ethtool_keee/p' /usr/src/linux/include/linux/ethtool.h | wc -l) + if test -n "$argc" -a "$argc" -eq 3 + then +%patch -P 3 -p1 -b .p3 + fi fi if test -e /usr/src/linux/include/net/gso.h then
View file
r8168-gcc14.patch
Deleted
@@ -1,25 +0,0 @@ ---- - src/r8168_n.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- src/r8168_n.c -+++ src/r8168_n.c 2024-03-13 12:25:52.886342182 +0000 -@@ -6312,7 +6312,7 @@ rtl8168_get_drvinfo(struct net_device *d - info->eedump_len = tp->eeprom_len; - BUILD_BUG_ON(sizeof(info->fw_version) < sizeof(rtl_fw->version)); - if (rtl_fw) -- strlcpy(info->fw_version, rtl_fw->version, -+ strscpy(info->fw_version, rtl_fw->version, - sizeof(info->fw_version)); - } - -@@ -28103,7 +28103,8 @@ rtl8168_link_timer(struct timer_list *t) - } - */ - --int rtl8168_enable_msix(struct rtl8168_private *tp) -+static int -+rtl8168_enable_msix(struct rtl8168_private *tp) - { - int i, nvecs = 0; - struct msix_entry msix_entR8168_MAX_MSIX_VEC;
View file
r8168-kernel_version.patch
Changed
@@ -5,7 +5,7 @@ --- src/r8168.h +++ src/r8168.h 2024-03-13 11:51:59.011947503 +0000 -@@ -133,6 +133,10 @@ do { \ +@@ -196,6 +196,10 @@ do { \ } while (0) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) @@ -35,7 +35,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,37) #include <linux/prefetch.h> #endif -@@ -590,8 +595,12 @@ static void rtl8168_set_rx_mode(struct n +@@ -586,8 +591,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 *, struct rtl8168_rx_ring *, napi_budget); #ifdef CONFIG_R8168_NAPI -@@ -30765,8 +30774,12 @@ static void +@@ -30897,8 +30906,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); -@@ -31502,7 +31515,7 @@ rtl8168_rx_interrupt(struct net_device * +@@ -31636,7 +31649,7 @@ rtl8168_rx_interrupt(struct net_device * if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) rtl8168_rx_skb(tp, skb, ring_index);
View file
r8168-support-dev0x8136.patch
Changed
@@ -12,7 +12,7 @@ index 28d7636..cbf43d1 100755 --- a/src/r8168_n.c +++ b/src/r8168_n.c -@@ -430,6 +430,7 @@ static const struct { +@@ -426,6 +426,7 @@ static const struct { static struct pci_device_id rtl8168_pci_tbl = { { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), },
View file
r8168-support-ethtool_keee.patch
Added
@@ -0,0 +1,119 @@ +From 94426e16197c244d03aad0434e3490acdaa830fe Mon Sep 17 00:00:00 2001 +From: Masato TOYOSHIMA <phoepsilonix@phoepsilonix.love> +Date: Tue, 14 May 2024 14:52:58 +0900 +Subject: PATCH Linux 6.9 compat: change to ethtool_keee from ethtool_eee + +linux/include/linux/ethtool.h + +struct ethtool_ops + int (*get_eee)(struct net_device *dev, struct ethtool_keee *eee); + int (*set_eee)(struct net_device *dev, struct ethtool_keee *eee); + +change to ethtool_keee from ethtool_eee + rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata) + rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata) +--- + src/r8168_n.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +diff --git a/src/r8168_n.c b/src/r8168_n.c +index ad63f42..3d67641 100755 +--- a/src/r8168_n.c ++++ b/src/r8168_n.c +@@ -7941,7 +7941,11 @@ rtl8168_device_lpi_t_to_ethtool_lpi_t(struct rtl8168_private *tp , u32 lpi_timer + } + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata) ++#else + rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) ++#endif + { + struct rtl8168_private *tp = netdev_priv(net); + struct ethtool_eee *eee = &tp->eee; +@@ -7975,9 +7979,15 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) + + edata->eee_enabled = !!val; + edata->eee_active = !!(supported & adv & lp); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++ ethtool_convert_legacy_u32_to_link_mode(edata->supported, supported); ++ ethtool_convert_legacy_u32_to_link_mode(edata->advertised, adv); ++ ethtool_convert_legacy_u32_to_link_mode(edata->lp_advertised, lp); ++#else + edata->supported = supported; + edata->advertised = adv; + edata->lp_advertised = lp; ++#endif + edata->tx_lpi_enabled = edata->eee_enabled; + edata->tx_lpi_timer = tx_lpi_timer; + +@@ -7985,11 +7995,19 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) + } + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata) ++#else + rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) ++#endif + { + struct rtl8168_private *tp = netdev_priv(net); + struct ethtool_eee *eee = &tp->eee; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++ u32 advertising, adv; ++#else + u32 advertising; ++#endif + int rc = 0; + + if (!rtl8168_support_eee(tp)) +@@ -8013,6 +8031,18 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) + } + + advertising = tp->advertising; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++ ethtool_convert_link_mode_to_legacy_u32(&adv, edata->advertised); ++ if (linkmode_empty(edata->advertised)) { ++ adv = advertising & eee->supported; ++ ethtool_convert_legacy_u32_to_link_mode(edata->advertised, adv); ++ } else if (!linkmode_empty(edata->advertised) & ~advertising) { ++ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of autoneg advertised speeds %x\n", ++ adv, advertising); ++ rc = -EINVAL; ++ goto out; ++ } ++#else + if (!edata->advertised) { + edata->advertised = advertising & eee->supported; + } else if (edata->advertised & ~advertising) { +@@ -8021,15 +8051,29 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) + rc = -EINVAL; + goto out; + } ++#endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++ if (!linkmode_empty(edata->advertised) & ~eee->supported) { ++ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n", ++ adv, eee->supported); ++ rc = -EINVAL; ++ goto out; ++ } ++#else + if (edata->advertised & ~eee->supported) { + dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n", + edata->advertised, eee->supported); + rc = -EINVAL; + goto out; + } ++#endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) ++ ethtool_convert_link_mode_to_legacy_u32(&eee->advertised, edata->advertised); ++#else + eee->advertised = edata->advertised; ++#endif + eee->eee_enabled = edata->eee_enabled; + + if (eee->eee_enabled)
View file
r8168-support-linux-5.19.patch
Changed
@@ -1,18 +1,22 @@ ---- r8168-8.050.03/src/r8168_n.c -+++ r8168-8.050.03/src/r8168_n.c +--- + r8168-8.053.00/src/r8168_n.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- r8168-8.053.00/src/r8168_n.c ++++ r8168-8.053.00/src/r8168_n.c 2024-05-21 09:57:57.192604776 +0000 @@ -126,6 +126,15 @@ #define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw" #define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw" +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 18, 0) +static inline void netif_set_gso_max_size(struct net_device *dev, -+ unsigned int size) ++ unsigned int size) +{ -+ /* dev->gso_max_size is read locklessly from sk_setup_caps() */ -+ WRITE_ONCE(dev->gso_max_size, size); ++ /* dev->gso_max_size is read locklessly from sk_setup_caps() */ ++ WRITE_ONCE(dev->gso_max_size, size); +} +#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; + static const struct { + const char *name; + const char *fw_name;
View file
r8168-support-linux-L15.5.patch
Changed
@@ -4,7 +4,7 @@ --- src/r8168_n.c +++ src/r8168_n.c 2024-03-13 12:10:07.947820999 +0000 -@@ -6986,7 +6986,7 @@ rtl8168_set_ring_size(struct rtl8168_pri +@@ -7234,7 +7234,7 @@ rtl8168_set_ring_size(struct rtl8168_pri } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -13,7 +13,7 @@ static void rtl8168_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, -@@ -6994,7 +6994,7 @@ static void rtl8168_get_ringparam(struct +@@ -7242,7 +7242,7 @@ static void rtl8168_get_ringparam(struct #else static void rtl8168_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) @@ -22,7 +22,7 @@ { struct rtl8168_private *tp = netdev_priv(dev); -@@ -7004,7 +7004,7 @@ static void rtl8168_get_ringparam(struct +@@ -7252,7 +7252,7 @@ static void rtl8168_get_ringparam(struct ring->tx_pending = tp->tx_ring0.num_tx_desc; } @@ -31,7 +31,7 @@ static int rtl8168_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, -@@ -7012,7 +7012,7 @@ static int rtl8168_set_ringparam(struct +@@ -7260,7 +7260,7 @@ static int rtl8168_set_ringparam(struct #else static int rtl8168_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) @@ -40,7 +40,7 @@ { struct rtl8168_private *tp = netdev_priv(dev); u32 new_rx_count, new_tx_count; -@@ -26644,11 +26644,11 @@ rtl8168_release_board(struct pci_dev *pd +@@ -26737,11 +26737,11 @@ rtl8168_release_board(struct pci_dev *pd static void rtl8168_hw_address_set(struct net_device *dev, u8 mac_addrMAC_ADDR_LEN) {
View file
r8168-8.052.01.tar.gz.asc
Deleted
@@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iHUEABYIAB0WIQQMrarPcPZMZU4TGzERZ1x0NCnd7wUCZRk1EAAKCRARZ1x0NCnd -761TAPsHdh+FI5/eoR1/vSKJ8nCBXVmP6xR9q5bHvknbyzcGJAD/Zq5BWgkYnfBR -M3Ow6FM7EZ7+iAlkIRAavYHASGXERQ4= -=QvU5 ------END PGP SIGNATURE-----
View file
r8168-8.053.00.tar.gz.asc
Added
@@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- + +iHUEABYKAB0WIQQMrarPcPZMZU4TGzERZ1x0NCnd7wUCZiUOBgAKCRARZ1x0NCnd +7zwaAP9/wR9UAKCbpYCVY4a527hxVnKbIskev0+SNUa++NYyKAD+KCZaGOKSVUOF +AUqJsVPNzKZkPn162vhgkJH9EOfBmQ0= +=DNig +-----END PGP SIGNATURE-----
View file
r8168-8.052.01.tar.gz/Makefile -> r8168-8.053.00.tar.gz/Makefile
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/README -> r8168-8.053.00.tar.gz/README
Changed
@@ -1,6 +1,6 @@ <Linux device driver for Realtek Ethernet controllers> - This is the Linux device driver released for RealTek RTL8168B/8111B, RTL8168C/8111C, RTL8168CP/8111CP, RTL8168D/8111D, RTL8168DP/8111DP, and RTL8168E/8111E Gigabit Ethernet controllers with PCI-Express interface. + This is the Linux device driver released for RealTek Gigabit Ethernet controllers with PCI-Express interface. <Requirements>
View file
r8168-8.052.01.tar.gz/src/Makefile -> r8168-8.053.00.tar.gz/src/Makefile
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/Makefile_linux24x -> r8168-8.053.00.tar.gz/src/Makefile_linux24x
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168.h -> r8168-8.053.00.tar.gz/src/r8168.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -49,6 +49,69 @@ #endif */ +#ifndef fallthrough +#define fallthrough +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) +static inline +ssize_t strscpy(char *dest, const char *src, size_t count) +{ + long res = 0; + + if (count == 0) + return -E2BIG; + + while (count) { + char c; + + c = srcres; + destres = c; + if (!c) + return res; + res++; + count--; + } + + /* Hit buffer length without finding a NUL; force NUL-termination. */ + if (res) + destres-1 = '\0'; + + return -E2BIG; +} +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)) +static inline unsigned char *skb_checksum_start(const struct sk_buff *skb) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + return skb->head + skb->csum_start; +#else /* < 2.6.22 */ + return skb_transport_header(skb); +#endif +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, + unsigned int bytes) +{} +static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue, + unsigned int pkts, + unsigned int bytes) +{} +static inline void netdev_tx_reset_queue(struct netdev_queue *q) {} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0) +#define netdev_xmit_more() (0) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) +#define netif_testing_on(dev) +#define netif_testing_off(dev) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) typedef int netdev_tx_t; #endif @@ -175,6 +238,10 @@ #define ENABLE_R8168_PROCFS #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +#define ENABLE_R8168_SYSFS +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) #define NETIF_F_HW_VLAN_RX NETIF_F_HW_VLAN_CTAG_RX #define NETIF_F_HW_VLAN_TX NETIF_F_HW_VLAN_CTAG_TX @@ -364,19 +431,19 @@ #define RSS_SUFFIX "" #endif -#define RTL8168_VERSION "8.052.01" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX RSS_SUFFIX +#define RTL8168_VERSION "8.053.00" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX RSS_SUFFIX #define MODULENAME "r8168" #define PFX MODULENAME ": " #define GPL_CLAIM "\ -r8168 Copyright (C) 2023 Realtek NIC software team <nicfae@realtek.com> \n \ +r8168 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 is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n" #ifdef RTL8168_DEBUG #define assert(expr) \ if(!(expr)) { \ - printk( "Assertion failed! %s,%s,%s,line=%d\n", \ + printk("Assertion failed! %s,%s,%s,line=%d\n", \ #expr,__FILE__,__FUNCTION__,__LINE__); \ } #define dprintk(fmt, args...) do { printk(PFX fmt, ## args); } while (0) @@ -453,6 +520,7 @@ #define RTL8168_TX_TIMEOUT (6 * HZ) #define RTL8168_LINK_TIMEOUT (1 * HZ) #define RTL8168_ESD_TIMEOUT (2 * HZ) +#define RTL8168_DASH_TIMEOUT (0) #define MAX_NUM_TX_DESC 1024 /* Maximum number of Tx descriptor registers */ #define MAX_NUM_RX_DESC 1024 /* Maximum number of Rx descriptor registers */ @@ -548,9 +616,9 @@ /*****************************************************************************/ //#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) -#if (( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27) ) || \ - (( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ) && \ - ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) ))) +#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) || \ + ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3)))) /* copied from linux kernel 2.6.20 include/linux/netdev.h */ #define NETDEV_ALIGN 32 #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) @@ -636,6 +704,23 @@ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) /*****************************************************************************/ +#ifdef CONFIG_R8168_NAPI +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) +#define RTL_NAPI_CONSUME_SKB_ANY(skb, budget) napi_consume_skb(skb, budget) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) +#define RTL_NAPI_CONSUME_SKB_ANY(skb, budget) dev_consume_skb_any(skb); +#else +#define RTL_NAPI_CONSUME_SKB_ANY(skb, budget) dev_kfree_skb_any(skb); +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) +#else //CONFIG_R8168_NAPI +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) +#define RTL_NAPI_CONSUME_SKB_ANY(skb, budget) dev_consume_skb_any(skb); +#else +#define RTL_NAPI_CONSUME_SKB_ANY(skb, budget) dev_kfree_skb_any(skb); +#endif +#endif //CONFIG_R8168_NAPI + +/*****************************************************************************/ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #ifdef __CHECKER__ #define __iomem __attribute__((noderef, address_space(2))) @@ -669,7 +754,7 @@ /*****************************************************************************/ /* 2.5.28 => 2.4.23 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28)) static inline void _kc_synchronize_irq(void) { @@ -690,12 +775,12 @@ /*****************************************************************************/ /* 2.6.4 => 2.6.0 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4)) #define MODULE_VERSION(_version) MODULE_INFO(version, _version) #endif /* 2.6.4 => 2.6.0 */ /*****************************************************************************/ /* 2.6.0 => 2.5.28 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) #define MODULE_INFO(version, _version) #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT #define CONFIG_E1000_DISABLE_PACKET_SPLIT 1 @@ -726,13 +811,13 @@ /*****************************************************************************/ /* 2.4.22 => 2.4.17 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22)) #define pci_name(x) ((x)->slot_name) #endif /* 2.4.22 => 2.4.17 */ /*****************************************************************************/ /* 2.6.5 => 2.6.0 */ -#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5)) #define pci_dma_sync_single_for_cpu pci_dma_sync_single #define pci_dma_sync_single_for_device pci_dma_sync_single_for_cpu #endif /* 2.6.5 => 2.6.0 */ @@ -1487,7 +1572,7 @@ }; #define RTL8168_CP_NUM 4 -#define RTL8168_MAX_SUPPORT_cp_len 110 +#define RTL8168_MAX_SUPPORT_CP_LEN 110 enum rtl8168_cp_status { rtl8168_cp_normal = 0, @@ -1543,6 +1628,8 @@ struct ring_info { struct sk_buff *skb; u32 len; + unsigned int bytecount; + unsigned short gso_segs; u8 __padsizeof(void *) - sizeof(u32); }; @@ -1566,14 +1653,29 @@ u32 pci_sn_h; }; +enum r8168_dash_req_flag { + R8168_RCV_REQ_SYS_OK = 0, + R8168_RCV_REQ_DASH_OK, + R8168_SEND_REQ_HOST_OK, + R8168_CMAC_RESET, + R8168_CMAC_DISALE_RX_FLAG_MAX, + R8168_DASH_REQ_FLAG_MAX +}; + enum r8168_flag { R8168_FLAG_DOWN = 0, R8168_FLAG_TASK_RESET_PENDING, R8168_FLAG_TASK_ESD_CHECK_PENDING, R8168_FLAG_TASK_LINKCHG_CHECK_PENDING, + R8168_FLAG_TASK_DASH_CHECK_PENDING, R8168_FLAG_MAX }; +enum r8168_sysfs_flag { + R8168_SYSFS_RTL_ADV = 0, + R8168_SYSFS_FLAG_MAX +}; + /* Flow Control Settings */ enum rtl8168_fc_mode { rtl8168_fc_none = 0, @@ -1585,6 +1687,7 @@ struct rtl8168_tx_ring { void* priv; + struct net_device *netdev; u32 index; u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ u32 dirty_tx; @@ -1600,6 +1703,7 @@ struct rtl8168_rx_ring { void* priv; + struct net_device *netdev; u32 index; u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ u32 dirty_rx; @@ -1880,10 +1984,12 @@ struct work_struct reset_task; struct work_struct esd_task; struct work_struct linkchg_task; + struct work_struct dash_task; #else struct delayed_work reset_task; struct delayed_work esd_task; struct delayed_work linkchg_task; + struct delayed_work dash_task; #endif DECLARE_BITMAP(task_flags, R8168_FLAG_MAX); unsigned features; @@ -1968,6 +2074,7 @@ u8 dash_printer_enabled; u8 HwPkgDet; void __iomem *cmac_ioaddr; /* cmac memory map physical address */ + DECLARE_BITMAP(dash_req_flags, R8168_DASH_REQ_FLAG_MAX); #ifdef ENABLE_DASH_SUPPORT u16 AfterRecvFromFwBufLen; @@ -1975,51 +2082,45 @@ u16 AfterSendToFwBufLen; u8 AfterSendToFwBufSEND_TO_FW_BUF_SIZE; u16 SendToFwBufferLen; - u32 SizeOfSendToFwBuffer ; - u32 SizeOfSendToFwBufferMemAlloc ; - u32 NumOfSendToFwBuffer ; + u32 SizeOfSendToFwBuffer; + u32 SizeOfSendToFwBufferMemAlloc; + u32 NumOfSendToFwBuffer; u8 OobReq; u8 OobAck; u32 OobReqComplete; u32 OobAckComplete; - u8 RcvFwReqSysOkEvt; - u8 RcvFwDashOkEvt; - u8 SendFwHostOkEvt; - - u8 DashFwDisableRx; - - void *SendToFwBuffer ; - dma_addr_t SendToFwBufferPhy ; + void *SendToFwBuffer; + dma_addr_t SendToFwBufferPhy; u8 SendingToFw; PTX_DASH_SEND_FW_DESC TxDashSendFwDesc; dma_addr_t TxDashSendFwDescPhy; u32 SizeOfTxDashSendFwDescMemAlloc; - u32 SizeOfTxDashSendFwDesc ; - u32 NumTxDashSendFwDesc ; - u32 CurrNumTxDashSendFwDesc ; - u32 LastSendNumTxDashSendFwDesc ; + u32 SizeOfTxDashSendFwDesc; + u32 NumTxDashSendFwDesc; + u32 CurrNumTxDashSendFwDesc; + u32 LastSendNumTxDashSendFwDesc; - u32 NumRecvFromFwBuffer ; - u32 SizeOfRecvFromFwBuffer ; - u32 SizeOfRecvFromFwBufferMemAlloc ; - void *RecvFromFwBuffer ; - dma_addr_t RecvFromFwBufferPhy ; + u32 NumRecvFromFwBuffer; + u32 SizeOfRecvFromFwBuffer; + u32 SizeOfRecvFromFwBufferMemAlloc; + void *RecvFromFwBuffer; + dma_addr_t RecvFromFwBufferPhy; PRX_DASH_FROM_FW_DESC RxDashRecvFwDesc; dma_addr_t RxDashRecvFwDescPhy; u32 SizeOfRxDashRecvFwDescMemAlloc; - u32 SizeOfRxDashRecvFwDesc ; - u32 NumRxDashRecvFwDesc ; - u32 CurrNumRxDashRecvFwDesc ; + u32 SizeOfRxDashRecvFwDesc; + u32 NumRxDashRecvFwDesc; + u32 CurrNumRxDashRecvFwDesc; u8 DashReqRegValue; u16 HostReqValue; u32 CmacResetIsrCounter; - u8 CmacResetIntr ; - u8 CmacResetting ; - u8 CmacOobIssueCmacReset ; + u8 CmacResetIntr; + u8 CmacResetting; + u8 CmacOobIssueCmacReset; u32 CmacResetbyFwCnt; #if defined(ENABLE_DASH_PRINTER_SUPPORT) @@ -2049,6 +2150,13 @@ #ifdef ENABLE_R8168_PROCFS //Procfs support struct proc_dir_entry *proc_dir; + struct proc_dir_entry *proc_dir_debug; + struct proc_dir_entry *proc_dir_test; +#endif +#ifdef ENABLE_R8168_SYSFS + //sysfs support + DECLARE_BITMAP(sysfs_flag, R8168_SYSFS_FLAG_MAX); + u32 testmode; #endif u8 HwSuppRxDescType; u8 InitRxDescType; @@ -2087,7 +2195,7 @@ { int count, i; - for (count = 0, i = tp->num_rx_rings; i < tp->HwSuppNumRxQueues; i++) + for (count = 0, i = 1; i < tp->HwSuppNumRxQueues; i++) if(tp->lib_rx_ringi.enabled) count++; @@ -2118,7 +2226,7 @@ int i; bool released = 0; - for (i = tp->num_rx_rings; i < tp->HwSuppNumRxQueues; i++) { + for (i = 1; i < tp->HwSuppNumRxQueues; i++) { struct rtl8168_ring *ring = &tp->lib_rx_ringi; if (ring->allocated) goto exit; @@ -2169,6 +2277,11 @@ return tp->num_rx_rings + rtl8168_num_lib_rx_rings(tp); } +static inline struct netdev_queue *txring_txq(const struct rtl8168_tx_ring *ring) +{ + return netdev_get_tx_queue(ring->netdev, ring->index); +} + static inline bool rtl8168_lib_all_ring_released(struct rtl8168_private *tp) { @@ -2328,6 +2441,31 @@ return (struct RxDesc*)desc; } +#ifdef ENABLE_DASH_SUPPORT + +static inline void +rtl8168_enable_dash2_interrupt(struct rtl8168_private *tp) +{ + if (!tp->DASH) + return; + + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(tp, CMAC_IBIMR0, (ISRIMR_DASH_TYPE2_ROK | ISRIMR_DASH_TYPE2_TOK | ISRIMR_DASH_TYPE2_TDU | ISRIMR_DASH_TYPE2_RDU | ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE)); + } +} + +static inline void +rtl8168_disable_dash2_interrupt(struct rtl8168_private *tp) +{ + if (!tp->DASH) + return; + + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(tp, CMAC_IBIMR0, 0); + } +} +#endif + static inline void rtl8168_disable_interrupt_by_vector(struct rtl8168_private *tp, u32 message_id) @@ -2380,7 +2518,7 @@ static inline void rtl8168_lib_reset_complete(struct rtl8168_private *tp) { } #endif -#define HW_SUPPORT_CHECK_PHY_DISABLE_MODE(_M) ((_M)->HwSuppCheckPhyDisableModeVer > 0 ) +#define HW_SUPPORT_CHECK_PHY_DISABLE_MODE(_M) ((_M)->HwSuppCheckPhyDisableModeVer > 0) #define HW_SUPP_SERDES_PHY(_M) ((_M)->HwSuppSerDesPhyVer > 0) #define HW_HAS_WRITE_PHY_MCU_RAM_CODE(_M) (((_M)->HwHasWrRamCodeToMicroP == TRUE) ? 1 : 0) #define HW_SUPPORT_UPS_MODE(_M) ((_M)->HwSuppUpsVer > 0)
View file
r8168-8.052.01.tar.gz/src/r8168_asf.c -> r8168-8.053.00.tar.gz/src/r8168_asf.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -384,10 +384,10 @@ int i; if (arg == ASF_GET) - for (i = 0; i < SYSID_LEN ; i++) + for (i = 0; i < SYSID_LEN; i++) datai = rtl8168_eri_read(tp, SysID + i, RW_ONE_BYTE, ERIAR_ASF); else /* arg == ASF_SET */ - for (i = 0; i < SYSID_LEN ; i++) + for (i = 0; i < SYSID_LEN; i++) rtl8168_eri_write(tp, SysID + i, RW_ONE_BYTE, datai, ERIAR_ASF); } @@ -408,9 +408,9 @@ int i, j; if (arg == ASF_GET) - for (i = UUID_LEN - 1, j = 0; i >= 0 ; i--, j++) + for (i = UUID_LEN - 1, j = 0; i >= 0; i--, j++) dataj = rtl8168_eri_read(tp, UUID + i, RW_ONE_BYTE, ERIAR_ASF); else /* arg == ASF_SET */ - for (i = UUID_LEN - 1, j = 0; i >= 0 ; i--, j++) + for (i = UUID_LEN - 1, j = 0; i >= 0; i--, j++) rtl8168_eri_write(tp, UUID + i, RW_ONE_BYTE, dataj, ERIAR_ASF); }
View file
r8168-8.052.01.tar.gz/src/r8168_asf.h -> r8168-8.053.00.tar.gz/src/r8168_asf.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_dash.h -> r8168-8.053.00.tar.gz/src/r8168_dash.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -247,6 +247,7 @@ #define RTL_CMAC_R32(tp, reg) ((unsigned long) readl (tp->cmac_ioaddr + (reg))) int rtl8168_dash_ioctl(struct net_device *dev, struct ifreq *ifr); +bool CheckDashInterrupt(struct net_device *dev, u16 status); void HandleDashInterrupt(struct net_device *dev); int AllocateDashShareMemory(struct net_device *dev); void FreeAllocatedDashShareMemory(struct net_device *dev);
View file
r8168-8.052.01.tar.gz/src/r8168_fiber.h -> r8168-8.053.00.tar.gz/src/r8168_fiber.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_firmware.c -> r8168-8.053.00.tar.gz/src/r8168_firmware.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_firmware.h -> r8168-8.053.00.tar.gz/src/r8168_firmware.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek 2.5Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_n.c -> r8168-8.053.00.tar.gz/src/r8168_n.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -121,10 +121,6 @@ #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; @@ -630,14 +626,17 @@ static void rtl8168_reset_task(void *_data); static void rtl8168_esd_task(void *_data); static void rtl8168_linkchg_task(void *_data); +static void rtl8168_dash_task(void *_data); #else static void rtl8168_reset_task(struct work_struct *work); static void rtl8168_esd_task(struct work_struct *work); static void rtl8168_linkchg_task(struct work_struct *work); +static void rtl8168_dash_task(struct work_struct *work); #endif static void rtl8168_schedule_reset_work(struct rtl8168_private *tp); static void rtl8168_schedule_esd_work(struct rtl8168_private *tp); static void rtl8168_schedule_linkchg_work(struct rtl8168_private *tp); +void rtl8168_schedule_dash_work(struct rtl8168_private *tp); static void rtl8168_init_all_schedule_work(struct rtl8168_private *tp); static void rtl8168_cancel_all_schedule_work(struct rtl8168_private *tp); @@ -791,7 +790,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) #ifndef SET_ETHTOOL_OPS #define SET_ETHTOOL_OPS(netdev,ops) \ - ( (netdev)->ethtool_ops = (ops) ) + ((netdev)->ethtool_ops = (ops)) #endif //SET_ETHTOOL_OPS #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) @@ -983,6 +982,16 @@ return retval; } +static bool +rtl8168_sysfs_testmode_on(struct rtl8168_private *tp) +{ +#ifdef ENABLE_R8168_SYSFS + return !!tp->testmode; +#else + return 1; +#endif +} + static u32 rtl8168_convert_link_speed(u16 status) { u32 speed = SPEED_UNKNOWN; @@ -1046,34 +1055,34 @@ } static void rtl8168_get_cp_len(struct rtl8168_private *tp, - u16 cp_lenRTL8168_CP_NUM) + int cp_lenRTL8168_CP_NUM) { int i; u16 status; - u16 tmp_cp_len = 0; + int tmp_cp_len; status = RTL_R8(tp, PHYstatus); if (status & LinkStatus) { if (status & _10bps) { - tmp_cp_len = 0; - } else if (status & _1000bpsF) { + tmp_cp_len = -1; + } else if (status & (_100bps | _1000bpsF)) { rtl8168_mdio_write(tp, 0x1f, 0x0a88); tmp_cp_len = rtl8168_mdio_read(tp, 0x10); } else - goto exit; + tmp_cp_len = 0; } else - goto exit; + tmp_cp_len = 0; - tmp_cp_len &= 0xff; + if (tmp_cp_len > 0) + tmp_cp_len &= 0xff; for (i=0; i<RTL8168_CP_NUM; i++) cp_leni = tmp_cp_len; -exit: rtl8168_mdio_write(tp, 0x1f, 0x0000); for (i=0; i<RTL8168_CP_NUM; i++) - if (cp_leni > RTL8168_MAX_SUPPORT_cp_len) - cp_leni = RTL8168_MAX_SUPPORT_cp_len; + if (cp_leni > RTL8168_MAX_SUPPORT_CP_LEN) + cp_leni = RTL8168_MAX_SUPPORT_CP_LEN; return; } @@ -1150,12 +1159,30 @@ } static void rtl8168_get_cp_status(struct rtl8168_private *tp, - int cp_statusRTL8168_CP_NUM) + int cp_statusRTL8168_CP_NUM, + bool poe_mode) { + u16 status; int i; - for (i =0; i<RTL8168_CP_NUM; i++) - cp_statusi = _rtl8168_get_cp_status(tp, i); + status = RTL_R8(tp, PHYstatus); + if (status & LinkStatus && !(status & (_10bps | _100bps))) { + for (i=0; i<RTL8168_CP_NUM; i++) + cp_statusi = rtl8168_cp_normal; + } else { + /* cannot do vcd when link is on */ + rtl8168_vcd_test(tp); + + for (i=0; i<RTL8168_CP_NUM; i++) + cp_statusi = _rtl8168_get_cp_status(tp, i); + } + + if (poe_mode) { + for (i=0; i<RTL8168_CP_NUM; i++) { + if (cp_statusi == rtl8168_cp_mismatch) + cp_statusi = rtl8168_cp_normal; + } + } } #ifdef ENABLE_R8168_PROCFS @@ -1494,35 +1521,42 @@ return 0; } -static int proc_get_cable_info(struct seq_file *m, void *v) +static int _proc_get_cable_info(struct seq_file *m, void *v, bool poe_mode) { int i; u16 status; int cp_statusRTL8168_CP_NUM = {0}; - u16 cp_lenRTL8168_CP_NUM = {0}; + int cp_lenRTL8168_CP_NUM = {0}; struct net_device *dev = m->private; struct rtl8168_private *tp = netdev_priv(dev); const char *pair_strRTL8168_CP_NUM = {"1-2", "3-6", "4-5", "7-8"}; + int ret; switch (tp->mcfg) { case CFG_METHOD_30: - case CFG_METHOD_35: - case CFG_METHOD_36: - case CFG_METHOD_37: /* support */ break; default: - return -EOPNOTSUPP; + ret = -EOPNOTSUPP; + goto error_out; } rtnl_lock(); + if (!rtl8168_sysfs_testmode_on(tp)) { + seq_puts(m, "\nPlease turn on ""/sys/class/net/<iface>/rtk_adv/testmode"".\n\n"); + ret = 0; + goto error_unlock; + } + rtl8168_mdio_write(tp, 0x1f, 0x0000); if (rtl8168_mdio_read(tp, MII_BMCR) & BMCR_PDOWN) { - rtnl_unlock(); - return -EIO; + ret = -EIO; + goto error_unlock; } + netif_testing_on(dev); + status = RTL_R8(tp, PHYstatus); if (status & LinkStatus) seq_printf(m, "\nlink speed:%d", @@ -1532,30 +1566,46 @@ rtl8168_get_cp_len(tp, cp_len); - rtl8168_vcd_test(tp); - - rtl8168_get_cp_status(tp, cp_status); + rtl8168_get_cp_status(tp, cp_status, poe_mode); seq_puts(m, "\npair\tlength\tstatus \tpp\n"); - for (i =0; i<RTL8168_CP_NUM; i++) { - seq_printf(m, "%s\t%d\t%s\t", - pair_stri, cp_leni, - rtl8168_get_cp_status_string(cp_statusi)); + for (i=0; i<RTL8168_CP_NUM; i++) { + if (cp_leni < 0) + seq_printf(m, "%s\t%s\t%s\t", + pair_stri, "none", + rtl8168_get_cp_status_string(cp_statusi)); + else + seq_printf(m, "%s\t%d\t%s\t", + pair_stri, cp_leni, + rtl8168_get_cp_status_string(cp_statusi)); if (cp_statusi == rtl8168_cp_normal) seq_printf(m, "none\n"); else seq_printf(m, "%dm\n", rtl8168_get_cp_pp(tp, i)); } - tp->phy_reset_enable(dev); + netif_testing_off(dev); - rtl8168_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); + seq_putc(m, '\n'); + + ret = 0; +error_unlock: rtnl_unlock(); - seq_putc(m, '\n'); - return 0; +error_out: + return ret; +} + +static int proc_get_cable_info(struct seq_file *m, void *v) +{ + return _proc_get_cable_info(m, v, 0); +} + +static int proc_get_poe_cable_info(struct seq_file *m, void *v) +{ + return _proc_get_cable_info(m, v, 1); } static int proc_dump_rx_desc(struct seq_file *m, void *v) @@ -1621,8 +1671,8 @@ return 0; } -void _proc_dump_tx_desc(struct seq_file *m, struct TxDesc *desc_base, - u32 alloc_size, u32 num_desc) +static void _proc_dump_tx_desc(struct seq_file *m, struct TxDesc *desc_base, + u32 alloc_size, u32 num_desc) { int i; u32 *pdword; @@ -1682,6 +1732,7 @@ static int proc_dump_msix_tbl(struct seq_file *m, void *v) { int i, j; + void __iomem *ioaddr; struct net_device *dev = m->private; struct rtl8168_private *tp = netdev_priv(dev); @@ -1692,22 +1743,26 @@ break; } + /* ioremap MMIO region */ + ioaddr = ioremap(pci_resource_start(tp->pci_dev, 4), pci_resource_len(tp->pci_dev, 4)); + if (!ioaddr) + return -EFAULT; + rtnl_lock(); - seq_printf(m, "\ndump MSI-X Table. Total Entry %d. \n", - tp->hw_supp_irq_nvecs); + seq_printf(m, "\ndump MSI-X Table. Total Entry %d. \n", tp->hw_supp_irq_nvecs); for (i=0; i<tp->hw_supp_irq_nvecs; i++) { seq_printf(m, "\n%04x ", i); for (j=0; j<4; j++) seq_printf(m, "%08x ", - rtl8168_eri_read( - tp, i*0x10 + 4 * j, 4, - ERIAR_MSIX)); + readl(ioaddr + i*0x10 + 4*j)); } rtnl_unlock(); + iounmap(ioaddr); + seq_putc(m, '\n'); return 0; } @@ -1956,8 +2011,7 @@ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) dev->perm_addr, #endif - dev->dev_addr - ); + dev->dev_addr); rtnl_unlock(); @@ -2023,8 +2077,7 @@ le64_to_cpu(counters->rx_broadcast), le32_to_cpu(counters->rx_multicast), le16_to_cpu(counters->tx_aborted), - le16_to_cpu(counters->tx_underrun) - ); + le16_to_cpu(counters->tx_underrun)); len += snprintf(page + len, count - len, "\n"); out_unlock: @@ -2247,24 +2300,22 @@ return len; } -static int proc_get_cable_info(char *page, char **start, - off_t offset, int count, - int *eof, void *data) +static int _proc_get_cable_info(char *page, char **start, + off_t offset, int count, + int *eof, void *data, + bool poe_mode) { int i; u16 status; int len = 0; struct net_device *dev = data; int cp_statusRTL8168_CP_NUM = {0}; - u16 cp_lenRTL8168_CP_NUM = {0}; + int cp_lenRTL8168_CP_NUM = {0}; struct rtl8168_private *tp = netdev_priv(dev); const char *pair_strRTL8168_CP_NUM = {"1-2", "3-6", "4-5", "7-8"}; switch (tp->mcfg) { case CFG_METHOD_30: - case CFG_METHOD_35: - case CFG_METHOD_36: - case CFG_METHOD_37: /* support */ break; default: @@ -2273,6 +2324,12 @@ rtnl_lock(); + if (!rtl8168_sysfs_testmode_on(tp)) { + len += snprintf(page + len, count - len, + "\nPlease turn on ""/sys/class/net/<iface>/rtk_adv/testmode"".\n\n"); + goto out_unlock; + } + status = RTL_R8(tp, PHYstatus); if (status & LinkStatus) len += snprintf(page + len, count - len, @@ -2282,16 +2339,24 @@ len += snprintf(page + len, count - len, "\nlink status:off"); - rtl8168_get_cp(tp, cp_len, cp_status); + rtl8168_get_cp_len(tp, cp_len); + + rtl8168_get_cp_status(tp, cp_status, poe_mode); len += snprintf(page + len, count - len, "\npair\tlength\tstatus \tpp\n"); - for (i =0; i<RTL8168_CP_NUM; i++) { - len += snprintf(page + len, count - len, - "%s\t%d\t%s\t", - pair_stri, cp_leni, - rtl8168_get_cp_status_string(cp_statusi)); + for (i=0; i<RTL8168_CP_NUM; i++) { + if (cp_leni < 0) + len += snprintf(page + len, count - len, + "%s\t%s\t%s\t", + pair_stri, "none", + rtl8168_get_cp_status_string(cp_statusi)); + else + len += snprintf(page + len, count - len, + "%s\t%d\t%s\t", + pair_stri, cp_leni, + rtl8168_get_cp_status_string(cp_statusi)); if (cp_statusi == rtl8168_cp_normal) len += snprintf(page + len, count - len, "none\n"); else @@ -2299,14 +2364,29 @@ rtl8168_get_cp_pp(tp, i)); } - rtnl_unlock(); - len += snprintf(page + len, count - len, "\n"); +out_unlock: + rtnl_unlock(); + *eof = 1; return len; } +static int proc_get_cable_info(char *page, char **start, + off_t offset, int count, + int *eof, void *data) +{ + return _proc_get_cable_info(page, start, offset, count, eof, data, 0); +} + +static int proc_get_poe_cable_info(char *page, char **start, + off_t offset, int count, + int *eof, void *data) +{ + return _proc_get_cable_info(page, start, offset, count, eof, data, 1); +} + static int proc_dump_rx_desc(char *page, char **start, off_t offset, int count, int *eof, void *data) @@ -2537,9 +2617,22 @@ { int i, j; int len = 0; + void __iomem *ioaddr; struct net_device *dev = data; struct rtl8168_private *tp = netdev_priv(dev); + switch (tp->mcfg) { + case CFG_METHOD_1 ... CFG_METHOD_8: + return -EOPNOTSUPP; + default: + break; + } + + /* ioremap MMIO region */ + ioaddr = ioremap(pci_resource_start(tp->pci_dev, 4), pci_resource_len(tp->pci_dev, 4)); + if (!ioaddr) + return -EFAULT; + rtnl_lock(); len += snprintf(page + len, count - len, @@ -2551,8 +2644,7 @@ "\n%04x ", i); for (j=0; j<4; j++) len += snprintf(page + len, count - len, "%08x ", - rtl8168_eri_read(tp, i*0x10 + 4*j, 4, - ERIAR_MSIX)); + readl(ioaddr + i*0x10 + 4*j)); } rtnl_unlock(); @@ -2614,7 +2706,7 @@ * Table of proc files we need to create. */ struct rtl8168_proc_file { - char name12; + char name16; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) int (*show)(struct seq_file *, void *); #else @@ -2622,7 +2714,7 @@ #endif }; -static const struct rtl8168_proc_file rtl8168_proc_files = { +static const struct rtl8168_proc_file rtl8168_debug_proc_files = { { "driver_var", &proc_get_driver_variable }, { "tally", &proc_get_tally_counter }, { "registers", &proc_get_registers }, @@ -2630,7 +2722,6 @@ { "eth_phy", &proc_get_eth_phy }, { "ext_regs", &proc_get_extended_registers }, { "pci_regs", &proc_get_pci_registers }, - { "cdt", &proc_get_cable_info }, { "tx_desc", &proc_dump_tx_desc }, { "rx_desc", &proc_dump_rx_desc }, { "rx_desc_2", &proc_dump_rx_desc_2 }, @@ -2638,55 +2729,127 @@ { "" } }; +static const struct rtl8168_proc_file rtl8168_test_proc_files = { + { "cdt", &proc_get_cable_info }, + { "cdt_poe", &proc_get_poe_cable_info }, + { "" } +}; + +#define R8168_PROC_DEBUG_DIR "debug" +#define R8168_PROC_TEST_DIR "test" + static void rtl8168_proc_init(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); const struct rtl8168_proc_file *f; struct proc_dir_entry *dir; - if (rtl8168_proc && !tp->proc_dir) { + if (!rtl8168_proc) + return; + + if (tp->proc_dir_debug || tp->proc_dir_test) + return; + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) - dir = proc_mkdir_data(dev->name, 0, rtl8168_proc, dev); - if (!dir) { - printk("Unable to initialize /proc/net/%s/%s\n", - MODULENAME, dev->name); + dir = proc_mkdir_data(dev->name, 0, rtl8168_proc, dev); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s\n", + MODULENAME, dev->name); + return; + } + tp->proc_dir = dir; + proc_init_num++; + + /* create debug entry */ + dir = proc_mkdir_data(R8168_PROC_DEBUG_DIR, 0, tp->proc_dir, dev); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_DEBUG_DIR); + return; + } + + tp->proc_dir_debug = dir; + for (f = rtl8168_debug_proc_files; f->name0; f++) { + if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir, + &rtl8168_proc_fops, f->show)) { + printk("Unable to initialize " + "/proc/net/%s/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_DEBUG_DIR, + f->name); return; } + } - tp->proc_dir = dir; - proc_init_num++; + /* create test entry */ + dir = proc_mkdir_data(R8168_PROC_TEST_DIR, 0, tp->proc_dir, dev); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_TEST_DIR); + return; + } - for (f = rtl8168_proc_files; f->name0; f++) { - if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir, - &rtl8168_proc_fops, f->show)) { - printk("Unable to initialize " - "/proc/net/%s/%s/%s\n", - MODULENAME, dev->name, f->name); - return; - } + tp->proc_dir_test = dir; + for (f = rtl8168_test_proc_files; f->name0; f++) { + if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir, + &rtl8168_proc_fops, f->show)) { + printk("Unable to initialize " + "/proc/net/%s/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_TEST_DIR, + f->name); + return; } + } #else - dir = proc_mkdir(dev->name, rtl8168_proc); - if (!dir) { - printk("Unable to initialize /proc/net/%s/%s\n", - MODULENAME, dev->name); + dir = proc_mkdir(dev->name, rtl8168_proc); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s\n", + MODULENAME, dev->name); + return; + } + + tp->proc_dir = dir; + proc_init_num++; + + /* create debug entry */ + dir = proc_mkdir(R8168_PROC_DEBUG_DIR, tp->proc_dir); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_DEBUG_DIR); + return; + } + + tp->proc_dir_debug = dir; + for (f = rtl8168_debug_proc_files; f->name0; f++) { + if (!create_proc_read_entry(f->name, S_IFREG | S_IRUGO, + dir, f->show, dev)) { + printk("Unable to initialize " + "/proc/net/%s/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_DEBUG_DIR, + f->name); return; } + } - tp->proc_dir = dir; - proc_init_num++; + /* create test entry */ + dir = proc_mkdir(R8168_PROC_TEST_DIR, tp->proc_dir); + if (!dir) { + printk("Unable to initialize /proc/net/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_TEST_DIR); + return; + } - for (f = rtl8168_proc_files; f->name0; f++) { - if (!create_proc_read_entry(f->name, S_IFREG | S_IRUGO, - dir, f->show, dev)) { - printk("Unable to initialize " - "/proc/net/%s/%s/%s\n", - MODULENAME, dev->name, f->name); - return; - } + tp->proc_dir_test = dir; + for (f = rtl8168_test_proc_files; f->name0; f++) { + if (!create_proc_read_entry(f->name, S_IFREG | S_IRUGO, + dir, f->show, dev)) { + printk("Unable to initialize " + "/proc/net/%s/%s/%s/%s\n", + MODULENAME, dev->name, R8168_PROC_TEST_DIR, + f->name); + return; } -#endif } +#endif } static void rtl8168_proc_remove(struct net_device *dev) @@ -2696,33 +2859,119 @@ if (tp->proc_dir) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) remove_proc_subtree(dev->name, rtl8168_proc); - proc_init_num--; - #else const struct rtl8168_proc_file *f; struct rtl8168_private *tp = netdev_priv(dev); - for (f = rtl8168_proc_files; f->name0; f++) - remove_proc_entry(f->name, tp->proc_dir); + if (tp->proc_dir_debug) { + for (f = rtl8168_debug_proc_files; f->name0; f++) + remove_proc_entry(f->name, tp->proc_dir_debug); + remove_proc_entry(R8168_PROC_DEBUG_DIR, tp->proc_dir); + } + + if (tp->proc_dir_test) { + for (f = rtl8168_test_proc_files; f->name0; f++) + remove_proc_entry(f->name, tp->proc_dir_test); + remove_proc_entry(R8168_PROC_TEST_DIR, tp->proc_dir); + } remove_proc_entry(dev->name, rtl8168_proc); - proc_init_num--; #endif + proc_init_num--; + + tp->proc_dir_debug = NULL; + tp->proc_dir_test = NULL; tp->proc_dir = NULL; } } #endif //ENABLE_R8168_PROCFS +#ifdef ENABLE_R8168_SYSFS +/**************************************************************************** +* -----------------------------SYSFS STUFF------------------------- +***************************************************************************** +*/ +static ssize_t testmode_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct net_device *netdev = to_net_dev(dev); + struct rtl8168_private *tp = netdev_priv(netdev); + + sprintf(buf, "%u\n", tp->testmode); + + return strlen(buf); +} + +static ssize_t testmode_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct net_device *netdev = to_net_dev(dev); + struct rtl8168_private *tp = netdev_priv(netdev); + u32 testmode; + + if (sscanf(buf, "%u\n", &testmode) != 1) + return -EINVAL; + + if (tp->testmode != testmode) { + rtnl_lock(); + tp->testmode = testmode; + rtnl_unlock(); + } + + return count; +} + +static DEVICE_ATTR_RW(testmode); + +static struct attribute *rtk_adv_attrs = { + &dev_attr_testmode.attr, + NULL +}; + +static struct attribute_group rtk_adv_grp = { + .name = "rtl_adv", + .attrs = rtk_adv_attrs, +}; + +static void rtl8168_sysfs_init(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + int ret; + + /* init rtl_adv */ +#ifdef ENABLE_LIB_SUPPORT + tp->testmode = 0; +#else + tp->testmode = 1; +#endif //ENABLE_LIB_SUPPORT + + ret = sysfs_create_group(&dev->dev.kobj, &rtk_adv_grp); + if (ret < 0) + netif_warn(tp, probe, dev, "create rtk_adv_grp fail\n"); + else + set_bit(R8168_SYSFS_RTL_ADV, tp->sysfs_flag); +} + +static void rtl8168_sysfs_remove(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + if (test_and_clear_bit(R8168_SYSFS_RTL_ADV, tp->sysfs_flag)) + sysfs_remove_group(&dev->dev.kobj, &rtk_adv_grp); +} +#endif //ENABLE_R8168_SYSFS + static inline u16 map_phy_ocp_addr(u16 PageNum, u8 RegNum) { u16 OcpPageNum = 0; u8 OcpRegNum = 0; u16 OcpPhyAddress = 0; - if ( PageNum == 0 ) { - OcpPageNum = OCP_STD_PHY_BASE_PAGE + ( RegNum / 8 ); - OcpRegNum = 0x10 + ( RegNum % 8 ); + if (PageNum == 0) { + OcpPageNum = OCP_STD_PHY_BASE_PAGE + (RegNum / 8); + OcpRegNum = 0x10 + (RegNum % 8); } else { OcpPageNum = PageNum; OcpRegNum = RegNum; @@ -2730,7 +2979,7 @@ OcpPageNum <<= 4; - if ( OcpRegNum < 16 ) { + if (OcpRegNum < 16) { OcpPhyAddress = 0; } else { OcpRegNum -= 16; @@ -2814,9 +3063,8 @@ { int i; - if (RegAddr == 0x1F) { + if (RegAddr == 0x1F) tp->cur_page = value; - } if (tp->mcfg == CFG_METHOD_11) { RTL_W32(tp, OCPDR, OCPDR_Write | @@ -2946,8 +3194,8 @@ return mdio_real_direct_read_phy_ocp(tp, ocp_addr); } -u32 mdio_real_read(struct rtl8168_private *tp, - u32 RegAddr) +static u32 mdio_real_read(struct rtl8168_private *tp, + u32 RegAddr) { int i, value = 0; @@ -3040,8 +3288,7 @@ ClearAndSetEthPhyBit(tp, addr, mask, - 0 - ); + 0); } void rtl8168_set_eth_phy_bit(struct rtl8168_private *tp, u8 addr, u16 mask) @@ -3049,8 +3296,7 @@ ClearAndSetEthPhyBit(tp, addr, 0, - mask - ); + mask); } void rtl8168_mac_ocp_write(struct rtl8168_private *tp, u16 reg_addr, u16 value) @@ -3130,8 +3376,7 @@ rtl8168_clear_and_set_mcu_ocp_bit(tp, addr, mask, - 0 - ); + 0); } static void @@ -3144,8 +3389,7 @@ rtl8168_clear_and_set_mcu_ocp_bit(tp, addr, 0, - mask - ); + mask); } static u32 real_ocp_read(struct rtl8168_private *tp, u16 addr, u8 len) @@ -3413,18 +3657,18 @@ u8 TmpUchar; //Disable oob Tx - RTL_CMAC_W8(tp, CMAC_IBCR2, RTL_CMAC_R8(tp, CMAC_IBCR2) & ~( BIT_0 )); + RTL_CMAC_W8(tp, CMAC_IBCR2, RTL_CMAC_R8(tp, CMAC_IBCR2) & ~(BIT_0)); WaitCnt = 0; //wait oob tx disable do { TmpUchar = RTL_CMAC_R8(tp, CMAC_IBISR0); - if ( TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE ) { + if (TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE) { break; } - udelay( 50 ); + udelay(50); WaitCnt++; } while(WaitCnt < 2000); @@ -3438,9 +3682,8 @@ if (!tp->DASH) return; - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) RTL_CMAC_W8(tp, CMAC_IBCR2, RTL_CMAC_R8(tp, CMAC_IBCR2) | BIT_0); - } } void rtl8168_dash2_disable_rx(struct rtl8168_private *tp) @@ -3448,9 +3691,8 @@ if (!tp->DASH) return; - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - RTL_CMAC_W8(tp, CMAC_IBCR0, RTL_CMAC_R8(tp, CMAC_IBCR0) & ~( BIT_0 )); - } + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) + RTL_CMAC_W8(tp, CMAC_IBCR0, RTL_CMAC_R8(tp, CMAC_IBCR0) & ~(BIT_0)); } void rtl8168_dash2_enable_rx(struct rtl8168_private *tp) @@ -3458,9 +3700,8 @@ if (!tp->DASH) return; - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) RTL_CMAC_W8(tp, CMAC_IBCR0, RTL_CMAC_R8(tp, CMAC_IBCR0) | BIT_0); - } } static void rtl8168_dash2_disable_txrx(struct net_device *dev) @@ -3468,8 +3709,8 @@ struct rtl8168_private *tp = netdev_priv(dev); if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - rtl8168_dash2_disable_tx( tp ); - rtl8168_dash2_disable_rx( tp ); + rtl8168_dash2_disable_tx(tp); + rtl8168_dash2_disable_rx(tp); } } @@ -3554,20 +3795,18 @@ static void ClearPCIePhyBit(struct rtl8168_private *tp, u8 addr, u16 mask) { - ClearAndSetPCIePhyBit( tp, - addr, - mask, - 0 - ); + ClearAndSetPCIePhyBit(tp, + addr, + mask, + 0); } -static void SetPCIePhyBit( struct rtl8168_private *tp, u8 addr, u16 mask) -{ - ClearAndSetPCIePhyBit( tp, - addr, - 0, - mask - ); +static void SetPCIePhyBit(struct rtl8168_private *tp, u8 addr, u16 mask) +{ + ClearAndSetPCIePhyBit(tp, + addr, + 0, + mask); } static u32 @@ -3589,9 +3828,8 @@ multi_fun_sel_bit = 0; } - if ( multi_fun_sel_bit > 7 ) { + if (multi_fun_sel_bit > 7) return 0xffffffff; - } cmd |= multi_fun_sel_bit << 16; @@ -3627,13 +3865,11 @@ tp->mcfg != CFG_METHOD_26 && tp->mcfg != CFG_METHOD_27 && tp->mcfg != CFG_METHOD_28 && tp->mcfg != CFG_METHOD_31 && tp->mcfg != CFG_METHOD_32 && tp->mcfg != CFG_METHOD_33 && - tp->mcfg != CFG_METHOD_34) { + tp->mcfg != CFG_METHOD_34) multi_fun_sel_bit = 0; - } - if ( multi_fun_sel_bit > 7 ) { + if (multi_fun_sel_bit > 7) return; - } cmd |= multi_fun_sel_bit << 16; @@ -3733,7 +3969,7 @@ TmpUlong = rtl8168_csi_other_fun_read(tp, 0, RegAlignAddr); TmpUlong &= ~(0xFF << (8*ShiftByte)); TmpUlong |= (value << (8*ShiftByte)); - rtl8168_csi_other_fun_write( tp, 0, RegAlignAddr, TmpUlong ); + rtl8168_csi_other_fun_write(tp, 0, RegAlignAddr, TmpUlong); } else { struct pci_dev *pdev = tp->pci_dev; @@ -4247,7 +4483,7 @@ } else { if (tp->mcfg == CFG_METHOD_13) - RTL_W8(tp, TwiCmdReg, RTL_R8(tp, TwiCmdReg) | ( BIT_7 )); + RTL_W8(tp, TwiCmdReg, RTL_R8(tp, TwiCmdReg) | (BIT_7)); rtl8168_oob_notify(tp, OOB_CMD_DRIVER_START); @@ -4275,7 +4511,7 @@ rtl8168_wait_dash_fw_ready(tp); if (tp->mcfg == CFG_METHOD_13) - RTL_W8(tp, TwiCmdReg, RTL_R8(tp, TwiCmdReg) & ~( BIT_7 )); + RTL_W8(tp, TwiCmdReg, RTL_R8(tp, TwiCmdReg) & ~(BIT_7)); } //change other device state to D3. @@ -4352,31 +4588,6 @@ rtl8168_clear_isr_by_vector(tp, message_id, val); } -#ifdef ENABLE_DASH_SUPPORT - -inline void -rtl8168_enable_dash2_interrupt(struct rtl8168_private *tp) -{ - if (!tp->DASH) - return; - - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - RTL_CMAC_W8(tp, CMAC_IBIMR0, ( ISRIMR_DASH_TYPE2_ROK | ISRIMR_DASH_TYPE2_TOK | ISRIMR_DASH_TYPE2_TDU | ISRIMR_DASH_TYPE2_RDU | ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE )); - } -} - -static inline void -rtl8168_disable_dash2_interrupt(struct rtl8168_private *tp) -{ - if (!tp->DASH) - return; - - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - RTL_CMAC_W8(tp, CMAC_IBIMR0, 0); - } -} -#endif - static inline void rtl8168_enable_interrupt(struct rtl8168_private *tp) { @@ -4390,7 +4601,7 @@ { int i; - for (i=1; i<rtl8168_tot_rx_rings(tp); i++) + for (i=0; i<rtl8168_tot_rx_rings(tp); i++) rtl8168_enable_interrupt_by_vector(tp, i); } @@ -4408,7 +4619,7 @@ { int i; - for (i=1; i<rtl8168_tot_rx_rings(tp); i++) + for (i=0; i<rtl8168_tot_rx_rings(tp); i++) rtl8168_disable_interrupt_by_vector(tp, i); } @@ -4456,7 +4667,7 @@ if (tp->DASH) { if (tp->dash_printer_enabled) { rtl8168_clear_isr_by_vector(tp, 0, - rtl8168_get_hw_isr_by_vector(tp, 0) & + rtl8168_get_isr_by_vector(tp, 0) & ~(ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET)); } else { if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { @@ -4517,7 +4728,8 @@ case CFG_METHOD_12: case CFG_METHOD_13: for (i = 0; i < 2000; i++) { - if (!(RTL_R8(tp, TxPoll) & NPQ)) break; + if (!(RTL_R8(tp, TxPoll) & NPQ)) + break; udelay(100); } break; @@ -4572,11 +4784,14 @@ } for (i = 0; i < 5; i++) { - if ( rtl8168_ocp_read(tp, 0x034, 1) == 0) + if (rtl8168_ocp_read(tp, 0x034, 1) == 0) break; } break; } + + /* reset rcr */ + RTL_W32(tp, RxConfig, (RX_DMA_BURST << RxCfgDMAShift)); } static void @@ -4718,7 +4933,7 @@ break; } - RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) & ~(AcceptErr | AcceptRunt | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptAllPhys)); + rtl8168_disable_rx_packet_filter(tp); rx_len = rx_cmd & 0x3FFF; rx_len -= 4; @@ -4839,6 +5054,10 @@ ring->dirty_tx = ring->cur_tx = 0; ring->index = i; ring->priv = tp; + ring->netdev = tp->dev; + + /* reset BQL for queue */ + netdev_tx_reset_queue(txring_txq(ring)); } for (i = 0; i < tp->HwSuppNumRxQueues; i++) { @@ -4846,6 +5065,7 @@ ring->dirty_rx = ring->cur_rx = 0; ring->index = i; ring->priv = tp; + ring->netdev = tp->dev; } #ifdef ENABLE_LIB_SUPPORT @@ -5438,8 +5658,8 @@ case CFG_METHOD_36: case CFG_METHOD_37: csi_tmp = rtl8168_eri_read(tp, 0x3F2, 2, ERIAR_ExGMAC); - csi_tmp &= ~( BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12 | BIT_13 | BIT_14 | BIT_15 ); - csi_tmp |= ( BIT_9 | BIT_10 | BIT_13 | BIT_14 | BIT_15 ); + csi_tmp &= ~(BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12 | BIT_13 | BIT_14 | BIT_15); + csi_tmp |= (BIT_9 | BIT_10 | BIT_13 | BIT_14 | BIT_15); rtl8168_eri_write(tp, 0x3F2, 2, csi_tmp, ERIAR_ExGMAC); csi_tmp = rtl8168_eri_read(tp, 0x3F5, 1, ERIAR_ExGMAC); csi_tmp |= BIT_6 | BIT_7; @@ -5722,7 +5942,7 @@ rtl8168_eri_write(tp, Q_NUM_CTRL_8168, 2, q_ctrl, ERIAR_ExGMAC); } -void +static void rtl8168_set_rx_vlan_filter(struct rtl8168_private *tp) { int i; @@ -6286,14 +6506,14 @@ struct rtl8168_private *tp = netdev_priv(dev); struct rtl8168_fw *rtl_fw = tp->rtl_fw; - strcpy(info->driver, MODULENAME); - strcpy(info->version, RTL8168_VERSION); - strncpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info) - 1); + strscpy(info->driver, MODULENAME, sizeof(info->driver)); + strscpy(info->version, RTL8168_VERSION, sizeof(info->version)); + strscpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info)); info->regdump_len = R8168_REGS_DUMP_SIZE; info->eedump_len = tp->eeprom_len; BUILD_BUG_ON(sizeof(info->fw_version) < sizeof(rtl_fw->version)); if (rtl_fw) - strlcpy(info->fw_version, rtl_fw->version, + strscpy(info->fw_version, rtl_fw->version, sizeof(info->fw_version)); } @@ -6691,6 +6911,32 @@ #endif +static u8 rtl8168_get_mdi_status(struct rtl8168_private *tp) +{ + u32 val; + + if (!tp->link_ok(tp->dev)) + return ETH_TP_MDI_INVALID; + + switch (tp->mcfg) { + case CFG_METHOD_1 ... CFG_METHOD_20: + rtl8168_mdio_write(tp, 0x1F, 0x0000); + val = rtl8168_mdio_read(tp, 0x11); + if (val & BIT_6) + return ETH_TP_MDI_X; + else + return ETH_TP_MDI; + default: + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + val = rtl8168_mdio_read(tp, 0x1A); + rtl8168_mdio_write(tp, 0x1F, 0x0000); + if (val & BIT_1) + return ETH_TP_MDI; + else + return ETH_TP_MDI_X; + }; +} + static void rtl8168_gset_xmii(struct net_device *dev, #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct ethtool_cmd *cmd @@ -6787,6 +7033,7 @@ cmd->speed = speed; cmd->duplex = duplex; cmd->port = PORT_TP; + cmd->eth_tp_mdix = rtl8168_get_mdi_status(tp); #else ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, supported); @@ -6798,6 +7045,7 @@ cmd->base.speed = speed; cmd->base.duplex = duplex; cmd->base.port = PORT_TP; + cmd->base.eth_tp_mdix = rtl8168_get_mdi_status(tp); #endif } @@ -7214,6 +7462,144 @@ } } +static bool rtl8168_is_adv_eee_enabled(struct rtl8168_private *tp) +{ + bool enabled = false; + + switch (tp->mcfg) { + //case CFG_METHOD_24: + case CFG_METHOD_25: + case CFG_METHOD_26: + case CFG_METHOD_27: + case CFG_METHOD_28: + case CFG_METHOD_29: + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: + case CFG_METHOD_33: + case CFG_METHOD_34: + case CFG_METHOD_35: + case CFG_METHOD_36: + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + if (rtl8168_mdio_read(tp, 0x10) & BIT_15) + enabled = true; + rtl8168_mdio_write(tp, 0x1F, 0x0000); + break; + default: + break; + } + + return enabled; +} + +static void rtl8168_disable_adv_eee(struct rtl8168_private *tp) +{ + bool lock_mutex; + bool lock_phy; + u16 data; + + switch (tp->mcfg) { + //case CFG_METHOD_24: + case CFG_METHOD_25: + case CFG_METHOD_26: + case CFG_METHOD_27: + case CFG_METHOD_28: + case CFG_METHOD_29: + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: + case CFG_METHOD_33: + case CFG_METHOD_34: + case CFG_METHOD_35: + case CFG_METHOD_36: + break; + default: + return; + } + + switch (tp->mcfg) { + case CFG_METHOD_23: + case CFG_METHOD_27: + case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: + case CFG_METHOD_33: + case CFG_METHOD_34: + lock_mutex = true; + break; + default: + lock_mutex = false; + break; + } + + if (lock_mutex) + rtl8168_oob_mutex_lock(tp); + + if (rtl8168_is_adv_eee_enabled(tp)) + lock_phy = true; + else + lock_phy = false; + + if (lock_phy) + rtl8168_set_phy_mcu_patch_request(tp); + + switch (tp->mcfg) { + case CFG_METHOD_25: + rtl8168_eri_write(tp, 0x1EA, 1, 0x00, ERIAR_ExGMAC); + + rtl8168_mdio_write(tp, 0x1F, 0x0A42); + data = rtl8168_mdio_read(tp, 0x16); + data &= ~(BIT_1); + rtl8168_mdio_write(tp, 0x16, data); + rtl8168_mdio_write(tp, 0x1F, 0x0000); + break; + case CFG_METHOD_26: + data = rtl8168_mac_ocp_read(tp, 0xE052); + data &= ~(BIT_0); + rtl8168_mac_ocp_write(tp, 0xE052, data); + + rtl8168_mdio_write(tp, 0x1F, 0x0A42); + data = rtl8168_mdio_read(tp, 0x16); + data &= ~(BIT_1); + rtl8168_mdio_write(tp, 0x16, data); + rtl8168_mdio_write(tp, 0x1F, 0x0000); + break; + case CFG_METHOD_27: + case CFG_METHOD_28: + data = rtl8168_mac_ocp_read(tp, 0xE052); + data &= ~(BIT_0); + rtl8168_mac_ocp_write(tp, 0xE052, data); + break; + case CFG_METHOD_29: + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: + case CFG_METHOD_33: + case CFG_METHOD_34: + case CFG_METHOD_35: + case CFG_METHOD_36: + data = rtl8168_mac_ocp_read(tp, 0xE052); + data &= ~(BIT_0); + rtl8168_mac_ocp_write(tp, 0xE052, data); + + rtl8168_mdio_write(tp, 0x1F, 0x0A43); + data = rtl8168_mdio_read(tp, 0x10) & ~(BIT_15); + rtl8168_mdio_write(tp, 0x10, data); + + rtl8168_mdio_write(tp, 0x1F, 0x0A44); + data = rtl8168_mdio_read(tp, 0x11) & ~(BIT_12 | BIT_13 | BIT_14); + rtl8168_mdio_write(tp, 0x11, data); + rtl8168_mdio_write(tp, 0x1F, 0x0000); + break; + } + + if (lock_phy) + rtl8168_clear_phy_mcu_patch_request(tp); + + if (lock_mutex) + rtl8168_oob_mutex_unlock(tp); +} + static int rtl8168_enable_eee(struct rtl8168_private *tp) { int ret; @@ -7351,154 +7737,7 @@ } /*Advanced EEE*/ - switch (tp->mcfg) { - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - rtl8168_oob_mutex_lock(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_24: - case CFG_METHOD_25: - case CFG_METHOD_26: - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - case CFG_METHOD_35: - case CFG_METHOD_36: - rtl8168_set_phy_mcu_patch_request(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_25: - rtl8168_eri_write(tp, 0x1EA, 1, 0xFA, ERIAR_ExGMAC); - - rtl8168_mdio_write(tp, 0x1F, 0x0A43); - data = rtl8168_mdio_read(tp, 0x10); - if (data & BIT_10) { - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data &= ~(BIT_1); - rtl8168_mdio_write(tp, 0x16, data); - } else { - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data |= BIT_1; - rtl8168_mdio_write(tp, 0x16, data); - } - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - case CFG_METHOD_26: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data |= BIT_0; - rtl8168_mac_ocp_write(tp, 0xE052, data); - data = rtl8168_mac_ocp_read(tp, 0xE056); - data &= 0xFF0F; - data |= (BIT_4 | BIT_5 | BIT_6); - rtl8168_mac_ocp_write(tp, 0xE056, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A43); - data = rtl8168_mdio_read(tp, 0x10); - if (data & BIT_10) { - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data &= ~(BIT_1); - rtl8168_mdio_write(tp, 0x16, data); - } else { - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data |= BIT_1; - rtl8168_mdio_write(tp, 0x16, data); - } - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - case CFG_METHOD_27: - case CFG_METHOD_28: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~BIT_0; - rtl8168_mac_ocp_write(tp, 0xE052, data); - data = rtl8168_mac_ocp_read(tp, 0xE056); - data &= 0xFF0F; - data |= (BIT_4 | BIT_5 | BIT_6); - rtl8168_mac_ocp_write(tp, 0xE056, data); - break; - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_35: - case CFG_METHOD_36: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~(BIT_0); - rtl8168_mac_ocp_write(tp, 0xE052, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A43); - data = rtl8168_mdio_read(tp, 0x10) | BIT_15; - rtl8168_mdio_write(tp, 0x10, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A44); - data = rtl8168_mdio_read(tp, 0x11) | BIT_13 | BIT_14; - data &= ~(BIT_12); - rtl8168_mdio_write(tp, 0x11, data); - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~(BIT_0); - if (tp->HwPkgDet == 0x0F) - data |= BIT_0; - rtl8168_mac_ocp_write(tp, 0xE052, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A43); - data = rtl8168_mdio_read(tp, 0x10) | BIT_15; - rtl8168_mdio_write(tp, 0x10, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A44); - data = rtl8168_mdio_read(tp, 0x11) | BIT_13 | BIT_14; - data &= ~(BIT_12); - rtl8168_mdio_write(tp, 0x11, data); - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_24: - case CFG_METHOD_25: - case CFG_METHOD_26: - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - case CFG_METHOD_35: - case CFG_METHOD_36: - rtl8168_clear_phy_mcu_patch_request(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - rtl8168_oob_mutex_unlock(tp); - break; - } + rtl8168_disable_adv_eee(tp); return ret; } @@ -7638,111 +7877,7 @@ } /*Advanced EEE*/ - switch (tp->mcfg) { - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - rtl8168_oob_mutex_lock(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_24: - case CFG_METHOD_25: - case CFG_METHOD_26: - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - case CFG_METHOD_35: - case CFG_METHOD_36: - rtl8168_set_phy_mcu_patch_request(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_25: - rtl8168_eri_write(tp, 0x1EA, 1, 0x00, ERIAR_ExGMAC); - - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data &= ~(BIT_1); - rtl8168_mdio_write(tp, 0x16, data); - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - case CFG_METHOD_26: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~(BIT_0); - rtl8168_mac_ocp_write(tp, 0xE052, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A42); - data = rtl8168_mdio_read(tp, 0x16); - data &= ~(BIT_1); - rtl8168_mdio_write(tp, 0x16, data); - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - case CFG_METHOD_27: - case CFG_METHOD_28: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~(BIT_0); - rtl8168_mac_ocp_write(tp, 0xE052, data); - break; - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - case CFG_METHOD_35: - case CFG_METHOD_36: - data = rtl8168_mac_ocp_read(tp, 0xE052); - data &= ~(BIT_0); - rtl8168_mac_ocp_write(tp, 0xE052, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A43); - data = rtl8168_mdio_read(tp, 0x10) & ~(BIT_15); - rtl8168_mdio_write(tp, 0x10, data); - - rtl8168_mdio_write(tp, 0x1F, 0x0A44); - data = rtl8168_mdio_read(tp, 0x11) & ~(BIT_12 | BIT_13 | BIT_14); - rtl8168_mdio_write(tp, 0x11, data); - rtl8168_mdio_write(tp, 0x1F, 0x0000); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_24: - case CFG_METHOD_25: - case CFG_METHOD_26: - case CFG_METHOD_29: - case CFG_METHOD_30: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - case CFG_METHOD_35: - case CFG_METHOD_36: - rtl8168_clear_phy_mcu_patch_request(tp); - break; - } - - switch (tp->mcfg) { - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - case CFG_METHOD_31: - case CFG_METHOD_32: - case CFG_METHOD_33: - case CFG_METHOD_34: - rtl8168_oob_mutex_unlock(tp); - break; - } + rtl8168_disable_adv_eee(tp); return ret; } @@ -7912,6 +8047,19 @@ } #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) +static void rtl8168_get_channels(struct net_device *dev, + struct ethtool_channels *channel) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + channel->max_rx = tp->HwSuppNumRxQueues; + channel->max_tx = tp->HwSuppNumTxQueues; + channel->rx_count = tp->num_rx_rings; + channel->tx_count = tp->num_tx_rings; +} +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) */ + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) static const struct ethtool_ops rtl8168_ethtool_ops = { .get_drvinfo = rtl8168_get_drvinfo, @@ -7978,6 +8126,9 @@ .get_eee = rtl_ethtool_get_eee, .set_eee = rtl_ethtool_set_eee, #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) + .get_channels = rtl8168_get_channels, +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) */ .nway_reset = rtl_nway_reset, }; #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) @@ -8358,7 +8509,7 @@ rtl8168_tally_counter_clear(struct rtl8168_private *tp) { if (tp->mcfg == CFG_METHOD_1 || tp->mcfg == CFG_METHOD_2 || - tp->mcfg == CFG_METHOD_3 ) + tp->mcfg == CFG_METHOD_3) return; if (!tp->tally_paddr) @@ -8658,17 +8809,15 @@ void rtl8168_enable_now_is_oob(struct rtl8168_private *tp) { - if ( tp->HwSuppNowIsOobVer == 1 ) { + if (tp->HwSuppNowIsOobVer == 1) RTL_W8(tp, MCUCmd_reg, RTL_R8(tp, MCUCmd_reg) | Now_is_oob); - } } void rtl8168_disable_now_is_oob(struct rtl8168_private *tp) { - if ( tp->HwSuppNowIsOobVer == 1 ) { + if (tp->HwSuppNowIsOobVer == 1) RTL_W8(tp, MCUCmd_reg, RTL_R8(tp, MCUCmd_reg) & ~Now_is_oob); - } } static void @@ -8695,11 +8844,9 @@ rtl8168_disable_rx_packet_filter(tp); - if (HW_SUPP_SERDES_PHY(tp)) { - if (tp->HwSuppSerDesPhyVer == 1) { + if (HW_SUPP_SERDES_PHY(tp)) + if (tp->HwSuppSerDesPhyVer == 1) rtl8168_switch_to_sgmii_mode(tp); - } - } if (HW_DASH_SUPPORT_DASH(tp)) { rtl8168_driver_start(tp); @@ -8896,220 +9043,220 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - rtl8168_mac_ocp_write( tp, 0xF800, 0xE008 ); - rtl8168_mac_ocp_write( tp, 0xF802, 0xE01B ); - rtl8168_mac_ocp_write( tp, 0xF804, 0xE022 ); - rtl8168_mac_ocp_write( tp, 0xF806, 0xE094 ); - rtl8168_mac_ocp_write( tp, 0xF808, 0xE097 ); - rtl8168_mac_ocp_write( tp, 0xF80A, 0xE09A ); - rtl8168_mac_ocp_write( tp, 0xF80C, 0xE0B3 ); - rtl8168_mac_ocp_write( tp, 0xF80E, 0xE0BA ); - rtl8168_mac_ocp_write( tp, 0xF810, 0x49D2 ); - rtl8168_mac_ocp_write( tp, 0xF812, 0xF10D ); - rtl8168_mac_ocp_write( tp, 0xF814, 0x766C ); - rtl8168_mac_ocp_write( tp, 0xF816, 0x49E2 ); - rtl8168_mac_ocp_write( tp, 0xF818, 0xF00A ); - rtl8168_mac_ocp_write( tp, 0xF81A, 0x1EC0 ); - rtl8168_mac_ocp_write( tp, 0xF81C, 0x8EE1 ); - rtl8168_mac_ocp_write( tp, 0xF81E, 0xC60A ); - rtl8168_mac_ocp_write( tp, 0xF820, 0x77C0 ); - rtl8168_mac_ocp_write( tp, 0xF822, 0x4870 ); - rtl8168_mac_ocp_write( tp, 0xF824, 0x9FC0 ); - rtl8168_mac_ocp_write( tp, 0xF826, 0x1EA0 ); - rtl8168_mac_ocp_write( tp, 0xF828, 0xC707 ); - rtl8168_mac_ocp_write( tp, 0xF82A, 0x8EE1 ); - rtl8168_mac_ocp_write( tp, 0xF82C, 0x9D6C ); - rtl8168_mac_ocp_write( tp, 0xF82E, 0xC603 ); - rtl8168_mac_ocp_write( tp, 0xF830, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF832, 0xB416 ); - rtl8168_mac_ocp_write( tp, 0xF834, 0x0076 ); - rtl8168_mac_ocp_write( tp, 0xF836, 0xE86C ); - rtl8168_mac_ocp_write( tp, 0xF838, 0xC406 ); - rtl8168_mac_ocp_write( tp, 0xF83A, 0x7580 ); - rtl8168_mac_ocp_write( tp, 0xF83C, 0x4852 ); - rtl8168_mac_ocp_write( tp, 0xF83E, 0x8D80 ); - rtl8168_mac_ocp_write( tp, 0xF840, 0xC403 ); - rtl8168_mac_ocp_write( tp, 0xF842, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF844, 0xD3E0 ); - rtl8168_mac_ocp_write( tp, 0xF846, 0x02C8 ); - rtl8168_mac_ocp_write( tp, 0xF848, 0x8918 ); - rtl8168_mac_ocp_write( tp, 0xF84A, 0xE815 ); - rtl8168_mac_ocp_write( tp, 0xF84C, 0x1100 ); - rtl8168_mac_ocp_write( tp, 0xF84E, 0xF011 ); - rtl8168_mac_ocp_write( tp, 0xF850, 0xE812 ); - rtl8168_mac_ocp_write( tp, 0xF852, 0x4990 ); - rtl8168_mac_ocp_write( tp, 0xF854, 0xF002 ); - rtl8168_mac_ocp_write( tp, 0xF856, 0xE817 ); - rtl8168_mac_ocp_write( tp, 0xF858, 0xE80E ); - rtl8168_mac_ocp_write( tp, 0xF85A, 0x4992 ); - rtl8168_mac_ocp_write( tp, 0xF85C, 0xF002 ); - rtl8168_mac_ocp_write( tp, 0xF85E, 0xE80E ); - rtl8168_mac_ocp_write( tp, 0xF860, 0xE80A ); - rtl8168_mac_ocp_write( tp, 0xF862, 0x4993 ); - rtl8168_mac_ocp_write( tp, 0xF864, 0xF002 ); - rtl8168_mac_ocp_write( tp, 0xF866, 0xE818 ); - rtl8168_mac_ocp_write( tp, 0xF868, 0xE806 ); - rtl8168_mac_ocp_write( tp, 0xF86A, 0x4991 ); - rtl8168_mac_ocp_write( tp, 0xF86C, 0xF002 ); - rtl8168_mac_ocp_write( tp, 0xF86E, 0xE838 ); - rtl8168_mac_ocp_write( tp, 0xF870, 0xC25E ); - rtl8168_mac_ocp_write( tp, 0xF872, 0xBA00 ); - rtl8168_mac_ocp_write( tp, 0xF874, 0xC056 ); - rtl8168_mac_ocp_write( tp, 0xF876, 0x7100 ); - rtl8168_mac_ocp_write( tp, 0xF878, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xF87A, 0x7100 ); - rtl8168_mac_ocp_write( tp, 0xF87C, 0x4892 ); - rtl8168_mac_ocp_write( tp, 0xF87E, 0x4813 ); - rtl8168_mac_ocp_write( tp, 0xF880, 0x8900 ); - rtl8168_mac_ocp_write( tp, 0xF882, 0xE00A ); - rtl8168_mac_ocp_write( tp, 0xF884, 0x7100 ); - rtl8168_mac_ocp_write( tp, 0xF886, 0x4890 ); - rtl8168_mac_ocp_write( tp, 0xF888, 0x4813 ); - rtl8168_mac_ocp_write( tp, 0xF88A, 0x8900 ); - rtl8168_mac_ocp_write( tp, 0xF88C, 0xC74B ); - rtl8168_mac_ocp_write( tp, 0xF88E, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF890, 0x48C2 ); - rtl8168_mac_ocp_write( tp, 0xF892, 0x4841 ); - rtl8168_mac_ocp_write( tp, 0xF894, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF896, 0xC746 ); - rtl8168_mac_ocp_write( tp, 0xF898, 0x74FC ); - rtl8168_mac_ocp_write( tp, 0xF89A, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF89C, 0xF120 ); - rtl8168_mac_ocp_write( tp, 0xF89E, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8A0, 0xF11E ); - rtl8168_mac_ocp_write( tp, 0xF8A2, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF8A4, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF8A6, 0xF01B ); - rtl8168_mac_ocp_write( tp, 0xF8A8, 0x49C6 ); - rtl8168_mac_ocp_write( tp, 0xF8AA, 0xF119 ); - rtl8168_mac_ocp_write( tp, 0xF8AC, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF8AE, 0x49C4 ); - rtl8168_mac_ocp_write( tp, 0xF8B0, 0xF013 ); - rtl8168_mac_ocp_write( tp, 0xF8B2, 0xC536 ); - rtl8168_mac_ocp_write( tp, 0xF8B4, 0x74B0 ); - rtl8168_mac_ocp_write( tp, 0xF8B6, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8B8, 0xF1FD ); - rtl8168_mac_ocp_write( tp, 0xF8BA, 0xC537 ); - rtl8168_mac_ocp_write( tp, 0xF8BC, 0xC434 ); - rtl8168_mac_ocp_write( tp, 0xF8BE, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF8C0, 0xC435 ); - rtl8168_mac_ocp_write( tp, 0xF8C2, 0x1C13 ); - rtl8168_mac_ocp_write( tp, 0xF8C4, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xF8C6, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xF8C8, 0xC52B ); - rtl8168_mac_ocp_write( tp, 0xF8CA, 0x74B0 ); - rtl8168_mac_ocp_write( tp, 0xF8CC, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8CE, 0xF1FD ); - rtl8168_mac_ocp_write( tp, 0xF8D0, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF8D2, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF8D4, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF8D6, 0x7100 ); - rtl8168_mac_ocp_write( tp, 0xF8D8, 0x4893 ); - rtl8168_mac_ocp_write( tp, 0xF8DA, 0x8900 ); - rtl8168_mac_ocp_write( tp, 0xF8DC, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xF8DE, 0xC520 ); - rtl8168_mac_ocp_write( tp, 0xF8E0, 0x74B0 ); - rtl8168_mac_ocp_write( tp, 0xF8E2, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8E4, 0xF11C ); - rtl8168_mac_ocp_write( tp, 0xF8E6, 0xC71E ); - rtl8168_mac_ocp_write( tp, 0xF8E8, 0x74FC ); - rtl8168_mac_ocp_write( tp, 0xF8EA, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8EC, 0xF118 ); - rtl8168_mac_ocp_write( tp, 0xF8EE, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF8F0, 0xF116 ); - rtl8168_mac_ocp_write( tp, 0xF8F2, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF8F4, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF8F6, 0xF013 ); - rtl8168_mac_ocp_write( tp, 0xF8F8, 0x48C3 ); - rtl8168_mac_ocp_write( tp, 0xF8FA, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF8FC, 0xC516 ); - rtl8168_mac_ocp_write( tp, 0xF8FE, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xF900, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xF902, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xF904, 0xC411 ); - rtl8168_mac_ocp_write( tp, 0xF906, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF908, 0xC411 ); - rtl8168_mac_ocp_write( tp, 0xF90A, 0x1C13 ); - rtl8168_mac_ocp_write( tp, 0xF90C, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xF90E, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xF910, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xF912, 0x49CF ); - rtl8168_mac_ocp_write( tp, 0xF914, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xF916, 0x7100 ); - rtl8168_mac_ocp_write( tp, 0xF918, 0x4891 ); - rtl8168_mac_ocp_write( tp, 0xF91A, 0x8900 ); - rtl8168_mac_ocp_write( tp, 0xF91C, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xF91E, 0xE400 ); - rtl8168_mac_ocp_write( tp, 0xF920, 0xD3E0 ); - rtl8168_mac_ocp_write( tp, 0xF922, 0xE000 ); - rtl8168_mac_ocp_write( tp, 0xF924, 0x0481 ); - rtl8168_mac_ocp_write( tp, 0xF926, 0x0C81 ); - rtl8168_mac_ocp_write( tp, 0xF928, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xF92A, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xF92C, 0x0992 ); - rtl8168_mac_ocp_write( tp, 0xF92E, 0x1B76 ); - rtl8168_mac_ocp_write( tp, 0xF930, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF932, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF934, 0x059C ); - rtl8168_mac_ocp_write( tp, 0xF936, 0x1B76 ); - rtl8168_mac_ocp_write( tp, 0xF938, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF93A, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF93C, 0x065A ); - rtl8168_mac_ocp_write( tp, 0xF93E, 0xB400 ); - rtl8168_mac_ocp_write( tp, 0xF940, 0x18DE ); - rtl8168_mac_ocp_write( tp, 0xF942, 0x2008 ); - rtl8168_mac_ocp_write( tp, 0xF944, 0x4001 ); - rtl8168_mac_ocp_write( tp, 0xF946, 0xF10F ); - rtl8168_mac_ocp_write( tp, 0xF948, 0x7342 ); - rtl8168_mac_ocp_write( tp, 0xF94A, 0x1880 ); - rtl8168_mac_ocp_write( tp, 0xF94C, 0x2008 ); - rtl8168_mac_ocp_write( tp, 0xF94E, 0x0009 ); - rtl8168_mac_ocp_write( tp, 0xF950, 0x4018 ); - rtl8168_mac_ocp_write( tp, 0xF952, 0xF109 ); - rtl8168_mac_ocp_write( tp, 0xF954, 0x7340 ); - rtl8168_mac_ocp_write( tp, 0xF956, 0x25BC ); - rtl8168_mac_ocp_write( tp, 0xF958, 0x130F ); - rtl8168_mac_ocp_write( tp, 0xF95A, 0xF105 ); - rtl8168_mac_ocp_write( tp, 0xF95C, 0xC00A ); - rtl8168_mac_ocp_write( tp, 0xF95E, 0x7300 ); - rtl8168_mac_ocp_write( tp, 0xF960, 0x4831 ); - rtl8168_mac_ocp_write( tp, 0xF962, 0x9B00 ); - rtl8168_mac_ocp_write( tp, 0xF964, 0xB000 ); - rtl8168_mac_ocp_write( tp, 0xF966, 0x7340 ); - rtl8168_mac_ocp_write( tp, 0xF968, 0x8320 ); - rtl8168_mac_ocp_write( tp, 0xF96A, 0xC302 ); - rtl8168_mac_ocp_write( tp, 0xF96C, 0xBB00 ); - rtl8168_mac_ocp_write( tp, 0xF96E, 0x0C12 ); - rtl8168_mac_ocp_write( tp, 0xF970, 0xE860 ); - rtl8168_mac_ocp_write( tp, 0xF972, 0xC406 ); - rtl8168_mac_ocp_write( tp, 0xF974, 0x7580 ); - rtl8168_mac_ocp_write( tp, 0xF976, 0x4851 ); - rtl8168_mac_ocp_write( tp, 0xF978, 0x8D80 ); - rtl8168_mac_ocp_write( tp, 0xF97A, 0xC403 ); - rtl8168_mac_ocp_write( tp, 0xF97C, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF97E, 0xD3E0 ); - rtl8168_mac_ocp_write( tp, 0xF980, 0x02C8 ); - rtl8168_mac_ocp_write( tp, 0xF982, 0xC406 ); - rtl8168_mac_ocp_write( tp, 0xF984, 0x7580 ); - rtl8168_mac_ocp_write( tp, 0xF986, 0x4850 ); - rtl8168_mac_ocp_write( tp, 0xF988, 0x8D80 ); - rtl8168_mac_ocp_write( tp, 0xF98A, 0xC403 ); - rtl8168_mac_ocp_write( tp, 0xF98C, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF98E, 0xD3E0 ); - rtl8168_mac_ocp_write( tp, 0xF990, 0x0298 ); - - rtl8168_mac_ocp_write( tp, 0xDE30, 0x0080 ); - - rtl8168_mac_ocp_write( tp, 0xFC26, 0x8000 ); - - rtl8168_mac_ocp_write( tp, 0xFC28, 0x0075 ); - rtl8168_mac_ocp_write( tp, 0xFC2A, 0x02B1 ); - rtl8168_mac_ocp_write( tp, 0xFC2C, 0x0991 ); - rtl8168_mac_ocp_write( tp, 0xFC2E, 0x059B ); - rtl8168_mac_ocp_write( tp, 0xFC30, 0x0659 ); - rtl8168_mac_ocp_write( tp, 0xFC32, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC34, 0x02C7 ); - rtl8168_mac_ocp_write( tp, 0xFC36, 0x0279 ); + rtl8168_mac_ocp_write(tp, 0xF800, 0xE008); + rtl8168_mac_ocp_write(tp, 0xF802, 0xE01B); + rtl8168_mac_ocp_write(tp, 0xF804, 0xE022); + rtl8168_mac_ocp_write(tp, 0xF806, 0xE094); + rtl8168_mac_ocp_write(tp, 0xF808, 0xE097); + rtl8168_mac_ocp_write(tp, 0xF80A, 0xE09A); + rtl8168_mac_ocp_write(tp, 0xF80C, 0xE0B3); + rtl8168_mac_ocp_write(tp, 0xF80E, 0xE0BA); + rtl8168_mac_ocp_write(tp, 0xF810, 0x49D2); + rtl8168_mac_ocp_write(tp, 0xF812, 0xF10D); + rtl8168_mac_ocp_write(tp, 0xF814, 0x766C); + rtl8168_mac_ocp_write(tp, 0xF816, 0x49E2); + rtl8168_mac_ocp_write(tp, 0xF818, 0xF00A); + rtl8168_mac_ocp_write(tp, 0xF81A, 0x1EC0); + rtl8168_mac_ocp_write(tp, 0xF81C, 0x8EE1); + rtl8168_mac_ocp_write(tp, 0xF81E, 0xC60A); + rtl8168_mac_ocp_write(tp, 0xF820, 0x77C0); + rtl8168_mac_ocp_write(tp, 0xF822, 0x4870); + rtl8168_mac_ocp_write(tp, 0xF824, 0x9FC0); + rtl8168_mac_ocp_write(tp, 0xF826, 0x1EA0); + rtl8168_mac_ocp_write(tp, 0xF828, 0xC707); + rtl8168_mac_ocp_write(tp, 0xF82A, 0x8EE1); + rtl8168_mac_ocp_write(tp, 0xF82C, 0x9D6C); + rtl8168_mac_ocp_write(tp, 0xF82E, 0xC603); + rtl8168_mac_ocp_write(tp, 0xF830, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF832, 0xB416); + rtl8168_mac_ocp_write(tp, 0xF834, 0x0076); + rtl8168_mac_ocp_write(tp, 0xF836, 0xE86C); + rtl8168_mac_ocp_write(tp, 0xF838, 0xC406); + rtl8168_mac_ocp_write(tp, 0xF83A, 0x7580); + rtl8168_mac_ocp_write(tp, 0xF83C, 0x4852); + rtl8168_mac_ocp_write(tp, 0xF83E, 0x8D80); + rtl8168_mac_ocp_write(tp, 0xF840, 0xC403); + rtl8168_mac_ocp_write(tp, 0xF842, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF844, 0xD3E0); + rtl8168_mac_ocp_write(tp, 0xF846, 0x02C8); + rtl8168_mac_ocp_write(tp, 0xF848, 0x8918); + rtl8168_mac_ocp_write(tp, 0xF84A, 0xE815); + rtl8168_mac_ocp_write(tp, 0xF84C, 0x1100); + rtl8168_mac_ocp_write(tp, 0xF84E, 0xF011); + rtl8168_mac_ocp_write(tp, 0xF850, 0xE812); + rtl8168_mac_ocp_write(tp, 0xF852, 0x4990); + rtl8168_mac_ocp_write(tp, 0xF854, 0xF002); + rtl8168_mac_ocp_write(tp, 0xF856, 0xE817); + rtl8168_mac_ocp_write(tp, 0xF858, 0xE80E); + rtl8168_mac_ocp_write(tp, 0xF85A, 0x4992); + rtl8168_mac_ocp_write(tp, 0xF85C, 0xF002); + rtl8168_mac_ocp_write(tp, 0xF85E, 0xE80E); + rtl8168_mac_ocp_write(tp, 0xF860, 0xE80A); + rtl8168_mac_ocp_write(tp, 0xF862, 0x4993); + rtl8168_mac_ocp_write(tp, 0xF864, 0xF002); + rtl8168_mac_ocp_write(tp, 0xF866, 0xE818); + rtl8168_mac_ocp_write(tp, 0xF868, 0xE806); + rtl8168_mac_ocp_write(tp, 0xF86A, 0x4991); + rtl8168_mac_ocp_write(tp, 0xF86C, 0xF002); + rtl8168_mac_ocp_write(tp, 0xF86E, 0xE838); + rtl8168_mac_ocp_write(tp, 0xF870, 0xC25E); + rtl8168_mac_ocp_write(tp, 0xF872, 0xBA00); + rtl8168_mac_ocp_write(tp, 0xF874, 0xC056); + rtl8168_mac_ocp_write(tp, 0xF876, 0x7100); + rtl8168_mac_ocp_write(tp, 0xF878, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xF87A, 0x7100); + rtl8168_mac_ocp_write(tp, 0xF87C, 0x4892); + rtl8168_mac_ocp_write(tp, 0xF87E, 0x4813); + rtl8168_mac_ocp_write(tp, 0xF880, 0x8900); + rtl8168_mac_ocp_write(tp, 0xF882, 0xE00A); + rtl8168_mac_ocp_write(tp, 0xF884, 0x7100); + rtl8168_mac_ocp_write(tp, 0xF886, 0x4890); + rtl8168_mac_ocp_write(tp, 0xF888, 0x4813); + rtl8168_mac_ocp_write(tp, 0xF88A, 0x8900); + rtl8168_mac_ocp_write(tp, 0xF88C, 0xC74B); + rtl8168_mac_ocp_write(tp, 0xF88E, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF890, 0x48C2); + rtl8168_mac_ocp_write(tp, 0xF892, 0x4841); + rtl8168_mac_ocp_write(tp, 0xF894, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF896, 0xC746); + rtl8168_mac_ocp_write(tp, 0xF898, 0x74FC); + rtl8168_mac_ocp_write(tp, 0xF89A, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF89C, 0xF120); + rtl8168_mac_ocp_write(tp, 0xF89E, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8A0, 0xF11E); + rtl8168_mac_ocp_write(tp, 0xF8A2, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF8A4, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF8A6, 0xF01B); + rtl8168_mac_ocp_write(tp, 0xF8A8, 0x49C6); + rtl8168_mac_ocp_write(tp, 0xF8AA, 0xF119); + rtl8168_mac_ocp_write(tp, 0xF8AC, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF8AE, 0x49C4); + rtl8168_mac_ocp_write(tp, 0xF8B0, 0xF013); + rtl8168_mac_ocp_write(tp, 0xF8B2, 0xC536); + rtl8168_mac_ocp_write(tp, 0xF8B4, 0x74B0); + rtl8168_mac_ocp_write(tp, 0xF8B6, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8B8, 0xF1FD); + rtl8168_mac_ocp_write(tp, 0xF8BA, 0xC537); + rtl8168_mac_ocp_write(tp, 0xF8BC, 0xC434); + rtl8168_mac_ocp_write(tp, 0xF8BE, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF8C0, 0xC435); + rtl8168_mac_ocp_write(tp, 0xF8C2, 0x1C13); + rtl8168_mac_ocp_write(tp, 0xF8C4, 0x484F); + rtl8168_mac_ocp_write(tp, 0xF8C6, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xF8C8, 0xC52B); + rtl8168_mac_ocp_write(tp, 0xF8CA, 0x74B0); + rtl8168_mac_ocp_write(tp, 0xF8CC, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8CE, 0xF1FD); + rtl8168_mac_ocp_write(tp, 0xF8D0, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF8D2, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF8D4, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF8D6, 0x7100); + rtl8168_mac_ocp_write(tp, 0xF8D8, 0x4893); + rtl8168_mac_ocp_write(tp, 0xF8DA, 0x8900); + rtl8168_mac_ocp_write(tp, 0xF8DC, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xF8DE, 0xC520); + rtl8168_mac_ocp_write(tp, 0xF8E0, 0x74B0); + rtl8168_mac_ocp_write(tp, 0xF8E2, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8E4, 0xF11C); + rtl8168_mac_ocp_write(tp, 0xF8E6, 0xC71E); + rtl8168_mac_ocp_write(tp, 0xF8E8, 0x74FC); + rtl8168_mac_ocp_write(tp, 0xF8EA, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8EC, 0xF118); + rtl8168_mac_ocp_write(tp, 0xF8EE, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF8F0, 0xF116); + rtl8168_mac_ocp_write(tp, 0xF8F2, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF8F4, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF8F6, 0xF013); + rtl8168_mac_ocp_write(tp, 0xF8F8, 0x48C3); + rtl8168_mac_ocp_write(tp, 0xF8FA, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF8FC, 0xC516); + rtl8168_mac_ocp_write(tp, 0xF8FE, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xF900, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xF902, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xF904, 0xC411); + rtl8168_mac_ocp_write(tp, 0xF906, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF908, 0xC411); + rtl8168_mac_ocp_write(tp, 0xF90A, 0x1C13); + rtl8168_mac_ocp_write(tp, 0xF90C, 0x484F); + rtl8168_mac_ocp_write(tp, 0xF90E, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xF910, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xF912, 0x49CF); + rtl8168_mac_ocp_write(tp, 0xF914, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xF916, 0x7100); + rtl8168_mac_ocp_write(tp, 0xF918, 0x4891); + rtl8168_mac_ocp_write(tp, 0xF91A, 0x8900); + rtl8168_mac_ocp_write(tp, 0xF91C, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xF91E, 0xE400); + rtl8168_mac_ocp_write(tp, 0xF920, 0xD3E0); + rtl8168_mac_ocp_write(tp, 0xF922, 0xE000); + rtl8168_mac_ocp_write(tp, 0xF924, 0x0481); + rtl8168_mac_ocp_write(tp, 0xF926, 0x0C81); + rtl8168_mac_ocp_write(tp, 0xF928, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xF92A, 0x0000); + rtl8168_mac_ocp_write(tp, 0xF92C, 0x0992); + rtl8168_mac_ocp_write(tp, 0xF92E, 0x1B76); + rtl8168_mac_ocp_write(tp, 0xF930, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF932, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF934, 0x059C); + rtl8168_mac_ocp_write(tp, 0xF936, 0x1B76); + rtl8168_mac_ocp_write(tp, 0xF938, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF93A, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF93C, 0x065A); + rtl8168_mac_ocp_write(tp, 0xF93E, 0xB400); + rtl8168_mac_ocp_write(tp, 0xF940, 0x18DE); + rtl8168_mac_ocp_write(tp, 0xF942, 0x2008); + rtl8168_mac_ocp_write(tp, 0xF944, 0x4001); + rtl8168_mac_ocp_write(tp, 0xF946, 0xF10F); + rtl8168_mac_ocp_write(tp, 0xF948, 0x7342); + rtl8168_mac_ocp_write(tp, 0xF94A, 0x1880); + rtl8168_mac_ocp_write(tp, 0xF94C, 0x2008); + rtl8168_mac_ocp_write(tp, 0xF94E, 0x0009); + rtl8168_mac_ocp_write(tp, 0xF950, 0x4018); + rtl8168_mac_ocp_write(tp, 0xF952, 0xF109); + rtl8168_mac_ocp_write(tp, 0xF954, 0x7340); + rtl8168_mac_ocp_write(tp, 0xF956, 0x25BC); + rtl8168_mac_ocp_write(tp, 0xF958, 0x130F); + rtl8168_mac_ocp_write(tp, 0xF95A, 0xF105); + rtl8168_mac_ocp_write(tp, 0xF95C, 0xC00A); + rtl8168_mac_ocp_write(tp, 0xF95E, 0x7300); + rtl8168_mac_ocp_write(tp, 0xF960, 0x4831); + rtl8168_mac_ocp_write(tp, 0xF962, 0x9B00); + rtl8168_mac_ocp_write(tp, 0xF964, 0xB000); + rtl8168_mac_ocp_write(tp, 0xF966, 0x7340); + rtl8168_mac_ocp_write(tp, 0xF968, 0x8320); + rtl8168_mac_ocp_write(tp, 0xF96A, 0xC302); + rtl8168_mac_ocp_write(tp, 0xF96C, 0xBB00); + rtl8168_mac_ocp_write(tp, 0xF96E, 0x0C12); + rtl8168_mac_ocp_write(tp, 0xF970, 0xE860); + rtl8168_mac_ocp_write(tp, 0xF972, 0xC406); + rtl8168_mac_ocp_write(tp, 0xF974, 0x7580); + rtl8168_mac_ocp_write(tp, 0xF976, 0x4851); + rtl8168_mac_ocp_write(tp, 0xF978, 0x8D80); + rtl8168_mac_ocp_write(tp, 0xF97A, 0xC403); + rtl8168_mac_ocp_write(tp, 0xF97C, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF97E, 0xD3E0); + rtl8168_mac_ocp_write(tp, 0xF980, 0x02C8); + rtl8168_mac_ocp_write(tp, 0xF982, 0xC406); + rtl8168_mac_ocp_write(tp, 0xF984, 0x7580); + rtl8168_mac_ocp_write(tp, 0xF986, 0x4850); + rtl8168_mac_ocp_write(tp, 0xF988, 0x8D80); + rtl8168_mac_ocp_write(tp, 0xF98A, 0xC403); + rtl8168_mac_ocp_write(tp, 0xF98C, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF98E, 0xD3E0); + rtl8168_mac_ocp_write(tp, 0xF990, 0x0298); + + rtl8168_mac_ocp_write(tp, 0xDE30, 0x0080); + + rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); + + rtl8168_mac_ocp_write(tp, 0xFC28, 0x0075); + rtl8168_mac_ocp_write(tp, 0xFC2A, 0x02B1); + rtl8168_mac_ocp_write(tp, 0xFC2C, 0x0991); + rtl8168_mac_ocp_write(tp, 0xFC2E, 0x059B); + rtl8168_mac_ocp_write(tp, 0xFC30, 0x0659); + rtl8168_mac_ocp_write(tp, 0xFC32, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC34, 0x02C7); + rtl8168_mac_ocp_write(tp, 0xFC36, 0x0279); } static void @@ -9119,127 +9266,127 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - rtl8168_mac_ocp_write( tp, 0xF800, 0xE008 ); - rtl8168_mac_ocp_write( tp, 0xF802, 0xE011 ); - rtl8168_mac_ocp_write( tp, 0xF804, 0xE015 ); - rtl8168_mac_ocp_write( tp, 0xF806, 0xE018 ); - rtl8168_mac_ocp_write( tp, 0xF808, 0xE01B ); - rtl8168_mac_ocp_write( tp, 0xF80A, 0xE027 ); - rtl8168_mac_ocp_write( tp, 0xF80C, 0xE043 ); - rtl8168_mac_ocp_write( tp, 0xF80E, 0xE065 ); - rtl8168_mac_ocp_write( tp, 0xF810, 0x49E2 ); - rtl8168_mac_ocp_write( tp, 0xF812, 0xF005 ); - rtl8168_mac_ocp_write( tp, 0xF814, 0x49EA ); - rtl8168_mac_ocp_write( tp, 0xF816, 0xF003 ); - rtl8168_mac_ocp_write( tp, 0xF818, 0xC404 ); - rtl8168_mac_ocp_write( tp, 0xF81A, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF81C, 0xC403 ); - rtl8168_mac_ocp_write( tp, 0xF81E, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF820, 0x0496 ); - rtl8168_mac_ocp_write( tp, 0xF822, 0x051A ); - rtl8168_mac_ocp_write( tp, 0xF824, 0x1D01 ); - rtl8168_mac_ocp_write( tp, 0xF826, 0x8DE8 ); - rtl8168_mac_ocp_write( tp, 0xF828, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF82A, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF82C, 0x0206 ); - rtl8168_mac_ocp_write( tp, 0xF82E, 0x1B76 ); - rtl8168_mac_ocp_write( tp, 0xF830, 0xC202 ); - rtl8168_mac_ocp_write( tp, 0xF832, 0xBA00 ); - rtl8168_mac_ocp_write( tp, 0xF834, 0x058A ); - rtl8168_mac_ocp_write( tp, 0xF836, 0x1B76 ); - rtl8168_mac_ocp_write( tp, 0xF838, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF83A, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF83C, 0x0648 ); - rtl8168_mac_ocp_write( tp, 0xF83E, 0x74E6 ); - rtl8168_mac_ocp_write( tp, 0xF840, 0x1B78 ); - rtl8168_mac_ocp_write( tp, 0xF842, 0x46DC ); - rtl8168_mac_ocp_write( tp, 0xF844, 0x1300 ); - rtl8168_mac_ocp_write( tp, 0xF846, 0xF005 ); - rtl8168_mac_ocp_write( tp, 0xF848, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF84A, 0x48C3 ); - rtl8168_mac_ocp_write( tp, 0xF84C, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF84E, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF850, 0x64E7 ); - rtl8168_mac_ocp_write( tp, 0xF852, 0xC302 ); - rtl8168_mac_ocp_write( tp, 0xF854, 0xBB00 ); - rtl8168_mac_ocp_write( tp, 0xF856, 0x068E ); - rtl8168_mac_ocp_write( tp, 0xF858, 0x74E4 ); - rtl8168_mac_ocp_write( tp, 0xF85A, 0x49C5 ); - rtl8168_mac_ocp_write( tp, 0xF85C, 0xF106 ); - rtl8168_mac_ocp_write( tp, 0xF85E, 0x49C6 ); - rtl8168_mac_ocp_write( tp, 0xF860, 0xF107 ); - rtl8168_mac_ocp_write( tp, 0xF862, 0x48C8 ); - rtl8168_mac_ocp_write( tp, 0xF864, 0x48C9 ); - rtl8168_mac_ocp_write( tp, 0xF866, 0xE011 ); - rtl8168_mac_ocp_write( tp, 0xF868, 0x48C9 ); - rtl8168_mac_ocp_write( tp, 0xF86A, 0x4848 ); - rtl8168_mac_ocp_write( tp, 0xF86C, 0xE00E ); - rtl8168_mac_ocp_write( tp, 0xF86E, 0x4848 ); - rtl8168_mac_ocp_write( tp, 0xF870, 0x49C7 ); - rtl8168_mac_ocp_write( tp, 0xF872, 0xF00A ); - rtl8168_mac_ocp_write( tp, 0xF874, 0x48C9 ); - rtl8168_mac_ocp_write( tp, 0xF876, 0xC60D ); - rtl8168_mac_ocp_write( tp, 0xF878, 0x1D1F ); - rtl8168_mac_ocp_write( tp, 0xF87A, 0x8DC2 ); - rtl8168_mac_ocp_write( tp, 0xF87C, 0x1D00 ); - rtl8168_mac_ocp_write( tp, 0xF87E, 0x8DC3 ); - rtl8168_mac_ocp_write( tp, 0xF880, 0x1D11 ); - rtl8168_mac_ocp_write( tp, 0xF882, 0x8DC0 ); - rtl8168_mac_ocp_write( tp, 0xF884, 0xE002 ); - rtl8168_mac_ocp_write( tp, 0xF886, 0x4849 ); - rtl8168_mac_ocp_write( tp, 0xF888, 0x94E5 ); - rtl8168_mac_ocp_write( tp, 0xF88A, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF88C, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF88E, 0x0238 ); - rtl8168_mac_ocp_write( tp, 0xF890, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xF892, 0x49D9 ); - rtl8168_mac_ocp_write( tp, 0xF894, 0xF01B ); - rtl8168_mac_ocp_write( tp, 0xF896, 0xC31E ); - rtl8168_mac_ocp_write( tp, 0xF898, 0x7464 ); - rtl8168_mac_ocp_write( tp, 0xF89A, 0x49C4 ); - rtl8168_mac_ocp_write( tp, 0xF89C, 0xF114 ); - rtl8168_mac_ocp_write( tp, 0xF89E, 0xC31B ); - rtl8168_mac_ocp_write( tp, 0xF8A0, 0x6460 ); - rtl8168_mac_ocp_write( tp, 0xF8A2, 0x14FA ); - rtl8168_mac_ocp_write( tp, 0xF8A4, 0xFA02 ); - rtl8168_mac_ocp_write( tp, 0xF8A6, 0xE00F ); - rtl8168_mac_ocp_write( tp, 0xF8A8, 0xC317 ); - rtl8168_mac_ocp_write( tp, 0xF8AA, 0x7460 ); - rtl8168_mac_ocp_write( tp, 0xF8AC, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF8AE, 0xF10B ); - rtl8168_mac_ocp_write( tp, 0xF8B0, 0xC311 ); - rtl8168_mac_ocp_write( tp, 0xF8B2, 0x7462 ); - rtl8168_mac_ocp_write( tp, 0xF8B4, 0x48C1 ); - rtl8168_mac_ocp_write( tp, 0xF8B6, 0x9C62 ); - rtl8168_mac_ocp_write( tp, 0xF8B8, 0x4841 ); - rtl8168_mac_ocp_write( tp, 0xF8BA, 0x9C62 ); - rtl8168_mac_ocp_write( tp, 0xF8BC, 0xC30A ); - rtl8168_mac_ocp_write( tp, 0xF8BE, 0x1C04 ); - rtl8168_mac_ocp_write( tp, 0xF8C0, 0x8C60 ); - rtl8168_mac_ocp_write( tp, 0xF8C2, 0xE004 ); - rtl8168_mac_ocp_write( tp, 0xF8C4, 0x1C15 ); - rtl8168_mac_ocp_write( tp, 0xF8C6, 0xC305 ); - rtl8168_mac_ocp_write( tp, 0xF8C8, 0x8C60 ); - rtl8168_mac_ocp_write( tp, 0xF8CA, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF8CC, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF8CE, 0x0374 ); - rtl8168_mac_ocp_write( tp, 0xF8D0, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xF8D2, 0xE030 ); - rtl8168_mac_ocp_write( tp, 0xF8D4, 0xE61C ); - rtl8168_mac_ocp_write( tp, 0xF8D6, 0xE906 ); - rtl8168_mac_ocp_write( tp, 0xF8D8, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF8DA, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF8DC, 0x0000 ); - - rtl8168_mac_ocp_write( tp, 0xFC26, 0x8000 ); - - rtl8168_mac_ocp_write( tp, 0xFC28, 0x0493 ); - rtl8168_mac_ocp_write( tp, 0xFC2A, 0x0205 ); - rtl8168_mac_ocp_write( tp, 0xFC2C, 0x0589 ); - rtl8168_mac_ocp_write( tp, 0xFC2E, 0x0647 ); - rtl8168_mac_ocp_write( tp, 0xFC30, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC32, 0x0215 ); - rtl8168_mac_ocp_write( tp, 0xFC34, 0x0285 ); + rtl8168_mac_ocp_write(tp, 0xF800, 0xE008); + rtl8168_mac_ocp_write(tp, 0xF802, 0xE011); + rtl8168_mac_ocp_write(tp, 0xF804, 0xE015); + rtl8168_mac_ocp_write(tp, 0xF806, 0xE018); + rtl8168_mac_ocp_write(tp, 0xF808, 0xE01B); + rtl8168_mac_ocp_write(tp, 0xF80A, 0xE027); + rtl8168_mac_ocp_write(tp, 0xF80C, 0xE043); + rtl8168_mac_ocp_write(tp, 0xF80E, 0xE065); + rtl8168_mac_ocp_write(tp, 0xF810, 0x49E2); + rtl8168_mac_ocp_write(tp, 0xF812, 0xF005); + rtl8168_mac_ocp_write(tp, 0xF814, 0x49EA); + rtl8168_mac_ocp_write(tp, 0xF816, 0xF003); + rtl8168_mac_ocp_write(tp, 0xF818, 0xC404); + rtl8168_mac_ocp_write(tp, 0xF81A, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF81C, 0xC403); + rtl8168_mac_ocp_write(tp, 0xF81E, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF820, 0x0496); + rtl8168_mac_ocp_write(tp, 0xF822, 0x051A); + rtl8168_mac_ocp_write(tp, 0xF824, 0x1D01); + rtl8168_mac_ocp_write(tp, 0xF826, 0x8DE8); + rtl8168_mac_ocp_write(tp, 0xF828, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF82A, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF82C, 0x0206); + rtl8168_mac_ocp_write(tp, 0xF82E, 0x1B76); + rtl8168_mac_ocp_write(tp, 0xF830, 0xC202); + rtl8168_mac_ocp_write(tp, 0xF832, 0xBA00); + rtl8168_mac_ocp_write(tp, 0xF834, 0x058A); + rtl8168_mac_ocp_write(tp, 0xF836, 0x1B76); + rtl8168_mac_ocp_write(tp, 0xF838, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF83A, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF83C, 0x0648); + rtl8168_mac_ocp_write(tp, 0xF83E, 0x74E6); + rtl8168_mac_ocp_write(tp, 0xF840, 0x1B78); + rtl8168_mac_ocp_write(tp, 0xF842, 0x46DC); + rtl8168_mac_ocp_write(tp, 0xF844, 0x1300); + rtl8168_mac_ocp_write(tp, 0xF846, 0xF005); + rtl8168_mac_ocp_write(tp, 0xF848, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF84A, 0x48C3); + rtl8168_mac_ocp_write(tp, 0xF84C, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF84E, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF850, 0x64E7); + rtl8168_mac_ocp_write(tp, 0xF852, 0xC302); + rtl8168_mac_ocp_write(tp, 0xF854, 0xBB00); + rtl8168_mac_ocp_write(tp, 0xF856, 0x068E); + rtl8168_mac_ocp_write(tp, 0xF858, 0x74E4); + rtl8168_mac_ocp_write(tp, 0xF85A, 0x49C5); + rtl8168_mac_ocp_write(tp, 0xF85C, 0xF106); + rtl8168_mac_ocp_write(tp, 0xF85E, 0x49C6); + rtl8168_mac_ocp_write(tp, 0xF860, 0xF107); + rtl8168_mac_ocp_write(tp, 0xF862, 0x48C8); + rtl8168_mac_ocp_write(tp, 0xF864, 0x48C9); + rtl8168_mac_ocp_write(tp, 0xF866, 0xE011); + rtl8168_mac_ocp_write(tp, 0xF868, 0x48C9); + rtl8168_mac_ocp_write(tp, 0xF86A, 0x4848); + rtl8168_mac_ocp_write(tp, 0xF86C, 0xE00E); + rtl8168_mac_ocp_write(tp, 0xF86E, 0x4848); + rtl8168_mac_ocp_write(tp, 0xF870, 0x49C7); + rtl8168_mac_ocp_write(tp, 0xF872, 0xF00A); + rtl8168_mac_ocp_write(tp, 0xF874, 0x48C9); + rtl8168_mac_ocp_write(tp, 0xF876, 0xC60D); + rtl8168_mac_ocp_write(tp, 0xF878, 0x1D1F); + rtl8168_mac_ocp_write(tp, 0xF87A, 0x8DC2); + rtl8168_mac_ocp_write(tp, 0xF87C, 0x1D00); + rtl8168_mac_ocp_write(tp, 0xF87E, 0x8DC3); + rtl8168_mac_ocp_write(tp, 0xF880, 0x1D11); + rtl8168_mac_ocp_write(tp, 0xF882, 0x8DC0); + rtl8168_mac_ocp_write(tp, 0xF884, 0xE002); + rtl8168_mac_ocp_write(tp, 0xF886, 0x4849); + rtl8168_mac_ocp_write(tp, 0xF888, 0x94E5); + rtl8168_mac_ocp_write(tp, 0xF88A, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF88C, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF88E, 0x0238); + rtl8168_mac_ocp_write(tp, 0xF890, 0xE434); + rtl8168_mac_ocp_write(tp, 0xF892, 0x49D9); + rtl8168_mac_ocp_write(tp, 0xF894, 0xF01B); + rtl8168_mac_ocp_write(tp, 0xF896, 0xC31E); + rtl8168_mac_ocp_write(tp, 0xF898, 0x7464); + rtl8168_mac_ocp_write(tp, 0xF89A, 0x49C4); + rtl8168_mac_ocp_write(tp, 0xF89C, 0xF114); + rtl8168_mac_ocp_write(tp, 0xF89E, 0xC31B); + rtl8168_mac_ocp_write(tp, 0xF8A0, 0x6460); + rtl8168_mac_ocp_write(tp, 0xF8A2, 0x14FA); + rtl8168_mac_ocp_write(tp, 0xF8A4, 0xFA02); + rtl8168_mac_ocp_write(tp, 0xF8A6, 0xE00F); + rtl8168_mac_ocp_write(tp, 0xF8A8, 0xC317); + rtl8168_mac_ocp_write(tp, 0xF8AA, 0x7460); + rtl8168_mac_ocp_write(tp, 0xF8AC, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF8AE, 0xF10B); + rtl8168_mac_ocp_write(tp, 0xF8B0, 0xC311); + rtl8168_mac_ocp_write(tp, 0xF8B2, 0x7462); + rtl8168_mac_ocp_write(tp, 0xF8B4, 0x48C1); + rtl8168_mac_ocp_write(tp, 0xF8B6, 0x9C62); + rtl8168_mac_ocp_write(tp, 0xF8B8, 0x4841); + rtl8168_mac_ocp_write(tp, 0xF8BA, 0x9C62); + rtl8168_mac_ocp_write(tp, 0xF8BC, 0xC30A); + rtl8168_mac_ocp_write(tp, 0xF8BE, 0x1C04); + rtl8168_mac_ocp_write(tp, 0xF8C0, 0x8C60); + rtl8168_mac_ocp_write(tp, 0xF8C2, 0xE004); + rtl8168_mac_ocp_write(tp, 0xF8C4, 0x1C15); + rtl8168_mac_ocp_write(tp, 0xF8C6, 0xC305); + rtl8168_mac_ocp_write(tp, 0xF8C8, 0x8C60); + rtl8168_mac_ocp_write(tp, 0xF8CA, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF8CC, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF8CE, 0x0374); + rtl8168_mac_ocp_write(tp, 0xF8D0, 0xE434); + rtl8168_mac_ocp_write(tp, 0xF8D2, 0xE030); + rtl8168_mac_ocp_write(tp, 0xF8D4, 0xE61C); + rtl8168_mac_ocp_write(tp, 0xF8D6, 0xE906); + rtl8168_mac_ocp_write(tp, 0xF8D8, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF8DA, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF8DC, 0x0000); + + rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); + + rtl8168_mac_ocp_write(tp, 0xFC28, 0x0493); + rtl8168_mac_ocp_write(tp, 0xFC2A, 0x0205); + rtl8168_mac_ocp_write(tp, 0xFC2C, 0x0589); + rtl8168_mac_ocp_write(tp, 0xFC2E, 0x0647); + rtl8168_mac_ocp_write(tp, 0xFC30, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC32, 0x0215); + rtl8168_mac_ocp_write(tp, 0xFC34, 0x0285); } static void @@ -9249,426 +9396,426 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - rtl8168_mac_ocp_write( tp, 0xF800, 0xE008 ); - rtl8168_mac_ocp_write( tp, 0xF802, 0xE00A ); - rtl8168_mac_ocp_write( tp, 0xF804, 0xE00D ); - rtl8168_mac_ocp_write( tp, 0xF806, 0xE02F ); - rtl8168_mac_ocp_write( tp, 0xF808, 0xE031 ); - rtl8168_mac_ocp_write( tp, 0xF80A, 0xE038 ); - rtl8168_mac_ocp_write( tp, 0xF80C, 0xE03A ); - rtl8168_mac_ocp_write( tp, 0xF80E, 0xE051 ); - rtl8168_mac_ocp_write( tp, 0xF810, 0xC202 ); - rtl8168_mac_ocp_write( tp, 0xF812, 0xBA00 ); - rtl8168_mac_ocp_write( tp, 0xF814, 0x0DFC ); - rtl8168_mac_ocp_write( tp, 0xF816, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF818, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF81A, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF81C, 0x0A30 ); - rtl8168_mac_ocp_write( tp, 0xF81E, 0x49D9 ); - rtl8168_mac_ocp_write( tp, 0xF820, 0xF019 ); - rtl8168_mac_ocp_write( tp, 0xF822, 0xC520 ); - rtl8168_mac_ocp_write( tp, 0xF824, 0x64A5 ); - rtl8168_mac_ocp_write( tp, 0xF826, 0x1400 ); - rtl8168_mac_ocp_write( tp, 0xF828, 0xF007 ); - rtl8168_mac_ocp_write( tp, 0xF82A, 0x0C01 ); - rtl8168_mac_ocp_write( tp, 0xF82C, 0x8CA5 ); - rtl8168_mac_ocp_write( tp, 0xF82E, 0x1C15 ); - rtl8168_mac_ocp_write( tp, 0xF830, 0xC515 ); - rtl8168_mac_ocp_write( tp, 0xF832, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF834, 0xE00F ); - rtl8168_mac_ocp_write( tp, 0xF836, 0xC513 ); - rtl8168_mac_ocp_write( tp, 0xF838, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF83A, 0x48C8 ); - rtl8168_mac_ocp_write( tp, 0xF83C, 0x48CA ); - rtl8168_mac_ocp_write( tp, 0xF83E, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF840, 0xC510 ); - rtl8168_mac_ocp_write( tp, 0xF842, 0x1B00 ); - rtl8168_mac_ocp_write( tp, 0xF844, 0x9BA0 ); - rtl8168_mac_ocp_write( tp, 0xF846, 0x1B1C ); - rtl8168_mac_ocp_write( tp, 0xF848, 0x483F ); - rtl8168_mac_ocp_write( tp, 0xF84A, 0x9BA2 ); - rtl8168_mac_ocp_write( tp, 0xF84C, 0x1B04 ); - rtl8168_mac_ocp_write( tp, 0xF84E, 0xC506 ); - rtl8168_mac_ocp_write( tp, 0xF850, 0x9BA0 ); - rtl8168_mac_ocp_write( tp, 0xF852, 0xC603 ); - rtl8168_mac_ocp_write( tp, 0xF854, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF856, 0x0298 ); - rtl8168_mac_ocp_write( tp, 0xF858, 0x03DE ); - rtl8168_mac_ocp_write( tp, 0xF85A, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xF85C, 0xE096 ); - rtl8168_mac_ocp_write( tp, 0xF85E, 0xE860 ); - rtl8168_mac_ocp_write( tp, 0xF860, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xF862, 0xD3C0 ); - rtl8168_mac_ocp_write( tp, 0xF864, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF866, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF868, 0x0A64 ); - rtl8168_mac_ocp_write( tp, 0xF86A, 0xC707 ); - rtl8168_mac_ocp_write( tp, 0xF86C, 0x1D00 ); - rtl8168_mac_ocp_write( tp, 0xF86E, 0x8DE2 ); - rtl8168_mac_ocp_write( tp, 0xF870, 0x48C1 ); - rtl8168_mac_ocp_write( tp, 0xF872, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF874, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF876, 0x00AA ); - rtl8168_mac_ocp_write( tp, 0xF878, 0xE0C0 ); - rtl8168_mac_ocp_write( tp, 0xF87A, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF87C, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF87E, 0x0132 ); - rtl8168_mac_ocp_write( tp, 0xF880, 0xC50C ); - rtl8168_mac_ocp_write( tp, 0xF882, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xF884, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xF886, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xF888, 0x1C00 ); - rtl8168_mac_ocp_write( tp, 0xF88A, 0x9EA0 ); - rtl8168_mac_ocp_write( tp, 0xF88C, 0x1C1C ); - rtl8168_mac_ocp_write( tp, 0xF88E, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xF890, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xF892, 0xC402 ); - rtl8168_mac_ocp_write( tp, 0xF894, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF896, 0x0AFA ); - rtl8168_mac_ocp_write( tp, 0xF898, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xF89A, 0xE000 ); - rtl8168_mac_ocp_write( tp, 0xF89C, 0xE092 ); - rtl8168_mac_ocp_write( tp, 0xF89E, 0xE430 ); - rtl8168_mac_ocp_write( tp, 0xF8A0, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xF8A2, 0xE0C0 ); - rtl8168_mac_ocp_write( tp, 0xF8A4, 0xE860 ); - rtl8168_mac_ocp_write( tp, 0xF8A6, 0xE84C ); - rtl8168_mac_ocp_write( tp, 0xF8A8, 0xB400 ); - rtl8168_mac_ocp_write( tp, 0xF8AA, 0xB430 ); - rtl8168_mac_ocp_write( tp, 0xF8AC, 0xE410 ); - rtl8168_mac_ocp_write( tp, 0xF8AE, 0xC0AE ); - rtl8168_mac_ocp_write( tp, 0xF8B0, 0xB407 ); - rtl8168_mac_ocp_write( tp, 0xF8B2, 0xB406 ); - rtl8168_mac_ocp_write( tp, 0xF8B4, 0xB405 ); - rtl8168_mac_ocp_write( tp, 0xF8B6, 0xB404 ); - rtl8168_mac_ocp_write( tp, 0xF8B8, 0xB403 ); - rtl8168_mac_ocp_write( tp, 0xF8BA, 0xB402 ); - rtl8168_mac_ocp_write( tp, 0xF8BC, 0xB401 ); - rtl8168_mac_ocp_write( tp, 0xF8BE, 0xC7EE ); - rtl8168_mac_ocp_write( tp, 0xF8C0, 0x76F4 ); - rtl8168_mac_ocp_write( tp, 0xF8C2, 0xC2ED ); - rtl8168_mac_ocp_write( tp, 0xF8C4, 0xC3ED ); - rtl8168_mac_ocp_write( tp, 0xF8C6, 0xC1EF ); - rtl8168_mac_ocp_write( tp, 0xF8C8, 0xC5F3 ); - rtl8168_mac_ocp_write( tp, 0xF8CA, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF8CC, 0x49CD ); - rtl8168_mac_ocp_write( tp, 0xF8CE, 0xF001 ); - rtl8168_mac_ocp_write( tp, 0xF8D0, 0xC5EE ); - rtl8168_mac_ocp_write( tp, 0xF8D2, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF8D4, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF8D6, 0xF105 ); - rtl8168_mac_ocp_write( tp, 0xF8D8, 0xC5E4 ); - rtl8168_mac_ocp_write( tp, 0xF8DA, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xF8DC, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xF8DE, 0xF00B ); - rtl8168_mac_ocp_write( tp, 0xF8E0, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF8E2, 0x484B ); - rtl8168_mac_ocp_write( tp, 0xF8E4, 0x9C44 ); - rtl8168_mac_ocp_write( tp, 0xF8E6, 0x1C10 ); - rtl8168_mac_ocp_write( tp, 0xF8E8, 0x9C62 ); - rtl8168_mac_ocp_write( tp, 0xF8EA, 0x1C11 ); - rtl8168_mac_ocp_write( tp, 0xF8EC, 0x8C60 ); - rtl8168_mac_ocp_write( tp, 0xF8EE, 0x1C00 ); - rtl8168_mac_ocp_write( tp, 0xF8F0, 0x9CF6 ); - rtl8168_mac_ocp_write( tp, 0xF8F2, 0xE0EC ); - rtl8168_mac_ocp_write( tp, 0xF8F4, 0x49E7 ); - rtl8168_mac_ocp_write( tp, 0xF8F6, 0xF016 ); - rtl8168_mac_ocp_write( tp, 0xF8F8, 0x1D80 ); - rtl8168_mac_ocp_write( tp, 0xF8FA, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xF8FC, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF8FE, 0x4843 ); - rtl8168_mac_ocp_write( tp, 0xF900, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF902, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF904, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF906, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF908, 0x48C8 ); - rtl8168_mac_ocp_write( tp, 0xF90A, 0x48C9 ); - rtl8168_mac_ocp_write( tp, 0xF90C, 0x48CA ); - rtl8168_mac_ocp_write( tp, 0xF90E, 0x9C44 ); - rtl8168_mac_ocp_write( tp, 0xF910, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF912, 0x4844 ); - rtl8168_mac_ocp_write( tp, 0xF914, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF916, 0x1E01 ); - rtl8168_mac_ocp_write( tp, 0xF918, 0xE8DB ); - rtl8168_mac_ocp_write( tp, 0xF91A, 0x7420 ); - rtl8168_mac_ocp_write( tp, 0xF91C, 0x48C1 ); - rtl8168_mac_ocp_write( tp, 0xF91E, 0x9C20 ); - rtl8168_mac_ocp_write( tp, 0xF920, 0xE0D5 ); - rtl8168_mac_ocp_write( tp, 0xF922, 0x49E6 ); - rtl8168_mac_ocp_write( tp, 0xF924, 0xF02A ); - rtl8168_mac_ocp_write( tp, 0xF926, 0x1D40 ); - rtl8168_mac_ocp_write( tp, 0xF928, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xF92A, 0x74FC ); - rtl8168_mac_ocp_write( tp, 0xF92C, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF92E, 0xF124 ); - rtl8168_mac_ocp_write( tp, 0xF930, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF932, 0xF122 ); - rtl8168_mac_ocp_write( tp, 0xF934, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF936, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF938, 0xF01F ); - rtl8168_mac_ocp_write( tp, 0xF93A, 0xE8D3 ); - rtl8168_mac_ocp_write( tp, 0xF93C, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF93E, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF940, 0x1E00 ); - rtl8168_mac_ocp_write( tp, 0xF942, 0xE8C6 ); - rtl8168_mac_ocp_write( tp, 0xF944, 0xC5B1 ); - rtl8168_mac_ocp_write( tp, 0xF946, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF948, 0x49C3 ); - rtl8168_mac_ocp_write( tp, 0xF94A, 0xF016 ); - rtl8168_mac_ocp_write( tp, 0xF94C, 0xC5AF ); - rtl8168_mac_ocp_write( tp, 0xF94E, 0x74A4 ); - rtl8168_mac_ocp_write( tp, 0xF950, 0x49C2 ); - rtl8168_mac_ocp_write( tp, 0xF952, 0xF005 ); - rtl8168_mac_ocp_write( tp, 0xF954, 0xC5AA ); - rtl8168_mac_ocp_write( tp, 0xF956, 0x74B2 ); - rtl8168_mac_ocp_write( tp, 0xF958, 0x49C9 ); - rtl8168_mac_ocp_write( tp, 0xF95A, 0xF10E ); - rtl8168_mac_ocp_write( tp, 0xF95C, 0xC5A6 ); - rtl8168_mac_ocp_write( tp, 0xF95E, 0x74A8 ); - rtl8168_mac_ocp_write( tp, 0xF960, 0x4845 ); - rtl8168_mac_ocp_write( tp, 0xF962, 0x4846 ); - rtl8168_mac_ocp_write( tp, 0xF964, 0x4847 ); - rtl8168_mac_ocp_write( tp, 0xF966, 0x4848 ); - rtl8168_mac_ocp_write( tp, 0xF968, 0x9CA8 ); - rtl8168_mac_ocp_write( tp, 0xF96A, 0x74B2 ); - rtl8168_mac_ocp_write( tp, 0xF96C, 0x4849 ); - rtl8168_mac_ocp_write( tp, 0xF96E, 0x9CB2 ); - rtl8168_mac_ocp_write( tp, 0xF970, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF972, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xF974, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF976, 0xE0AA ); - rtl8168_mac_ocp_write( tp, 0xF978, 0x49E4 ); - rtl8168_mac_ocp_write( tp, 0xF97A, 0xF018 ); - rtl8168_mac_ocp_write( tp, 0xF97C, 0x1D10 ); - rtl8168_mac_ocp_write( tp, 0xF97E, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xF980, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF982, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF984, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF986, 0x4843 ); - rtl8168_mac_ocp_write( tp, 0xF988, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF98A, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF98C, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF98E, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF990, 0x4844 ); - rtl8168_mac_ocp_write( tp, 0xF992, 0x4842 ); - rtl8168_mac_ocp_write( tp, 0xF994, 0x4841 ); - rtl8168_mac_ocp_write( tp, 0xF996, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF998, 0x1E01 ); - rtl8168_mac_ocp_write( tp, 0xF99A, 0xE89A ); - rtl8168_mac_ocp_write( tp, 0xF99C, 0x7420 ); - rtl8168_mac_ocp_write( tp, 0xF99E, 0x4841 ); - rtl8168_mac_ocp_write( tp, 0xF9A0, 0x9C20 ); - rtl8168_mac_ocp_write( tp, 0xF9A2, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF9A4, 0x4848 ); - rtl8168_mac_ocp_write( tp, 0xF9A6, 0x9C44 ); - rtl8168_mac_ocp_write( tp, 0xF9A8, 0xE091 ); - rtl8168_mac_ocp_write( tp, 0xF9AA, 0x49E5 ); - rtl8168_mac_ocp_write( tp, 0xF9AC, 0xF03E ); - rtl8168_mac_ocp_write( tp, 0xF9AE, 0x1D20 ); - rtl8168_mac_ocp_write( tp, 0xF9B0, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xF9B2, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF9B4, 0x48C2 ); - rtl8168_mac_ocp_write( tp, 0xF9B6, 0x4841 ); - rtl8168_mac_ocp_write( tp, 0xF9B8, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF9BA, 0x1E01 ); - rtl8168_mac_ocp_write( tp, 0xF9BC, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF9BE, 0x49CA ); - rtl8168_mac_ocp_write( tp, 0xF9C0, 0xF103 ); - rtl8168_mac_ocp_write( tp, 0xF9C2, 0x49C2 ); - rtl8168_mac_ocp_write( tp, 0xF9C4, 0xF00C ); - rtl8168_mac_ocp_write( tp, 0xF9C6, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF9C8, 0xF004 ); - rtl8168_mac_ocp_write( tp, 0xF9CA, 0x6447 ); - rtl8168_mac_ocp_write( tp, 0xF9CC, 0x2244 ); - rtl8168_mac_ocp_write( tp, 0xF9CE, 0xE002 ); - rtl8168_mac_ocp_write( tp, 0xF9D0, 0x1C01 ); - rtl8168_mac_ocp_write( tp, 0xF9D2, 0x9C62 ); - rtl8168_mac_ocp_write( tp, 0xF9D4, 0x1C11 ); - rtl8168_mac_ocp_write( tp, 0xF9D6, 0x8C60 ); - rtl8168_mac_ocp_write( tp, 0xF9D8, 0x1C00 ); - rtl8168_mac_ocp_write( tp, 0xF9DA, 0x9CF6 ); - rtl8168_mac_ocp_write( tp, 0xF9DC, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xF9DE, 0x49C8 ); - rtl8168_mac_ocp_write( tp, 0xF9E0, 0xF01D ); - rtl8168_mac_ocp_write( tp, 0xF9E2, 0x74FC ); - rtl8168_mac_ocp_write( tp, 0xF9E4, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF9E6, 0xF11A ); - rtl8168_mac_ocp_write( tp, 0xF9E8, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xF9EA, 0xF118 ); - rtl8168_mac_ocp_write( tp, 0xF9EC, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF9EE, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF9F0, 0xF015 ); - rtl8168_mac_ocp_write( tp, 0xF9F2, 0x49C6 ); - rtl8168_mac_ocp_write( tp, 0xF9F4, 0xF113 ); - rtl8168_mac_ocp_write( tp, 0xF9F6, 0xE875 ); - rtl8168_mac_ocp_write( tp, 0xF9F8, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF9FA, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF9FC, 0x7420 ); - rtl8168_mac_ocp_write( tp, 0xF9FE, 0x48C1 ); - rtl8168_mac_ocp_write( tp, 0xFA00, 0x9C20 ); - rtl8168_mac_ocp_write( tp, 0xFA02, 0xC50A ); - rtl8168_mac_ocp_write( tp, 0xFA04, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFA06, 0x8CA5 ); - rtl8168_mac_ocp_write( tp, 0xFA08, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xFA0A, 0xC505 ); - rtl8168_mac_ocp_write( tp, 0xFA0C, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xFA0E, 0x1C11 ); - rtl8168_mac_ocp_write( tp, 0xFA10, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xFA12, 0xE00A ); - rtl8168_mac_ocp_write( tp, 0xFA14, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xFA16, 0xD3C0 ); - rtl8168_mac_ocp_write( tp, 0xFA18, 0xDC00 ); - rtl8168_mac_ocp_write( tp, 0xFA1A, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xFA1C, 0x49CA ); - rtl8168_mac_ocp_write( tp, 0xFA1E, 0xF004 ); - rtl8168_mac_ocp_write( tp, 0xFA20, 0x48CA ); - rtl8168_mac_ocp_write( tp, 0xFA22, 0x9C44 ); - rtl8168_mac_ocp_write( tp, 0xFA24, 0xE855 ); - rtl8168_mac_ocp_write( tp, 0xFA26, 0xE052 ); - rtl8168_mac_ocp_write( tp, 0xFA28, 0x49E8 ); - rtl8168_mac_ocp_write( tp, 0xFA2A, 0xF024 ); - rtl8168_mac_ocp_write( tp, 0xFA2C, 0x1D01 ); - rtl8168_mac_ocp_write( tp, 0xFA2E, 0x8DF5 ); - rtl8168_mac_ocp_write( tp, 0xFA30, 0x7440 ); - rtl8168_mac_ocp_write( tp, 0xFA32, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xFA34, 0xF11E ); - rtl8168_mac_ocp_write( tp, 0xFA36, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xFA38, 0x49C8 ); - rtl8168_mac_ocp_write( tp, 0xFA3A, 0xF01B ); - rtl8168_mac_ocp_write( tp, 0xFA3C, 0x49CA ); - rtl8168_mac_ocp_write( tp, 0xFA3E, 0xF119 ); - rtl8168_mac_ocp_write( tp, 0xFA40, 0xC5EC ); - rtl8168_mac_ocp_write( tp, 0xFA42, 0x76A4 ); - rtl8168_mac_ocp_write( tp, 0xFA44, 0x49E3 ); - rtl8168_mac_ocp_write( tp, 0xFA46, 0xF015 ); - rtl8168_mac_ocp_write( tp, 0xFA48, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xFA4A, 0xF103 ); - rtl8168_mac_ocp_write( tp, 0xFA4C, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xFA4E, 0xF011 ); - rtl8168_mac_ocp_write( tp, 0xFA50, 0x4849 ); - rtl8168_mac_ocp_write( tp, 0xFA52, 0x9C44 ); - rtl8168_mac_ocp_write( tp, 0xFA54, 0x1C00 ); - rtl8168_mac_ocp_write( tp, 0xFA56, 0x9CF6 ); - rtl8168_mac_ocp_write( tp, 0xFA58, 0x7444 ); - rtl8168_mac_ocp_write( tp, 0xFA5A, 0x49C1 ); - rtl8168_mac_ocp_write( tp, 0xFA5C, 0xF004 ); - rtl8168_mac_ocp_write( tp, 0xFA5E, 0x6446 ); - rtl8168_mac_ocp_write( tp, 0xFA60, 0x1E07 ); - rtl8168_mac_ocp_write( tp, 0xFA62, 0xE003 ); - rtl8168_mac_ocp_write( tp, 0xFA64, 0x1C01 ); - rtl8168_mac_ocp_write( tp, 0xFA66, 0x1E03 ); - rtl8168_mac_ocp_write( tp, 0xFA68, 0x9C62 ); - rtl8168_mac_ocp_write( tp, 0xFA6A, 0x1C11 ); - rtl8168_mac_ocp_write( tp, 0xFA6C, 0x8C60 ); - rtl8168_mac_ocp_write( tp, 0xFA6E, 0xE830 ); - rtl8168_mac_ocp_write( tp, 0xFA70, 0xE02D ); - rtl8168_mac_ocp_write( tp, 0xFA72, 0x49E9 ); - rtl8168_mac_ocp_write( tp, 0xFA74, 0xF004 ); - rtl8168_mac_ocp_write( tp, 0xFA76, 0x1D02 ); - rtl8168_mac_ocp_write( tp, 0xFA78, 0x8DF5 ); - rtl8168_mac_ocp_write( tp, 0xFA7A, 0xE79C ); - rtl8168_mac_ocp_write( tp, 0xFA7C, 0x49E3 ); - rtl8168_mac_ocp_write( tp, 0xFA7E, 0xF006 ); - rtl8168_mac_ocp_write( tp, 0xFA80, 0x1D08 ); - rtl8168_mac_ocp_write( tp, 0xFA82, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xFA84, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xFA86, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xFA88, 0xE73A ); - rtl8168_mac_ocp_write( tp, 0xFA8A, 0x49E1 ); - rtl8168_mac_ocp_write( tp, 0xFA8C, 0xF007 ); - rtl8168_mac_ocp_write( tp, 0xFA8E, 0x1D02 ); - rtl8168_mac_ocp_write( tp, 0xFA90, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xFA92, 0x1E01 ); - rtl8168_mac_ocp_write( tp, 0xFA94, 0xE7A7 ); - rtl8168_mac_ocp_write( tp, 0xFA96, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xFA98, 0xE410 ); - rtl8168_mac_ocp_write( tp, 0xFA9A, 0x49E0 ); - rtl8168_mac_ocp_write( tp, 0xFA9C, 0xF017 ); - rtl8168_mac_ocp_write( tp, 0xFA9E, 0x1D01 ); - rtl8168_mac_ocp_write( tp, 0xFAA0, 0x8DF4 ); - rtl8168_mac_ocp_write( tp, 0xFAA2, 0xC5FA ); - rtl8168_mac_ocp_write( tp, 0xFAA4, 0x1C00 ); - rtl8168_mac_ocp_write( tp, 0xFAA6, 0x8CA0 ); - rtl8168_mac_ocp_write( tp, 0xFAA8, 0x1C1B ); - rtl8168_mac_ocp_write( tp, 0xFAAA, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xFAAC, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFAAE, 0x49CF ); - rtl8168_mac_ocp_write( tp, 0xFAB0, 0xF0FE ); - rtl8168_mac_ocp_write( tp, 0xFAB2, 0xC5F3 ); - rtl8168_mac_ocp_write( tp, 0xFAB4, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xFAB6, 0x4849 ); - rtl8168_mac_ocp_write( tp, 0xFAB8, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xFABA, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xFABC, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xFABE, 0xF006 ); - rtl8168_mac_ocp_write( tp, 0xFAC0, 0x48C3 ); - rtl8168_mac_ocp_write( tp, 0xFAC2, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xFAC4, 0xE820 ); - rtl8168_mac_ocp_write( tp, 0xFAC6, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xFAC8, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xFACA, 0xC432 ); - rtl8168_mac_ocp_write( tp, 0xFACC, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xFACE, 0xC5E4 ); - rtl8168_mac_ocp_write( tp, 0xFAD0, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFAD2, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xFAD4, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xFAD6, 0x9EA0 ); - rtl8168_mac_ocp_write( tp, 0xFAD8, 0x1C1C ); - rtl8168_mac_ocp_write( tp, 0xFADA, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xFADC, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xFADE, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xFAE0, 0xB404 ); - rtl8168_mac_ocp_write( tp, 0xFAE2, 0xB405 ); - rtl8168_mac_ocp_write( tp, 0xFAE4, 0xC5D9 ); - rtl8168_mac_ocp_write( tp, 0xFAE6, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFAE8, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xFAEA, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xFAEC, 0xC41F ); - rtl8168_mac_ocp_write( tp, 0xFAEE, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xFAF0, 0xC41C ); - rtl8168_mac_ocp_write( tp, 0xFAF2, 0x1C13 ); - rtl8168_mac_ocp_write( tp, 0xFAF4, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xFAF6, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xFAF8, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFAFA, 0x49CF ); - rtl8168_mac_ocp_write( tp, 0xFAFC, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xFAFE, 0xB005 ); - rtl8168_mac_ocp_write( tp, 0xFB00, 0xB004 ); - rtl8168_mac_ocp_write( tp, 0xFB02, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xFB04, 0xB404 ); - rtl8168_mac_ocp_write( tp, 0xFB06, 0xB405 ); - rtl8168_mac_ocp_write( tp, 0xFB08, 0xC5C7 ); - rtl8168_mac_ocp_write( tp, 0xFB0A, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFB0C, 0x49CE ); - rtl8168_mac_ocp_write( tp, 0xFB0E, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xFB10, 0xC40E ); - rtl8168_mac_ocp_write( tp, 0xFB12, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xFB14, 0xC40A ); - rtl8168_mac_ocp_write( tp, 0xFB16, 0x1C13 ); - rtl8168_mac_ocp_write( tp, 0xFB18, 0x484F ); - rtl8168_mac_ocp_write( tp, 0xFB1A, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xFB1C, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xFB1E, 0x49CF ); - rtl8168_mac_ocp_write( tp, 0xFB20, 0xF1FE ); - rtl8168_mac_ocp_write( tp, 0xFB22, 0xB005 ); - rtl8168_mac_ocp_write( tp, 0xFB24, 0xB004 ); - rtl8168_mac_ocp_write( tp, 0xFB26, 0xFF80 ); - rtl8168_mac_ocp_write( tp, 0xFB28, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFB2A, 0x0481 ); - rtl8168_mac_ocp_write( tp, 0xFB2C, 0x0C81 ); - rtl8168_mac_ocp_write( tp, 0xFB2E, 0x0AE0 ); - - - rtl8168_mac_ocp_write( tp, 0xFC26, 0x8000 ); - - rtl8168_mac_ocp_write( tp, 0xFC28, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC2A, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC2C, 0x0297 ); - rtl8168_mac_ocp_write( tp, 0xFC2E, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC30, 0x00A9 ); - rtl8168_mac_ocp_write( tp, 0xFC32, 0x012D ); - rtl8168_mac_ocp_write( tp, 0xFC34, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xFC36, 0x08DF ); + rtl8168_mac_ocp_write(tp, 0xF800, 0xE008); + rtl8168_mac_ocp_write(tp, 0xF802, 0xE00A); + rtl8168_mac_ocp_write(tp, 0xF804, 0xE00D); + rtl8168_mac_ocp_write(tp, 0xF806, 0xE02F); + rtl8168_mac_ocp_write(tp, 0xF808, 0xE031); + rtl8168_mac_ocp_write(tp, 0xF80A, 0xE038); + rtl8168_mac_ocp_write(tp, 0xF80C, 0xE03A); + rtl8168_mac_ocp_write(tp, 0xF80E, 0xE051); + rtl8168_mac_ocp_write(tp, 0xF810, 0xC202); + rtl8168_mac_ocp_write(tp, 0xF812, 0xBA00); + rtl8168_mac_ocp_write(tp, 0xF814, 0x0DFC); + rtl8168_mac_ocp_write(tp, 0xF816, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF818, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF81A, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF81C, 0x0A30); + rtl8168_mac_ocp_write(tp, 0xF81E, 0x49D9); + rtl8168_mac_ocp_write(tp, 0xF820, 0xF019); + rtl8168_mac_ocp_write(tp, 0xF822, 0xC520); + rtl8168_mac_ocp_write(tp, 0xF824, 0x64A5); + rtl8168_mac_ocp_write(tp, 0xF826, 0x1400); + rtl8168_mac_ocp_write(tp, 0xF828, 0xF007); + rtl8168_mac_ocp_write(tp, 0xF82A, 0x0C01); + rtl8168_mac_ocp_write(tp, 0xF82C, 0x8CA5); + rtl8168_mac_ocp_write(tp, 0xF82E, 0x1C15); + rtl8168_mac_ocp_write(tp, 0xF830, 0xC515); + rtl8168_mac_ocp_write(tp, 0xF832, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF834, 0xE00F); + rtl8168_mac_ocp_write(tp, 0xF836, 0xC513); + rtl8168_mac_ocp_write(tp, 0xF838, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF83A, 0x48C8); + rtl8168_mac_ocp_write(tp, 0xF83C, 0x48CA); + rtl8168_mac_ocp_write(tp, 0xF83E, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF840, 0xC510); + rtl8168_mac_ocp_write(tp, 0xF842, 0x1B00); + rtl8168_mac_ocp_write(tp, 0xF844, 0x9BA0); + rtl8168_mac_ocp_write(tp, 0xF846, 0x1B1C); + rtl8168_mac_ocp_write(tp, 0xF848, 0x483F); + rtl8168_mac_ocp_write(tp, 0xF84A, 0x9BA2); + rtl8168_mac_ocp_write(tp, 0xF84C, 0x1B04); + rtl8168_mac_ocp_write(tp, 0xF84E, 0xC506); + rtl8168_mac_ocp_write(tp, 0xF850, 0x9BA0); + rtl8168_mac_ocp_write(tp, 0xF852, 0xC603); + rtl8168_mac_ocp_write(tp, 0xF854, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF856, 0x0298); + rtl8168_mac_ocp_write(tp, 0xF858, 0x03DE); + rtl8168_mac_ocp_write(tp, 0xF85A, 0xE434); + rtl8168_mac_ocp_write(tp, 0xF85C, 0xE096); + rtl8168_mac_ocp_write(tp, 0xF85E, 0xE860); + rtl8168_mac_ocp_write(tp, 0xF860, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xF862, 0xD3C0); + rtl8168_mac_ocp_write(tp, 0xF864, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF866, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF868, 0x0A64); + rtl8168_mac_ocp_write(tp, 0xF86A, 0xC707); + rtl8168_mac_ocp_write(tp, 0xF86C, 0x1D00); + rtl8168_mac_ocp_write(tp, 0xF86E, 0x8DE2); + rtl8168_mac_ocp_write(tp, 0xF870, 0x48C1); + rtl8168_mac_ocp_write(tp, 0xF872, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF874, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF876, 0x00AA); + rtl8168_mac_ocp_write(tp, 0xF878, 0xE0C0); + rtl8168_mac_ocp_write(tp, 0xF87A, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF87C, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF87E, 0x0132); + rtl8168_mac_ocp_write(tp, 0xF880, 0xC50C); + rtl8168_mac_ocp_write(tp, 0xF882, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xF884, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xF886, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xF888, 0x1C00); + rtl8168_mac_ocp_write(tp, 0xF88A, 0x9EA0); + rtl8168_mac_ocp_write(tp, 0xF88C, 0x1C1C); + rtl8168_mac_ocp_write(tp, 0xF88E, 0x484F); + rtl8168_mac_ocp_write(tp, 0xF890, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xF892, 0xC402); + rtl8168_mac_ocp_write(tp, 0xF894, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF896, 0x0AFA); + rtl8168_mac_ocp_write(tp, 0xF898, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xF89A, 0xE000); + rtl8168_mac_ocp_write(tp, 0xF89C, 0xE092); + rtl8168_mac_ocp_write(tp, 0xF89E, 0xE430); + rtl8168_mac_ocp_write(tp, 0xF8A0, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xF8A2, 0xE0C0); + rtl8168_mac_ocp_write(tp, 0xF8A4, 0xE860); + rtl8168_mac_ocp_write(tp, 0xF8A6, 0xE84C); + rtl8168_mac_ocp_write(tp, 0xF8A8, 0xB400); + rtl8168_mac_ocp_write(tp, 0xF8AA, 0xB430); + rtl8168_mac_ocp_write(tp, 0xF8AC, 0xE410); + rtl8168_mac_ocp_write(tp, 0xF8AE, 0xC0AE); + rtl8168_mac_ocp_write(tp, 0xF8B0, 0xB407); + rtl8168_mac_ocp_write(tp, 0xF8B2, 0xB406); + rtl8168_mac_ocp_write(tp, 0xF8B4, 0xB405); + rtl8168_mac_ocp_write(tp, 0xF8B6, 0xB404); + rtl8168_mac_ocp_write(tp, 0xF8B8, 0xB403); + rtl8168_mac_ocp_write(tp, 0xF8BA, 0xB402); + rtl8168_mac_ocp_write(tp, 0xF8BC, 0xB401); + rtl8168_mac_ocp_write(tp, 0xF8BE, 0xC7EE); + rtl8168_mac_ocp_write(tp, 0xF8C0, 0x76F4); + rtl8168_mac_ocp_write(tp, 0xF8C2, 0xC2ED); + rtl8168_mac_ocp_write(tp, 0xF8C4, 0xC3ED); + rtl8168_mac_ocp_write(tp, 0xF8C6, 0xC1EF); + rtl8168_mac_ocp_write(tp, 0xF8C8, 0xC5F3); + rtl8168_mac_ocp_write(tp, 0xF8CA, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF8CC, 0x49CD); + rtl8168_mac_ocp_write(tp, 0xF8CE, 0xF001); + rtl8168_mac_ocp_write(tp, 0xF8D0, 0xC5EE); + rtl8168_mac_ocp_write(tp, 0xF8D2, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF8D4, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF8D6, 0xF105); + rtl8168_mac_ocp_write(tp, 0xF8D8, 0xC5E4); + rtl8168_mac_ocp_write(tp, 0xF8DA, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xF8DC, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xF8DE, 0xF00B); + rtl8168_mac_ocp_write(tp, 0xF8E0, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF8E2, 0x484B); + rtl8168_mac_ocp_write(tp, 0xF8E4, 0x9C44); + rtl8168_mac_ocp_write(tp, 0xF8E6, 0x1C10); + rtl8168_mac_ocp_write(tp, 0xF8E8, 0x9C62); + rtl8168_mac_ocp_write(tp, 0xF8EA, 0x1C11); + rtl8168_mac_ocp_write(tp, 0xF8EC, 0x8C60); + rtl8168_mac_ocp_write(tp, 0xF8EE, 0x1C00); + rtl8168_mac_ocp_write(tp, 0xF8F0, 0x9CF6); + rtl8168_mac_ocp_write(tp, 0xF8F2, 0xE0EC); + rtl8168_mac_ocp_write(tp, 0xF8F4, 0x49E7); + rtl8168_mac_ocp_write(tp, 0xF8F6, 0xF016); + rtl8168_mac_ocp_write(tp, 0xF8F8, 0x1D80); + rtl8168_mac_ocp_write(tp, 0xF8FA, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xF8FC, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF8FE, 0x4843); + rtl8168_mac_ocp_write(tp, 0xF900, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF902, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF904, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF906, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF908, 0x48C8); + rtl8168_mac_ocp_write(tp, 0xF90A, 0x48C9); + rtl8168_mac_ocp_write(tp, 0xF90C, 0x48CA); + rtl8168_mac_ocp_write(tp, 0xF90E, 0x9C44); + rtl8168_mac_ocp_write(tp, 0xF910, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF912, 0x4844); + rtl8168_mac_ocp_write(tp, 0xF914, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF916, 0x1E01); + rtl8168_mac_ocp_write(tp, 0xF918, 0xE8DB); + rtl8168_mac_ocp_write(tp, 0xF91A, 0x7420); + rtl8168_mac_ocp_write(tp, 0xF91C, 0x48C1); + rtl8168_mac_ocp_write(tp, 0xF91E, 0x9C20); + rtl8168_mac_ocp_write(tp, 0xF920, 0xE0D5); + rtl8168_mac_ocp_write(tp, 0xF922, 0x49E6); + rtl8168_mac_ocp_write(tp, 0xF924, 0xF02A); + rtl8168_mac_ocp_write(tp, 0xF926, 0x1D40); + rtl8168_mac_ocp_write(tp, 0xF928, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xF92A, 0x74FC); + rtl8168_mac_ocp_write(tp, 0xF92C, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF92E, 0xF124); + rtl8168_mac_ocp_write(tp, 0xF930, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF932, 0xF122); + rtl8168_mac_ocp_write(tp, 0xF934, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF936, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF938, 0xF01F); + rtl8168_mac_ocp_write(tp, 0xF93A, 0xE8D3); + rtl8168_mac_ocp_write(tp, 0xF93C, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF93E, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF940, 0x1E00); + rtl8168_mac_ocp_write(tp, 0xF942, 0xE8C6); + rtl8168_mac_ocp_write(tp, 0xF944, 0xC5B1); + rtl8168_mac_ocp_write(tp, 0xF946, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF948, 0x49C3); + rtl8168_mac_ocp_write(tp, 0xF94A, 0xF016); + rtl8168_mac_ocp_write(tp, 0xF94C, 0xC5AF); + rtl8168_mac_ocp_write(tp, 0xF94E, 0x74A4); + rtl8168_mac_ocp_write(tp, 0xF950, 0x49C2); + rtl8168_mac_ocp_write(tp, 0xF952, 0xF005); + rtl8168_mac_ocp_write(tp, 0xF954, 0xC5AA); + rtl8168_mac_ocp_write(tp, 0xF956, 0x74B2); + rtl8168_mac_ocp_write(tp, 0xF958, 0x49C9); + rtl8168_mac_ocp_write(tp, 0xF95A, 0xF10E); + rtl8168_mac_ocp_write(tp, 0xF95C, 0xC5A6); + rtl8168_mac_ocp_write(tp, 0xF95E, 0x74A8); + rtl8168_mac_ocp_write(tp, 0xF960, 0x4845); + rtl8168_mac_ocp_write(tp, 0xF962, 0x4846); + rtl8168_mac_ocp_write(tp, 0xF964, 0x4847); + rtl8168_mac_ocp_write(tp, 0xF966, 0x4848); + rtl8168_mac_ocp_write(tp, 0xF968, 0x9CA8); + rtl8168_mac_ocp_write(tp, 0xF96A, 0x74B2); + rtl8168_mac_ocp_write(tp, 0xF96C, 0x4849); + rtl8168_mac_ocp_write(tp, 0xF96E, 0x9CB2); + rtl8168_mac_ocp_write(tp, 0xF970, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF972, 0x484F); + rtl8168_mac_ocp_write(tp, 0xF974, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF976, 0xE0AA); + rtl8168_mac_ocp_write(tp, 0xF978, 0x49E4); + rtl8168_mac_ocp_write(tp, 0xF97A, 0xF018); + rtl8168_mac_ocp_write(tp, 0xF97C, 0x1D10); + rtl8168_mac_ocp_write(tp, 0xF97E, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xF980, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF982, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF984, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF986, 0x4843); + rtl8168_mac_ocp_write(tp, 0xF988, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF98A, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF98C, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF98E, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF990, 0x4844); + rtl8168_mac_ocp_write(tp, 0xF992, 0x4842); + rtl8168_mac_ocp_write(tp, 0xF994, 0x4841); + rtl8168_mac_ocp_write(tp, 0xF996, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF998, 0x1E01); + rtl8168_mac_ocp_write(tp, 0xF99A, 0xE89A); + rtl8168_mac_ocp_write(tp, 0xF99C, 0x7420); + rtl8168_mac_ocp_write(tp, 0xF99E, 0x4841); + rtl8168_mac_ocp_write(tp, 0xF9A0, 0x9C20); + rtl8168_mac_ocp_write(tp, 0xF9A2, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF9A4, 0x4848); + rtl8168_mac_ocp_write(tp, 0xF9A6, 0x9C44); + rtl8168_mac_ocp_write(tp, 0xF9A8, 0xE091); + rtl8168_mac_ocp_write(tp, 0xF9AA, 0x49E5); + rtl8168_mac_ocp_write(tp, 0xF9AC, 0xF03E); + rtl8168_mac_ocp_write(tp, 0xF9AE, 0x1D20); + rtl8168_mac_ocp_write(tp, 0xF9B0, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xF9B2, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF9B4, 0x48C2); + rtl8168_mac_ocp_write(tp, 0xF9B6, 0x4841); + rtl8168_mac_ocp_write(tp, 0xF9B8, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF9BA, 0x1E01); + rtl8168_mac_ocp_write(tp, 0xF9BC, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF9BE, 0x49CA); + rtl8168_mac_ocp_write(tp, 0xF9C0, 0xF103); + rtl8168_mac_ocp_write(tp, 0xF9C2, 0x49C2); + rtl8168_mac_ocp_write(tp, 0xF9C4, 0xF00C); + rtl8168_mac_ocp_write(tp, 0xF9C6, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF9C8, 0xF004); + rtl8168_mac_ocp_write(tp, 0xF9CA, 0x6447); + rtl8168_mac_ocp_write(tp, 0xF9CC, 0x2244); + rtl8168_mac_ocp_write(tp, 0xF9CE, 0xE002); + rtl8168_mac_ocp_write(tp, 0xF9D0, 0x1C01); + rtl8168_mac_ocp_write(tp, 0xF9D2, 0x9C62); + rtl8168_mac_ocp_write(tp, 0xF9D4, 0x1C11); + rtl8168_mac_ocp_write(tp, 0xF9D6, 0x8C60); + rtl8168_mac_ocp_write(tp, 0xF9D8, 0x1C00); + rtl8168_mac_ocp_write(tp, 0xF9DA, 0x9CF6); + rtl8168_mac_ocp_write(tp, 0xF9DC, 0x7444); + rtl8168_mac_ocp_write(tp, 0xF9DE, 0x49C8); + rtl8168_mac_ocp_write(tp, 0xF9E0, 0xF01D); + rtl8168_mac_ocp_write(tp, 0xF9E2, 0x74FC); + rtl8168_mac_ocp_write(tp, 0xF9E4, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF9E6, 0xF11A); + rtl8168_mac_ocp_write(tp, 0xF9E8, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xF9EA, 0xF118); + rtl8168_mac_ocp_write(tp, 0xF9EC, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF9EE, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF9F0, 0xF015); + rtl8168_mac_ocp_write(tp, 0xF9F2, 0x49C6); + rtl8168_mac_ocp_write(tp, 0xF9F4, 0xF113); + rtl8168_mac_ocp_write(tp, 0xF9F6, 0xE875); + rtl8168_mac_ocp_write(tp, 0xF9F8, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF9FA, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF9FC, 0x7420); + rtl8168_mac_ocp_write(tp, 0xF9FE, 0x48C1); + rtl8168_mac_ocp_write(tp, 0xFA00, 0x9C20); + rtl8168_mac_ocp_write(tp, 0xFA02, 0xC50A); + rtl8168_mac_ocp_write(tp, 0xFA04, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFA06, 0x8CA5); + rtl8168_mac_ocp_write(tp, 0xFA08, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xFA0A, 0xC505); + rtl8168_mac_ocp_write(tp, 0xFA0C, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xFA0E, 0x1C11); + rtl8168_mac_ocp_write(tp, 0xFA10, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xFA12, 0xE00A); + rtl8168_mac_ocp_write(tp, 0xFA14, 0xE434); + rtl8168_mac_ocp_write(tp, 0xFA16, 0xD3C0); + rtl8168_mac_ocp_write(tp, 0xFA18, 0xDC00); + rtl8168_mac_ocp_write(tp, 0xFA1A, 0x7444); + rtl8168_mac_ocp_write(tp, 0xFA1C, 0x49CA); + rtl8168_mac_ocp_write(tp, 0xFA1E, 0xF004); + rtl8168_mac_ocp_write(tp, 0xFA20, 0x48CA); + rtl8168_mac_ocp_write(tp, 0xFA22, 0x9C44); + rtl8168_mac_ocp_write(tp, 0xFA24, 0xE855); + rtl8168_mac_ocp_write(tp, 0xFA26, 0xE052); + rtl8168_mac_ocp_write(tp, 0xFA28, 0x49E8); + rtl8168_mac_ocp_write(tp, 0xFA2A, 0xF024); + rtl8168_mac_ocp_write(tp, 0xFA2C, 0x1D01); + rtl8168_mac_ocp_write(tp, 0xFA2E, 0x8DF5); + rtl8168_mac_ocp_write(tp, 0xFA30, 0x7440); + rtl8168_mac_ocp_write(tp, 0xFA32, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xFA34, 0xF11E); + rtl8168_mac_ocp_write(tp, 0xFA36, 0x7444); + rtl8168_mac_ocp_write(tp, 0xFA38, 0x49C8); + rtl8168_mac_ocp_write(tp, 0xFA3A, 0xF01B); + rtl8168_mac_ocp_write(tp, 0xFA3C, 0x49CA); + rtl8168_mac_ocp_write(tp, 0xFA3E, 0xF119); + rtl8168_mac_ocp_write(tp, 0xFA40, 0xC5EC); + rtl8168_mac_ocp_write(tp, 0xFA42, 0x76A4); + rtl8168_mac_ocp_write(tp, 0xFA44, 0x49E3); + rtl8168_mac_ocp_write(tp, 0xFA46, 0xF015); + rtl8168_mac_ocp_write(tp, 0xFA48, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xFA4A, 0xF103); + rtl8168_mac_ocp_write(tp, 0xFA4C, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xFA4E, 0xF011); + rtl8168_mac_ocp_write(tp, 0xFA50, 0x4849); + rtl8168_mac_ocp_write(tp, 0xFA52, 0x9C44); + rtl8168_mac_ocp_write(tp, 0xFA54, 0x1C00); + rtl8168_mac_ocp_write(tp, 0xFA56, 0x9CF6); + rtl8168_mac_ocp_write(tp, 0xFA58, 0x7444); + rtl8168_mac_ocp_write(tp, 0xFA5A, 0x49C1); + rtl8168_mac_ocp_write(tp, 0xFA5C, 0xF004); + rtl8168_mac_ocp_write(tp, 0xFA5E, 0x6446); + rtl8168_mac_ocp_write(tp, 0xFA60, 0x1E07); + rtl8168_mac_ocp_write(tp, 0xFA62, 0xE003); + rtl8168_mac_ocp_write(tp, 0xFA64, 0x1C01); + rtl8168_mac_ocp_write(tp, 0xFA66, 0x1E03); + rtl8168_mac_ocp_write(tp, 0xFA68, 0x9C62); + rtl8168_mac_ocp_write(tp, 0xFA6A, 0x1C11); + rtl8168_mac_ocp_write(tp, 0xFA6C, 0x8C60); + rtl8168_mac_ocp_write(tp, 0xFA6E, 0xE830); + rtl8168_mac_ocp_write(tp, 0xFA70, 0xE02D); + rtl8168_mac_ocp_write(tp, 0xFA72, 0x49E9); + rtl8168_mac_ocp_write(tp, 0xFA74, 0xF004); + rtl8168_mac_ocp_write(tp, 0xFA76, 0x1D02); + rtl8168_mac_ocp_write(tp, 0xFA78, 0x8DF5); + rtl8168_mac_ocp_write(tp, 0xFA7A, 0xE79C); + rtl8168_mac_ocp_write(tp, 0xFA7C, 0x49E3); + rtl8168_mac_ocp_write(tp, 0xFA7E, 0xF006); + rtl8168_mac_ocp_write(tp, 0xFA80, 0x1D08); + rtl8168_mac_ocp_write(tp, 0xFA82, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xFA84, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xFA86, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xFA88, 0xE73A); + rtl8168_mac_ocp_write(tp, 0xFA8A, 0x49E1); + rtl8168_mac_ocp_write(tp, 0xFA8C, 0xF007); + rtl8168_mac_ocp_write(tp, 0xFA8E, 0x1D02); + rtl8168_mac_ocp_write(tp, 0xFA90, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xFA92, 0x1E01); + rtl8168_mac_ocp_write(tp, 0xFA94, 0xE7A7); + rtl8168_mac_ocp_write(tp, 0xFA96, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xFA98, 0xE410); + rtl8168_mac_ocp_write(tp, 0xFA9A, 0x49E0); + rtl8168_mac_ocp_write(tp, 0xFA9C, 0xF017); + rtl8168_mac_ocp_write(tp, 0xFA9E, 0x1D01); + rtl8168_mac_ocp_write(tp, 0xFAA0, 0x8DF4); + rtl8168_mac_ocp_write(tp, 0xFAA2, 0xC5FA); + rtl8168_mac_ocp_write(tp, 0xFAA4, 0x1C00); + rtl8168_mac_ocp_write(tp, 0xFAA6, 0x8CA0); + rtl8168_mac_ocp_write(tp, 0xFAA8, 0x1C1B); + rtl8168_mac_ocp_write(tp, 0xFAAA, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xFAAC, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFAAE, 0x49CF); + rtl8168_mac_ocp_write(tp, 0xFAB0, 0xF0FE); + rtl8168_mac_ocp_write(tp, 0xFAB2, 0xC5F3); + rtl8168_mac_ocp_write(tp, 0xFAB4, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xFAB6, 0x4849); + rtl8168_mac_ocp_write(tp, 0xFAB8, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xFABA, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xFABC, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xFABE, 0xF006); + rtl8168_mac_ocp_write(tp, 0xFAC0, 0x48C3); + rtl8168_mac_ocp_write(tp, 0xFAC2, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xFAC4, 0xE820); + rtl8168_mac_ocp_write(tp, 0xFAC6, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xFAC8, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xFACA, 0xC432); + rtl8168_mac_ocp_write(tp, 0xFACC, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xFACE, 0xC5E4); + rtl8168_mac_ocp_write(tp, 0xFAD0, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFAD2, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xFAD4, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xFAD6, 0x9EA0); + rtl8168_mac_ocp_write(tp, 0xFAD8, 0x1C1C); + rtl8168_mac_ocp_write(tp, 0xFADA, 0x484F); + rtl8168_mac_ocp_write(tp, 0xFADC, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xFADE, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xFAE0, 0xB404); + rtl8168_mac_ocp_write(tp, 0xFAE2, 0xB405); + rtl8168_mac_ocp_write(tp, 0xFAE4, 0xC5D9); + rtl8168_mac_ocp_write(tp, 0xFAE6, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFAE8, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xFAEA, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xFAEC, 0xC41F); + rtl8168_mac_ocp_write(tp, 0xFAEE, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xFAF0, 0xC41C); + rtl8168_mac_ocp_write(tp, 0xFAF2, 0x1C13); + rtl8168_mac_ocp_write(tp, 0xFAF4, 0x484F); + rtl8168_mac_ocp_write(tp, 0xFAF6, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xFAF8, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFAFA, 0x49CF); + rtl8168_mac_ocp_write(tp, 0xFAFC, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xFAFE, 0xB005); + rtl8168_mac_ocp_write(tp, 0xFB00, 0xB004); + rtl8168_mac_ocp_write(tp, 0xFB02, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xFB04, 0xB404); + rtl8168_mac_ocp_write(tp, 0xFB06, 0xB405); + rtl8168_mac_ocp_write(tp, 0xFB08, 0xC5C7); + rtl8168_mac_ocp_write(tp, 0xFB0A, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFB0C, 0x49CE); + rtl8168_mac_ocp_write(tp, 0xFB0E, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xFB10, 0xC40E); + rtl8168_mac_ocp_write(tp, 0xFB12, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xFB14, 0xC40A); + rtl8168_mac_ocp_write(tp, 0xFB16, 0x1C13); + rtl8168_mac_ocp_write(tp, 0xFB18, 0x484F); + rtl8168_mac_ocp_write(tp, 0xFB1A, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xFB1C, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xFB1E, 0x49CF); + rtl8168_mac_ocp_write(tp, 0xFB20, 0xF1FE); + rtl8168_mac_ocp_write(tp, 0xFB22, 0xB005); + rtl8168_mac_ocp_write(tp, 0xFB24, 0xB004); + rtl8168_mac_ocp_write(tp, 0xFB26, 0xFF80); + rtl8168_mac_ocp_write(tp, 0xFB28, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFB2A, 0x0481); + rtl8168_mac_ocp_write(tp, 0xFB2C, 0x0C81); + rtl8168_mac_ocp_write(tp, 0xFB2E, 0x0AE0); + + + rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); + + rtl8168_mac_ocp_write(tp, 0xFC28, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC2A, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC2C, 0x0297); + rtl8168_mac_ocp_write(tp, 0xFC2E, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC30, 0x00A9); + rtl8168_mac_ocp_write(tp, 0xFC32, 0x012D); + rtl8168_mac_ocp_write(tp, 0xFC34, 0x0000); + rtl8168_mac_ocp_write(tp, 0xFC36, 0x08DF); } static void @@ -9678,127 +9825,127 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - rtl8168_mac_ocp_write( tp, 0xF800, 0xE008 ); - rtl8168_mac_ocp_write( tp, 0xF802, 0xE00A ); - rtl8168_mac_ocp_write( tp, 0xF804, 0xE00C ); - rtl8168_mac_ocp_write( tp, 0xF806, 0xE00E ); - rtl8168_mac_ocp_write( tp, 0xF808, 0xE027 ); - rtl8168_mac_ocp_write( tp, 0xF80A, 0xE04F ); - rtl8168_mac_ocp_write( tp, 0xF80C, 0xE05E ); - rtl8168_mac_ocp_write( tp, 0xF80E, 0xE065 ); - rtl8168_mac_ocp_write( tp, 0xF810, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF812, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF814, 0x0000 ); - rtl8168_mac_ocp_write( tp, 0xF816, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF818, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF81A, 0x074C ); - rtl8168_mac_ocp_write( tp, 0xF81C, 0xC302 ); - rtl8168_mac_ocp_write( tp, 0xF81E, 0xBB00 ); - rtl8168_mac_ocp_write( tp, 0xF820, 0x080A ); - rtl8168_mac_ocp_write( tp, 0xF822, 0x6420 ); - rtl8168_mac_ocp_write( tp, 0xF824, 0x48C2 ); - rtl8168_mac_ocp_write( tp, 0xF826, 0x8C20 ); - rtl8168_mac_ocp_write( tp, 0xF828, 0xC516 ); - rtl8168_mac_ocp_write( tp, 0xF82A, 0x64A4 ); - rtl8168_mac_ocp_write( tp, 0xF82C, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF82E, 0xF009 ); - rtl8168_mac_ocp_write( tp, 0xF830, 0x74A2 ); - rtl8168_mac_ocp_write( tp, 0xF832, 0x8CA5 ); - rtl8168_mac_ocp_write( tp, 0xF834, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF836, 0xC50E ); - rtl8168_mac_ocp_write( tp, 0xF838, 0x9CA2 ); - rtl8168_mac_ocp_write( tp, 0xF83A, 0x1C11 ); - rtl8168_mac_ocp_write( tp, 0xF83C, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF83E, 0xE006 ); - rtl8168_mac_ocp_write( tp, 0xF840, 0x74F8 ); - rtl8168_mac_ocp_write( tp, 0xF842, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF844, 0x8CF8 ); - rtl8168_mac_ocp_write( tp, 0xF846, 0xC404 ); - rtl8168_mac_ocp_write( tp, 0xF848, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF84A, 0xC403 ); - rtl8168_mac_ocp_write( tp, 0xF84C, 0xBC00 ); - rtl8168_mac_ocp_write( tp, 0xF84E, 0x0BF2 ); - rtl8168_mac_ocp_write( tp, 0xF850, 0x0C0A ); - rtl8168_mac_ocp_write( tp, 0xF852, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xF854, 0xD3C0 ); - rtl8168_mac_ocp_write( tp, 0xF856, 0x49D9 ); - rtl8168_mac_ocp_write( tp, 0xF858, 0xF01F ); - rtl8168_mac_ocp_write( tp, 0xF85A, 0xC526 ); - rtl8168_mac_ocp_write( tp, 0xF85C, 0x64A5 ); - rtl8168_mac_ocp_write( tp, 0xF85E, 0x1400 ); - rtl8168_mac_ocp_write( tp, 0xF860, 0xF007 ); - rtl8168_mac_ocp_write( tp, 0xF862, 0x0C01 ); - rtl8168_mac_ocp_write( tp, 0xF864, 0x8CA5 ); - rtl8168_mac_ocp_write( tp, 0xF866, 0x1C15 ); - rtl8168_mac_ocp_write( tp, 0xF868, 0xC51B ); - rtl8168_mac_ocp_write( tp, 0xF86A, 0x9CA0 ); - rtl8168_mac_ocp_write( tp, 0xF86C, 0xE013 ); - rtl8168_mac_ocp_write( tp, 0xF86E, 0xC519 ); - rtl8168_mac_ocp_write( tp, 0xF870, 0x74A0 ); - rtl8168_mac_ocp_write( tp, 0xF872, 0x48C4 ); - rtl8168_mac_ocp_write( tp, 0xF874, 0x8CA0 ); - rtl8168_mac_ocp_write( tp, 0xF876, 0xC516 ); - rtl8168_mac_ocp_write( tp, 0xF878, 0x74A4 ); - rtl8168_mac_ocp_write( tp, 0xF87A, 0x48C8 ); - rtl8168_mac_ocp_write( tp, 0xF87C, 0x48CA ); - rtl8168_mac_ocp_write( tp, 0xF87E, 0x9CA4 ); - rtl8168_mac_ocp_write( tp, 0xF880, 0xC512 ); - rtl8168_mac_ocp_write( tp, 0xF882, 0x1B00 ); - rtl8168_mac_ocp_write( tp, 0xF884, 0x9BA0 ); - rtl8168_mac_ocp_write( tp, 0xF886, 0x1B1C ); - rtl8168_mac_ocp_write( tp, 0xF888, 0x483F ); - rtl8168_mac_ocp_write( tp, 0xF88A, 0x9BA2 ); - rtl8168_mac_ocp_write( tp, 0xF88C, 0x1B04 ); - rtl8168_mac_ocp_write( tp, 0xF88E, 0xC508 ); - rtl8168_mac_ocp_write( tp, 0xF890, 0x9BA0 ); - rtl8168_mac_ocp_write( tp, 0xF892, 0xC505 ); - rtl8168_mac_ocp_write( tp, 0xF894, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF896, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF898, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF89A, 0x0300 ); - rtl8168_mac_ocp_write( tp, 0xF89C, 0x051E ); - rtl8168_mac_ocp_write( tp, 0xF89E, 0xE434 ); - rtl8168_mac_ocp_write( tp, 0xF8A0, 0xE018 ); - rtl8168_mac_ocp_write( tp, 0xF8A2, 0xE092 ); - rtl8168_mac_ocp_write( tp, 0xF8A4, 0xDE20 ); - rtl8168_mac_ocp_write( tp, 0xF8A6, 0xD3C0 ); - rtl8168_mac_ocp_write( tp, 0xF8A8, 0xC50F ); - rtl8168_mac_ocp_write( tp, 0xF8AA, 0x76A4 ); - rtl8168_mac_ocp_write( tp, 0xF8AC, 0x49E3 ); - rtl8168_mac_ocp_write( tp, 0xF8AE, 0xF007 ); - rtl8168_mac_ocp_write( tp, 0xF8B0, 0x49C0 ); - rtl8168_mac_ocp_write( tp, 0xF8B2, 0xF103 ); - rtl8168_mac_ocp_write( tp, 0xF8B4, 0xC607 ); - rtl8168_mac_ocp_write( tp, 0xF8B6, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF8B8, 0xC606 ); - rtl8168_mac_ocp_write( tp, 0xF8BA, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF8BC, 0xC602 ); - rtl8168_mac_ocp_write( tp, 0xF8BE, 0xBE00 ); - rtl8168_mac_ocp_write( tp, 0xF8C0, 0x0C4C ); - rtl8168_mac_ocp_write( tp, 0xF8C2, 0x0C28 ); - rtl8168_mac_ocp_write( tp, 0xF8C4, 0x0C2C ); - rtl8168_mac_ocp_write( tp, 0xF8C6, 0xDC00 ); - rtl8168_mac_ocp_write( tp, 0xF8C8, 0xC707 ); - rtl8168_mac_ocp_write( tp, 0xF8CA, 0x1D00 ); - rtl8168_mac_ocp_write( tp, 0xF8CC, 0x8DE2 ); - rtl8168_mac_ocp_write( tp, 0xF8CE, 0x48C1 ); - rtl8168_mac_ocp_write( tp, 0xF8D0, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF8D2, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF8D4, 0x00AA ); - rtl8168_mac_ocp_write( tp, 0xF8D6, 0xE0C0 ); - rtl8168_mac_ocp_write( tp, 0xF8D8, 0xC502 ); - rtl8168_mac_ocp_write( tp, 0xF8DA, 0xBD00 ); - rtl8168_mac_ocp_write( tp, 0xF8DC, 0x0132 ); - - rtl8168_mac_ocp_write( tp, 0xFC26, 0x8000 ); - - rtl8168_mac_ocp_write( tp, 0xFC2A, 0x0743 ); - rtl8168_mac_ocp_write( tp, 0xFC2C, 0x0801 ); - rtl8168_mac_ocp_write( tp, 0xFC2E, 0x0BE9 ); - rtl8168_mac_ocp_write( tp, 0xFC30, 0x02FD ); - rtl8168_mac_ocp_write( tp, 0xFC32, 0x0C25 ); - rtl8168_mac_ocp_write( tp, 0xFC34, 0x00A9 ); - rtl8168_mac_ocp_write( tp, 0xFC36, 0x012D ); + rtl8168_mac_ocp_write(tp, 0xF800, 0xE008); + rtl8168_mac_ocp_write(tp, 0xF802, 0xE00A); + rtl8168_mac_ocp_write(tp, 0xF804, 0xE00C); + rtl8168_mac_ocp_write(tp, 0xF806, 0xE00E); + rtl8168_mac_ocp_write(tp, 0xF808, 0xE027); + rtl8168_mac_ocp_write(tp, 0xF80A, 0xE04F); + rtl8168_mac_ocp_write(tp, 0xF80C, 0xE05E); + rtl8168_mac_ocp_write(tp, 0xF80E, 0xE065); + rtl8168_mac_ocp_write(tp, 0xF810, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF812, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF814, 0x0000); + rtl8168_mac_ocp_write(tp, 0xF816, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF818, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF81A, 0x074C); + rtl8168_mac_ocp_write(tp, 0xF81C, 0xC302); + rtl8168_mac_ocp_write(tp, 0xF81E, 0xBB00); + rtl8168_mac_ocp_write(tp, 0xF820, 0x080A); + rtl8168_mac_ocp_write(tp, 0xF822, 0x6420); + rtl8168_mac_ocp_write(tp, 0xF824, 0x48C2); + rtl8168_mac_ocp_write(tp, 0xF826, 0x8C20); + rtl8168_mac_ocp_write(tp, 0xF828, 0xC516); + rtl8168_mac_ocp_write(tp, 0xF82A, 0x64A4); + rtl8168_mac_ocp_write(tp, 0xF82C, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF82E, 0xF009); + rtl8168_mac_ocp_write(tp, 0xF830, 0x74A2); + rtl8168_mac_ocp_write(tp, 0xF832, 0x8CA5); + rtl8168_mac_ocp_write(tp, 0xF834, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF836, 0xC50E); + rtl8168_mac_ocp_write(tp, 0xF838, 0x9CA2); + rtl8168_mac_ocp_write(tp, 0xF83A, 0x1C11); + rtl8168_mac_ocp_write(tp, 0xF83C, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF83E, 0xE006); + rtl8168_mac_ocp_write(tp, 0xF840, 0x74F8); + rtl8168_mac_ocp_write(tp, 0xF842, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF844, 0x8CF8); + rtl8168_mac_ocp_write(tp, 0xF846, 0xC404); + rtl8168_mac_ocp_write(tp, 0xF848, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF84A, 0xC403); + rtl8168_mac_ocp_write(tp, 0xF84C, 0xBC00); + rtl8168_mac_ocp_write(tp, 0xF84E, 0x0BF2); + rtl8168_mac_ocp_write(tp, 0xF850, 0x0C0A); + rtl8168_mac_ocp_write(tp, 0xF852, 0xE434); + rtl8168_mac_ocp_write(tp, 0xF854, 0xD3C0); + rtl8168_mac_ocp_write(tp, 0xF856, 0x49D9); + rtl8168_mac_ocp_write(tp, 0xF858, 0xF01F); + rtl8168_mac_ocp_write(tp, 0xF85A, 0xC526); + rtl8168_mac_ocp_write(tp, 0xF85C, 0x64A5); + rtl8168_mac_ocp_write(tp, 0xF85E, 0x1400); + rtl8168_mac_ocp_write(tp, 0xF860, 0xF007); + rtl8168_mac_ocp_write(tp, 0xF862, 0x0C01); + rtl8168_mac_ocp_write(tp, 0xF864, 0x8CA5); + rtl8168_mac_ocp_write(tp, 0xF866, 0x1C15); + rtl8168_mac_ocp_write(tp, 0xF868, 0xC51B); + rtl8168_mac_ocp_write(tp, 0xF86A, 0x9CA0); + rtl8168_mac_ocp_write(tp, 0xF86C, 0xE013); + rtl8168_mac_ocp_write(tp, 0xF86E, 0xC519); + rtl8168_mac_ocp_write(tp, 0xF870, 0x74A0); + rtl8168_mac_ocp_write(tp, 0xF872, 0x48C4); + rtl8168_mac_ocp_write(tp, 0xF874, 0x8CA0); + rtl8168_mac_ocp_write(tp, 0xF876, 0xC516); + rtl8168_mac_ocp_write(tp, 0xF878, 0x74A4); + rtl8168_mac_ocp_write(tp, 0xF87A, 0x48C8); + rtl8168_mac_ocp_write(tp, 0xF87C, 0x48CA); + rtl8168_mac_ocp_write(tp, 0xF87E, 0x9CA4); + rtl8168_mac_ocp_write(tp, 0xF880, 0xC512); + rtl8168_mac_ocp_write(tp, 0xF882, 0x1B00); + rtl8168_mac_ocp_write(tp, 0xF884, 0x9BA0); + rtl8168_mac_ocp_write(tp, 0xF886, 0x1B1C); + rtl8168_mac_ocp_write(tp, 0xF888, 0x483F); + rtl8168_mac_ocp_write(tp, 0xF88A, 0x9BA2); + rtl8168_mac_ocp_write(tp, 0xF88C, 0x1B04); + rtl8168_mac_ocp_write(tp, 0xF88E, 0xC508); + rtl8168_mac_ocp_write(tp, 0xF890, 0x9BA0); + rtl8168_mac_ocp_write(tp, 0xF892, 0xC505); + rtl8168_mac_ocp_write(tp, 0xF894, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF896, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF898, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF89A, 0x0300); + rtl8168_mac_ocp_write(tp, 0xF89C, 0x051E); + rtl8168_mac_ocp_write(tp, 0xF89E, 0xE434); + rtl8168_mac_ocp_write(tp, 0xF8A0, 0xE018); + rtl8168_mac_ocp_write(tp, 0xF8A2, 0xE092); + rtl8168_mac_ocp_write(tp, 0xF8A4, 0xDE20); + rtl8168_mac_ocp_write(tp, 0xF8A6, 0xD3C0); + rtl8168_mac_ocp_write(tp, 0xF8A8, 0xC50F); + rtl8168_mac_ocp_write(tp, 0xF8AA, 0x76A4); + rtl8168_mac_ocp_write(tp, 0xF8AC, 0x49E3); + rtl8168_mac_ocp_write(tp, 0xF8AE, 0xF007); + rtl8168_mac_ocp_write(tp, 0xF8B0, 0x49C0); + rtl8168_mac_ocp_write(tp, 0xF8B2, 0xF103); + rtl8168_mac_ocp_write(tp, 0xF8B4, 0xC607); + rtl8168_mac_ocp_write(tp, 0xF8B6, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF8B8, 0xC606); + rtl8168_mac_ocp_write(tp, 0xF8BA, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF8BC, 0xC602); + rtl8168_mac_ocp_write(tp, 0xF8BE, 0xBE00); + rtl8168_mac_ocp_write(tp, 0xF8C0, 0x0C4C); + rtl8168_mac_ocp_write(tp, 0xF8C2, 0x0C28); + rtl8168_mac_ocp_write(tp, 0xF8C4, 0x0C2C); + rtl8168_mac_ocp_write(tp, 0xF8C6, 0xDC00); + rtl8168_mac_ocp_write(tp, 0xF8C8, 0xC707); + rtl8168_mac_ocp_write(tp, 0xF8CA, 0x1D00); + rtl8168_mac_ocp_write(tp, 0xF8CC, 0x8DE2); + rtl8168_mac_ocp_write(tp, 0xF8CE, 0x48C1); + rtl8168_mac_ocp_write(tp, 0xF8D0, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF8D2, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF8D4, 0x00AA); + rtl8168_mac_ocp_write(tp, 0xF8D6, 0xE0C0); + rtl8168_mac_ocp_write(tp, 0xF8D8, 0xC502); + rtl8168_mac_ocp_write(tp, 0xF8DA, 0xBD00); + rtl8168_mac_ocp_write(tp, 0xF8DC, 0x0132); + + rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); + + rtl8168_mac_ocp_write(tp, 0xFC2A, 0x0743); + rtl8168_mac_ocp_write(tp, 0xFC2C, 0x0801); + rtl8168_mac_ocp_write(tp, 0xFC2E, 0x0BE9); + rtl8168_mac_ocp_write(tp, 0xFC30, 0x02FD); + rtl8168_mac_ocp_write(tp, 0xFC32, 0x0C25); + rtl8168_mac_ocp_write(tp, 0xFC34, 0x00A9); + rtl8168_mac_ocp_write(tp, 0xFC36, 0x012D); } static void @@ -9838,9 +9985,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168ep_1); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168ep_1); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168ep_1i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -9881,9 +10027,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168ep_2); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168ep_2); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168ep_2i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -9924,9 +10069,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168h_1); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168h_1); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168h_1i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10008,9 +10152,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168h_3); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168h_3); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168h_3i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10074,9 +10217,8 @@ 0x4830, 0x4837, 0xC502, 0xBD00, 0x0A86 }; - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_1_1); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_1_1); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168fp_1_1i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10135,9 +10277,8 @@ 0x0000 }; - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_1_2); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_1_2); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168fp_1_2i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10176,9 +10317,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_8116as_2); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_8116as_2); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168fp_8116as_2i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10212,9 +10352,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_2); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_2); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168fp_2i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10263,9 +10402,8 @@ rtl8168_hw_disable_mac_mcu_bps(dev); - for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_3); i++) { + for (i = 0; i < ARRAY_SIZE(mcu_patch_code_8168fp_3); i++) rtl8168_mac_ocp_write(tp, 0xF800 + i * 2, mcu_patch_code_8168fp_3i); - } rtl8168_mac_ocp_write(tp, 0xFC26, 0x8000); @@ -10342,7 +10480,7 @@ } } -void rtl8168_apply_firmware(struct rtl8168_private *tp) +static void rtl8168_apply_firmware(struct rtl8168_private *tp) { /* TODO: release firmware if rtl_fw_write_firmware signals failure. */ if (tp->rtl_fw) { @@ -10378,7 +10516,7 @@ //Disable UPS if (HW_SUPPORT_UPS_MODE(tp)) - rtl8168_mac_ocp_write(tp, 0xD400, rtl8168_mac_ocp_read( tp, 0xD400) & ~(BIT_0)); + rtl8168_mac_ocp_write(tp, 0xD400, rtl8168_mac_ocp_read(tp, 0xD400) & ~(BIT_0)); //Disable DMA Aggregation switch (tp->mcfg) { @@ -10391,9 +10529,9 @@ case CFG_METHOD_35: case CFG_METHOD_36: case CFG_METHOD_37: - rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read( tp, 0xE63E) & ~(BIT_3 | BIT_2 | BIT_1)); - rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read( tp, 0xE63E) | (BIT_0)); - rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read( tp, 0xE63E) & ~(BIT_0)); + rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read(tp, 0xE63E) & ~(BIT_3 | BIT_2 | BIT_1)); + rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read(tp, 0xE63E) | (BIT_0)); + rtl8168_mac_ocp_write(tp, 0xE63E, rtl8168_mac_ocp_read(tp, 0xE63E) & ~(BIT_0)); rtl8168_mac_ocp_write(tp, 0xC094, 0x0); rtl8168_mac_ocp_write(tp, 0xC09E, 0x0); break; @@ -10447,7 +10585,7 @@ case CFG_METHOD_23: case CFG_METHOD_24: csi_tmp = rtl8168_eri_read(tp, 0x1AB, 1, ERIAR_ExGMAC); - csi_tmp |= ( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); + csi_tmp |= (BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); rtl8168_eri_write(tp, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); break; } @@ -10501,8 +10639,7 @@ ClearAndSetPCIePhyBit(tp, 0x03, BIT_10, - BIT_5 - ); + BIT_5); break; case CFG_METHOD_9: @@ -10513,14 +10650,12 @@ ClearAndSetPCIePhyBit(tp, 0x03, 0xFFB0, - 0x05B0 - ); + 0x05B0); } else { ClearAndSetPCIePhyBit(tp, 0x03, 0xFFF0, - 0x05F0 - ); + 0x05F0); } rtl8168_ephy_write(tp, 0x06, 0xB271); rtl8168_ephy_write(tp, 0x07, 0xCE00); @@ -10533,8 +10668,7 @@ ClearAndSetPCIePhyBit(tp, 0x03, 0xFFF0, - 0x01B0 - ); + 0x01B0); rtl8168_ephy_write(tp, 0x1A, 0x0546); rtl8168_ephy_write(tp, 0x1C, 0x80C4); rtl8168_ephy_write(tp, 0x1D, 0x78E5); @@ -10733,11 +10867,10 @@ break; case CFG_METHOD_26: ClearPCIePhyBit(tp, 0x00, BIT_3); - ClearAndSetPCIePhyBit( tp, - 0x0C, - (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4), - (BIT_5 | BIT_11) - ); + ClearAndSetPCIePhyBit(tp, + 0x0C, + (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4), + (BIT_5 | BIT_11)); SetPCIePhyBit(tp, 0x1E, BIT_0); ClearPCIePhyBit(tp, 0x19, BIT_15); @@ -10781,8 +10914,7 @@ ClearAndSetPCIePhyBit(tp, 0x0C, BIT_13 | BIT_12 | BIT_11 | BIT_10 | BIT_8 | BIT_7 | BIT_6 | BIT_5, - BIT_9 | BIT_4 - ); + BIT_9 | BIT_4); break; case CFG_METHOD_29: @@ -10807,13 +10939,11 @@ ClearAndSetPCIePhyBit(tp, 0x19, BIT_6, - (BIT_12| BIT_8) - ); + (BIT_12| BIT_8)); ClearAndSetPCIePhyBit(tp, 0x59, BIT_6, - (BIT_12| BIT_8) - ); + (BIT_12| BIT_8)); ClearPCIePhyBit(tp, 0x0C, BIT_4); ClearPCIePhyBit(tp, 0x4C, BIT_4); @@ -11001,7 +11131,7 @@ tp->hw_ram_code_ver = rtl8168_get_hw_phy_mcu_code_ver(tp); - if ( tp->hw_ram_code_ver == tp->sw_ram_code_ver) { + if (tp->hw_ram_code_ver == tp->sw_ram_code_ver) { ram_code_ver_match = 1; tp->HwHasWrRamCodeToMicroP = TRUE; } @@ -24904,8 +25034,7 @@ ClearAndSetEthPhyBit(tp, 0x11, BIT_13, - BIT_14 - ); + BIT_14); rtl8168_mdio_write(tp, 0x1F, 0x0000); if (aspm) { @@ -25089,124 +25218,110 @@ } else if (tp->mcfg == CFG_METHOD_29) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x809b); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xF800 , - 0x8000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xF800 , + 0x8000); rtl8168_mdio_write(tp, 0x13, 0x80A2); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x8000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x8000); rtl8168_mdio_write(tp, 0x13, 0x80A4); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x8500 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x8500); rtl8168_mdio_write(tp, 0x13, 0x809C); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0xbd00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0xbd00); rtl8168_mdio_write(tp, 0x1F, 0x0000); rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x80AD); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xF800 , - 0x7000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xF800 , + 0x7000); rtl8168_mdio_write(tp, 0x13, 0x80B4); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x5000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x5000); rtl8168_mdio_write(tp, 0x13, 0x80AC); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x4000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x4000); rtl8168_mdio_write(tp, 0x1F, 0x0000); rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x808E); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x1200 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x1200); rtl8168_mdio_write(tp, 0x13, 0x8090); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0xE500 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0xE500); rtl8168_mdio_write(tp, 0x13, 0x8092); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x9F00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x9F00); rtl8168_mdio_write(tp, 0x1F, 0x0000); if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { u16 dout_tapbin; dout_tapbin = 0x0000; - rtl8168_mdio_write( tp, 0x1F, 0x0A46 ); - gphy_val = rtl8168_mdio_read( tp, 0x13 ); + rtl8168_mdio_write(tp, 0x1F, 0x0A46); + gphy_val = rtl8168_mdio_read(tp, 0x13); gphy_val &= (BIT_1|BIT_0); gphy_val <<= 2; dout_tapbin |= gphy_val; - gphy_val = rtl8168_mdio_read( tp, 0x12 ); + gphy_val = rtl8168_mdio_read(tp, 0x12); gphy_val &= (BIT_15|BIT_14); gphy_val >>= 14; dout_tapbin |= gphy_val; - dout_tapbin = ~( dout_tapbin^BIT_3 ); + dout_tapbin = ~(dout_tapbin^BIT_3); dout_tapbin <<= 12; dout_tapbin &= 0xF000; - rtl8168_mdio_write( tp, 0x1F, 0x0A43 ); + rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_mdio_write( tp, 0x13, 0x827A ); - ClearAndSetEthPhyBit( tp, - 0x14, - BIT_15|BIT_14|BIT_13|BIT_12, - dout_tapbin - ); - - - rtl8168_mdio_write( tp, 0x13, 0x827B ); - ClearAndSetEthPhyBit( tp, - 0x14, - BIT_15|BIT_14|BIT_13|BIT_12, - dout_tapbin - ); - - - rtl8168_mdio_write( tp, 0x13, 0x827C ); - ClearAndSetEthPhyBit( tp, - 0x14, - BIT_15|BIT_14|BIT_13|BIT_12, - dout_tapbin - ); - - - rtl8168_mdio_write( tp, 0x13, 0x827D ); - ClearAndSetEthPhyBit( tp, - 0x14, - BIT_15|BIT_14|BIT_13|BIT_12, - dout_tapbin - ); + rtl8168_mdio_write(tp, 0x13, 0x827A); + ClearAndSetEthPhyBit(tp, + 0x14, + BIT_15|BIT_14|BIT_13|BIT_12, + dout_tapbin); + + + rtl8168_mdio_write(tp, 0x13, 0x827B); + ClearAndSetEthPhyBit(tp, + 0x14, + BIT_15|BIT_14|BIT_13|BIT_12, + dout_tapbin); + + + rtl8168_mdio_write(tp, 0x13, 0x827C); + ClearAndSetEthPhyBit(tp, + 0x14, + BIT_15|BIT_14|BIT_13|BIT_12, + dout_tapbin); + + + rtl8168_mdio_write(tp, 0x13, 0x827D); + ClearAndSetEthPhyBit(tp, + 0x14, + BIT_15|BIT_14|BIT_13|BIT_12, + dout_tapbin); rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x8011); @@ -25216,49 +25331,48 @@ } rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit( tp, 0x11, BIT_11 ); + rtl8168_set_eth_phy_bit(tp, 0x11, BIT_11); rtl8168_mdio_write(tp, 0x1F, 0x0000); rtl8168_mdio_write(tp, 0x1F, 0x0BCA); - ClearAndSetEthPhyBit( tp, - 0x17, - (BIT_13 | BIT_12) , - BIT_14 - ); + ClearAndSetEthPhyBit(tp, + 0x17, + (BIT_13 | BIT_12) , + BIT_14); rtl8168_mdio_write(tp, 0x1F, 0x0000); rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x803F); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); rtl8168_mdio_write(tp, 0x13, 0x8047); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); rtl8168_mdio_write(tp, 0x13, 0x804F); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); rtl8168_mdio_write(tp, 0x13, 0x8057); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); rtl8168_mdio_write(tp, 0x13, 0x805F); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); - rtl8168_mdio_write(tp, 0x13, 0x8067 ); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); - rtl8168_mdio_write(tp, 0x13, 0x806F ); - rtl8168_clear_eth_phy_bit( tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_mdio_write(tp, 0x13, 0x8067); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); + rtl8168_mdio_write(tp, 0x13, 0x806F); + rtl8168_clear_eth_phy_bit(tp, 0x14, (BIT_13 | BIT_12)); rtl8168_mdio_write(tp, 0x1F, 0x0000); if (aspm) { if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 ); + rtl8168_set_eth_phy_bit(tp, 0x10, BIT_2); rtl8168_mdio_write(tp, 0x1F, 0x0000); } } } else if (tp->mcfg == CFG_METHOD_30 || tp->mcfg == CFG_METHOD_37) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x808A); - ClearAndSetEthPhyBit( tp, - 0x14, - BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0, - 0x0A ); + ClearAndSetEthPhyBit(tp, + 0x14, + BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0, + 0x0A); if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); @@ -25269,7 +25383,7 @@ } rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit( tp, 0x11, BIT_11 ); + rtl8168_set_eth_phy_bit(tp, 0x11, BIT_11); rtl8168_mdio_write(tp, 0x1F, 0x0000); if (tp->RequireAdcBiasPatch) { @@ -25282,10 +25396,10 @@ u16 rlen; rtl8168_mdio_write(tp, 0x1F, 0x0BCD); - gphy_val = rtl8168_mdio_read( tp, 0x16 ); + gphy_val = rtl8168_mdio_read(tp, 0x16); gphy_val &= 0x000F; - if ( gphy_val > 3 ) { + if (gphy_val > 3) { rlen = gphy_val - 3; } else { rlen = 0; @@ -25334,7 +25448,7 @@ if (aspm) { if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 ); + rtl8168_set_eth_phy_bit(tp, 0x10, BIT_2); rtl8168_mdio_write(tp, 0x1F, 0x0000); } } @@ -25342,133 +25456,112 @@ tp->mcfg == CFG_METHOD_33 || tp->mcfg == CFG_METHOD_34) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); rtl8168_mdio_write(tp, 0x13, 0x808E); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x4800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x4800); rtl8168_mdio_write(tp, 0x13, 0x8090); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0xCC00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0xCC00); rtl8168_mdio_write(tp, 0x13, 0x8092); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0xB000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0xB000); rtl8168_mdio_write(tp, 0x13, 0x8088); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x6000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x6000); rtl8168_mdio_write(tp, 0x13, 0x808B); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x3F00 , - 0x0B00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x3F00 , + 0x0B00); rtl8168_mdio_write(tp, 0x13, 0x808D); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x1F00 , - 0x0600 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x1F00 , + 0x0600); rtl8168_mdio_write(tp, 0x13, 0x808C); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0xB000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0xB000); rtl8168_mdio_write(tp, 0x13, 0x80A0); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x2800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x2800); rtl8168_mdio_write(tp, 0x13, 0x80A2); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x5000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x5000); rtl8168_mdio_write(tp, 0x13, 0x809B); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xF800 , - 0xB000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xF800 , + 0xB000); rtl8168_mdio_write(tp, 0x13, 0x809A); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x4B00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x4B00); rtl8168_mdio_write(tp, 0x13, 0x809D); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x3F00 , - 0x0800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x3F00 , + 0x0800); rtl8168_mdio_write(tp, 0x13, 0x80A1); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x7000 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x7000); rtl8168_mdio_write(tp, 0x13, 0x809F); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x1F00 , - 0x0300 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x1F00 , + 0x0300); rtl8168_mdio_write(tp, 0x13, 0x809E); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x8800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x8800); rtl8168_mdio_write(tp, 0x13, 0x80B2); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x2200 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x2200); rtl8168_mdio_write(tp, 0x13, 0x80AD); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xF800 , - 0x9800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xF800 , + 0x9800); rtl8168_mdio_write(tp, 0x13, 0x80AF); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x3F00 , - 0x0800 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x3F00 , + 0x0800); rtl8168_mdio_write(tp, 0x13, 0x80B3); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x6F00 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x6F00); rtl8168_mdio_write(tp, 0x13, 0x80B1); - ClearAndSetEthPhyBit( tp, - 0x14, - 0x1F00 , - 0x0300 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0x1F00 , + 0x0300); rtl8168_mdio_write(tp, 0x13, 0x80B0); - ClearAndSetEthPhyBit( tp, - 0x14, - 0xFF00 , - 0x9300 - ); + ClearAndSetEthPhyBit(tp, + 0x14, + 0xFF00 , + 0x9300); rtl8168_mdio_write(tp, 0x1F, 0x0000); rtl8168_mdio_write(tp, 0x1F, 0x0A43); @@ -25489,7 +25582,7 @@ if (!HW_SUPP_SERDES_PHY(tp) && HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 ); + rtl8168_set_eth_phy_bit(tp, 0x10, BIT_2); rtl8168_mdio_write(tp, 0x1F, 0x0000); } } @@ -25612,7 +25705,7 @@ if (aspm) { if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 ); + rtl8168_set_eth_phy_bit(tp, 0x10, BIT_2); rtl8168_mdio_write(tp, 0x1F, 0x0000); } } @@ -25630,7 +25723,7 @@ if (aspm) { if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) { rtl8168_mdio_write(tp, 0x1F, 0x0A43); - rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 ); + rtl8168_set_eth_phy_bit(tp, 0x10, BIT_2); rtl8168_mdio_write(tp, 0x1F, 0x0000); } } @@ -25662,7 +25755,7 @@ tp->mcfg == CFG_METHOD_35 || tp->mcfg == CFG_METHOD_36) { //enable EthPhyPPSW rtl8168_mdio_write(tp, 0x1F, 0x0A44); - rtl8168_set_eth_phy_bit( tp, 0x11, BIT_7 ); + rtl8168_set_eth_phy_bit(tp, 0x11, BIT_7); rtl8168_mdio_write(tp, 0x1F, 0x0000); } @@ -26095,11 +26188,11 @@ #ifdef ENABLE_DASH_SUPPORT if (tp->DASH) { if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - tp->timer_intr_mask |= ( ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET); - tp->intr_mask |= ( ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET); + tp->timer_intr_mask |= (ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET); + tp->intr_mask |= (ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET); } else { - tp->timer_intr_mask |= ( ISRIMR_DP_DASH_OK | ISRIMR_DP_HOST_OK | ISRIMR_DP_REQSYS_OK ); - tp->intr_mask |= ( ISRIMR_DP_DASH_OK | ISRIMR_DP_HOST_OK | ISRIMR_DP_REQSYS_OK ); + tp->timer_intr_mask |= (ISRIMR_DP_DASH_OK | ISRIMR_DP_HOST_OK | ISRIMR_DP_REQSYS_OK); + tp->intr_mask |= (ISRIMR_DP_DASH_OK | ISRIMR_DP_HOST_OK | ISRIMR_DP_REQSYS_OK); } } #endif @@ -26215,18 +26308,18 @@ u16 ioffset_p3, ioffset_p2, ioffset_p1, ioffset_p0; u16 TmpUshort; - rtl8168_mac_ocp_write( tp, 0xDD02, 0x807D); - TmpUshort = rtl8168_mac_ocp_read( tp, 0xDD02 ); - ioffset_p3 = ( (TmpUshort & BIT_7) >>7 ); + rtl8168_mac_ocp_write(tp, 0xDD02, 0x807D); + TmpUshort = rtl8168_mac_ocp_read(tp, 0xDD02); + ioffset_p3 = ((TmpUshort & BIT_7) >>7); ioffset_p3 <<= 3; - TmpUshort = rtl8168_mac_ocp_read( tp, 0xDD00 ); + TmpUshort = rtl8168_mac_ocp_read(tp, 0xDD00); ioffset_p3 |= ((TmpUshort & (BIT_15 | BIT_14 | BIT_13))>>13); ioffset_p2 = ((TmpUshort & (BIT_12|BIT_11|BIT_10|BIT_9))>>9); ioffset_p1 = ((TmpUshort & (BIT_8|BIT_7|BIT_6|BIT_5))>>5); - ioffset_p0 = ( (TmpUshort & BIT_4) >>4 ); + ioffset_p0 = ((TmpUshort & BIT_4) >>4); ioffset_p0 <<= 3; ioffset_p0 |= (TmpUshort & (BIT_2| BIT_1 | BIT_0)); @@ -27661,7 +27754,7 @@ case CFG_METHOD_23: case CFG_METHOD_24: csi_tmp = rtl8168_eri_read(tp, 0x1AB, 1, ERIAR_ExGMAC); - csi_tmp &= ~( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); + csi_tmp &= ~(BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); rtl8168_eri_write(tp, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); break; } @@ -28084,7 +28177,8 @@ } */ -int rtl8168_enable_msix(struct rtl8168_private *tp) +#ifndef ENABLE_RSS_SUPPORT +static int rtl8168_enable_msix(struct rtl8168_private *tp) { int i, nvecs = 0; struct msix_entry msix_entR8168_MAX_MSIX_VEC; @@ -28111,6 +28205,7 @@ out: return nvecs; } +#endif /* !ENABLE_RSS_SUPPORT */ /* Cfg9346_Unlock assumed. */ static int rtl8168_try_msi(struct rtl8168_private *tp) @@ -28534,6 +28629,8 @@ netif_carrier_off(dev); + rtl8168_sysfs_init(dev); + printk("%s", GPL_CLAIM); out: @@ -28576,6 +28673,10 @@ if (HW_DASH_SUPPORT_DASH(tp)) rtl8168_driver_stop(tp); +#ifdef ENABLE_R8168_SYSFS + rtl8168_sysfs_remove(dev); +#endif //ENABLE_R8168_SYSFS + unregister_netdev(dev); rtl8168_disable_msi(pdev, tp); #ifdef ENABLE_R8168_PROCFS @@ -28894,31 +28995,25 @@ { struct rtl8168_private *tp = netdev_priv(dev); + if (!(tp->mcfg == CFG_METHOD_5) || (tp->mcfg == CFG_METHOD_6)) + return; + switch (dev_state) { case DSM_MAC_INIT: - if ((tp->mcfg == CFG_METHOD_5) || (tp->mcfg == CFG_METHOD_6)) { - if (RTL_R8(tp, MACDBG) & 0x80) - RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) | GPIO_en); - else - RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) & ~GPIO_en); - } - + if (RTL_R8(tp, MACDBG) & 0x80) + RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) | GPIO_en); + else + RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) & ~GPIO_en); break; case DSM_NIC_GOTO_D3: case DSM_IF_DOWN: - if ((tp->mcfg == CFG_METHOD_5) || (tp->mcfg == CFG_METHOD_6)) { - if (RTL_R8(tp, MACDBG) & 0x80) - RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) & ~GPIO_en); - } + if (RTL_R8(tp, MACDBG) & 0x80) + RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) & ~GPIO_en); break; - case DSM_NIC_RESUME_D3: case DSM_IF_UP: - if ((tp->mcfg == CFG_METHOD_5) || (tp->mcfg == CFG_METHOD_6)) { - if (RTL_R8(tp, MACDBG) & 0x80) - RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) | GPIO_en); - } - + if (RTL_R8(tp, MACDBG) & 0x80) + RTL_W8(tp, GPIO, RTL_R8(tp, GPIO) | GPIO_en); break; } } @@ -28984,9 +29079,8 @@ AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptAllPhys; mc_filter1 = mc_filter0 = 0xffffffff; - } else if ((netdev_mc_count(dev) > multicast_filter_limit) - || (dev->flags & IFF_ALLMULTI)) { - /* Too many to filter perfectly -- accept all multicasts. */ + } else if (dev->flags & IFF_ALLMULTI) { + /* accept all multicasts. */ rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; mc_filter1 = mc_filter0 = 0xffffffff; } else { @@ -30523,9 +30617,18 @@ #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) } +void rtl8168_schedule_dash_work(struct rtl8168_private *tp) +{ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + set_bit(R8168_FLAG_TASK_DASH_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->dash_task, RTL8168_DASH_TIMEOUT); +#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) +} + #define rtl8168_cancel_schedule_reset_work(a) #define rtl8168_cancel_schedule_esd_work(a) #define rtl8168_cancel_schedule_linkchg_work(a) +#define rtl8168_cancel_schedule_dash_work(a) #else static void rtl8168_schedule_reset_work(struct rtl8168_private *tp) @@ -30538,7 +30641,8 @@ { struct work_struct *work = &tp->reset_task.work; - if (!work->func) return; + if (!work->func) + return; cancel_delayed_work_sync(&tp->reset_task); } @@ -30553,7 +30657,8 @@ { struct work_struct *work = &tp->esd_task.work; - if (!work->func) return; + if (!work->func) + return; cancel_delayed_work_sync(&tp->esd_task); } @@ -30568,10 +30673,27 @@ { struct work_struct *work = &tp->linkchg_task.work; - if (!work->func) return; + if (!work->func) + return; cancel_delayed_work_sync(&tp->linkchg_task); } + +void rtl8168_schedule_dash_work(struct rtl8168_private *tp) +{ + set_bit(R8168_FLAG_TASK_DASH_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->dash_task, RTL8168_DASH_TIMEOUT); +} + +static void rtl8168_cancel_schedule_dash_work(struct rtl8168_private *tp) +{ + struct work_struct *work = &tp->dash_task.work; + + if (!work->func) + return; + + cancel_delayed_work_sync(&tp->dash_task); +} #endif static void rtl8168_init_all_schedule_work(struct rtl8168_private *tp) @@ -30580,10 +30702,12 @@ INIT_WORK(&tp->reset_task, rtl8168_reset_task, dev); INIT_WORK(&tp->esd_task, rtl8168_esd_task, dev); INIT_WORK(&tp->linkchg_task, rtl8168_linkchg_task, dev); + INIT_WORK(&tp->dash_task, rtl8168_dash_task, dev); #else INIT_DELAYED_WORK(&tp->reset_task, rtl8168_reset_task); INIT_DELAYED_WORK(&tp->esd_task, rtl8168_esd_task); INIT_DELAYED_WORK(&tp->linkchg_task, rtl8168_linkchg_task); + INIT_DELAYED_WORK(&tp->dash_task, rtl8168_dash_task); #endif } @@ -30592,6 +30716,7 @@ rtl8168_cancel_schedule_reset_work(tp); rtl8168_cancel_schedule_esd_work(tp); rtl8168_cancel_schedule_linkchg_work(tp); + rtl8168_cancel_schedule_dash_work(tp); } static void @@ -30640,14 +30765,6 @@ #endif //CONFIG_R8168_NAPI } -static int rtl8168_rx_nostuck(struct rtl8168_private *tp) -{ - int i, ret = 1; - for (i = 0; i < tp->num_rx_rings; i++) - ret &= (tp->rx_ringi.dirty_rx == tp->rx_ringi.cur_rx); - return ret; -} - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void rtl8168_reset_task(void *_data) { @@ -30660,7 +30777,6 @@ container_of(work, struct rtl8168_private, reset_task.work); struct net_device *dev = tp->dev; #endif - u32 budget = ~(u32)0; int i; rtnl_lock(); @@ -30670,37 +30786,26 @@ !test_and_clear_bit(R8168_FLAG_TASK_RESET_PENDING, tp->task_flags)) goto out_unlock; - rtl8168_wait_for_quiescence(dev); - - for (i = 0; i < tp->num_rx_rings; i++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) - rtl8168_rx_interrupt(dev, tp, &tp->rx_ringi, &budget); -#else - rtl8168_rx_interrupt(dev, tp, &tp->rx_ringi, budget); -#endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) - } + netdev_err(dev, "Device reseting!\n"); netif_carrier_off(dev); netif_tx_disable(dev); + _rtl8168_wait_for_quiescence(dev); rtl8168_hw_reset(dev); rtl8168_tx_clear(tp); - if (rtl8168_rx_nostuck(tp)) { - rtl8168_rx_clear(tp); - rtl8168_init_ring(dev); - rtl8168_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); - } else { - if (unlikely(net_ratelimit())) { - struct rtl8168_private *tp = netdev_priv(dev); + rtl8168_init_ring_indexes(tp); - if (netif_msg_intr(tp)) { - printk(PFX KERN_EMERG - "%s: Rx buffers shortage\n", dev->name); - } - } - rtl8168_schedule_reset_work(tp); - } + rtl8168_tx_desc_init(tp); + for (i = 0; i < tp->num_rx_desc; i++) + rtl8168_mark_to_asic(tp->RxDescArray + i, tp->rx_buf_sz); + +#ifdef CONFIG_R8168_NAPI + rtl8168_enable_napi(tp); +#endif //CONFIG_R8168_NAPI + + rtl8168_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); out_unlock: rtnl_unlock(); @@ -30760,6 +30865,33 @@ rtnl_unlock(); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +static void rtl8168_dash_task(void *_data) +{ + struct net_device *dev = _data; + //struct rtl8168_private *tp = netdev_priv(dev); +#else +static void rtl8168_dash_task(struct work_struct *work) +{ + struct rtl8168_private *tp = + container_of(work, struct rtl8168_private, dash_task.work); + struct net_device *dev = tp->dev; +#endif + rtnl_lock(); + + if (!netif_running(dev) || + test_bit(R8168_FLAG_DOWN, tp->task_flags) || + !test_and_clear_bit(R8168_FLAG_TASK_DASH_CHECK_PENDING, tp->task_flags)) + goto out_unlock; + +#ifdef ENABLE_DASH_SUPPORT + HandleDashInterrupt(dev); +#endif + +out_unlock: + rtnl_unlock(); +} + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue) @@ -30770,6 +30902,8 @@ { struct rtl8168_private *tp = netdev_priv(dev); + netdev_err(dev, "Transmit timeout reset Device!\n"); + /* Let's wait a bit while any (async) irq lands on */ rtl8168_schedule_reset_work(tp); } @@ -30827,10 +30961,8 @@ /* anti gcc 2.95.3 bugware (sic) */ status = rtl8168_get_txd_opts1(ring, opts0, len, entry); - if (cur_frag == (nr_frags - 1)) { - ring->tx_skbentry.skb = skb; + if (cur_frag == (nr_frags - 1)) status |= LastFrag; - } txd->addr = cpu_to_le64(mapping); @@ -30967,45 +31099,6 @@ } #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) -/* r8169_csum_workaround() - * The hw limits the value the transport offset. When the offset is out of the - * range, calculate the checksum by sw. - */ -static void r8168_csum_workaround(struct rtl8168_private *tp, - struct sk_buff *skb) -{ - if (skb_shinfo(skb)->gso_size) { - netdev_features_t features = tp->dev->features; - struct sk_buff *segs, *nskb; - - features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6); - segs = skb_gso_segment(skb, features); - if (IS_ERR(segs) || !segs) - goto drop; - - do { - nskb = segs; - segs = segs->next; - nskb->next = NULL; - rtl8168_start_xmit(nskb, tp->dev); - } while (segs); - - dev_consume_skb_any(skb); - } else if (skb->ip_summed == CHECKSUM_PARTIAL) { - if (skb_checksum_help(skb) < 0) - goto drop; - - rtl8168_start_xmit(skb, tp->dev); - } else { - struct net_device_stats *stats; - -drop: - stats = &tp->dev->stats; - stats->tx_dropped++; - dev_kfree_skb_any(skb); - } -} - /* msdn_giant_send_check() * According to the document of microsoft, the TCP Pseudo Header excludes the * packet length for IPv6 TCP large packets. @@ -31045,6 +31138,10 @@ struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); + unsigned int bytecount; + unsigned short gso_segs; + struct ring_info *last; + unsigned int last_entry; unsigned int entry; struct TxDesc *txd; dma_addr_t mapping; @@ -31082,6 +31179,9 @@ goto err_stop; } + bytecount = skb->len; + gso_segs = 1; + opts0 = DescOwn; opts1 = rtl8168_tx_vlan_tag(tp, skb); @@ -31096,6 +31196,23 @@ /* TCP Segmentation Offload (or TCP Large Send) */ if (mss) { + union { + struct iphdr *v4; + struct ipv6hdr *v6; + unsigned char *hdr; + } ip; + union { + struct tcphdr *tcp; + struct udphdr *udp; + unsigned char *hdr; + } l4; + u32 l4_offset, hdr_len; + + ip.hdr = skb_network_header(skb); + l4.hdr = skb_checksum_start(skb); + + l4_offset = skb_transport_offset(skb); + assert((l4_offset%2) == 0); if ((tp->mcfg == CFG_METHOD_1) || (tp->mcfg == CFG_METHOD_2) || (tp->mcfg == CFG_METHOD_3)) { @@ -31104,23 +31221,21 @@ } else { switch (get_protocol(skb)) { case __constant_htons(ETH_P_IP): - if (skb_transport_offset(skb) <= GTTCPHO_MAX) { + if (l4_offset <= GTTCPHO_MAX) { opts0 |= GiantSendv4; - opts0 |= skb_transport_offset(skb) << GTTCPHO_SHIFT; + opts0 |= l4_offset << GTTCPHO_SHIFT; opts1 |= min(mss, MSS_MAX) << 18; large_send = 1; } break; case __constant_htons(ETH_P_IPV6): #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) - if (msdn_giant_send_check(skb)) { - r8168_csum_workaround(tp, skb); - goto out; - } + if (msdn_giant_send_check(skb)) + goto err_dma_0; #endif - if (skb_transport_offset(skb) <= GTTCPHO_MAX) { + if (l4_offset <= GTTCPHO_MAX) { opts0 |= GiantSendv6; - opts0 |= skb_transport_offset(skb) << GTTCPHO_SHIFT; + opts0 |= l4_offset << GTTCPHO_SHIFT; opts1 |= min(mss, MSS_MAX) << 18; large_send = 1; } @@ -31134,6 +31249,12 @@ if (large_send == 0) goto err_dma_0; + + /* compute length of segmentation header */ + hdr_len = (l4.tcp->doff * 4) + l4_offset; + /* update gso size and bytecount with header size */ + gso_segs = skb_shinfo(skb)->gso_segs; + bytecount += (gso_segs - 1) * hdr_len; } } #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) @@ -31151,9 +31272,6 @@ opts0 |= FirstFrag; } else { len = skb->len; - - ring->tx_skbentry.skb = skb; - opts0 |= FirstFrag | LastFrag; } @@ -31164,12 +31282,23 @@ netif_err(tp, drv, dev, "Failed to map TX DMA!\n"); goto err_dma_1; } + /* set first fragment's length */ ring->tx_skbentry.len = len; + + /* set skb to last fragment */ + last_entry = (entry + frags) % ring->num_tx_desc; + last = &ring->tx_skblast_entry; + last->skb = skb; + last->gso_segs = gso_segs; + last->bytecount = bytecount; + txd->addr = cpu_to_le64(mapping); txd->opts2 = cpu_to_le32(opts1); wmb(); txd->opts1 = cpu_to_le32(opts0); + netdev_tx_sent_queue(txring_txq(ring), bytecount); + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) dev->trans_start = jiffies; #else @@ -31190,7 +31319,8 @@ netif_stop_subqueue(dev, queue_mapping); } - rtl8168_doorbell(ring); /* set polling bit */ + if (netif_xmit_stopped(txring_txq(ring)) || !netdev_xmit_more()) + rtl8168_doorbell(ring); /* set polling bit */ if (unlikely(stop_queue)) { /* Sync with rtl_tx: @@ -31208,7 +31338,6 @@ out: return ret; err_dma_1: - ring->tx_skbentry.skb = NULL; rtl8168_tx_clear_range(tp, ring, ring->cur_tx + 1, frags); err_dma_0: RTLDEV->stats.tx_dropped++; @@ -31223,8 +31352,9 @@ } static void -rtl8168_tx_interrupt(struct rtl8168_tx_ring *ring) +rtl8168_tx_interrupt(struct rtl8168_tx_ring *ring, int budget) { + unsigned int total_bytes = 0, total_packets = 0; struct rtl8168_private *tp = ring->priv; struct net_device *dev = tp->dev; unsigned int dirty_tx, tx_left; @@ -31246,7 +31376,6 @@ while (tx_left > 0) { unsigned int entry = dirty_tx % ring->num_tx_desc; struct ring_info *tx_skb = ring->tx_skb + entry; - u32 len = tx_skb->len; u32 status; rmb(); @@ -31254,25 +31383,30 @@ if (status & DescOwn) break; - RTLDEV->stats.tx_bytes += len; - RTLDEV->stats.tx_packets++; - rtl8168_unmap_tx_skb(tp->pci_dev, tx_skb, ring->TxDescArray + entry); - if (tx_skb->skb!=NULL) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) - dev_consume_skb_any(tx_skb->skb); -#else - dev_kfree_skb_any(tx_skb->skb); -#endif + if (tx_skb->skb != NULL) { + /* update the statistics for this packet */ + total_bytes += tx_skb->bytecount; + total_packets += tx_skb->gso_segs; + + RTL_NAPI_CONSUME_SKB_ANY(tx_skb->skb, budget); tx_skb->skb = NULL; } dirty_tx++; tx_left--; } + if (total_packets) { + netdev_tx_completed_queue(txring_txq(ring), + total_packets, total_bytes); + + RTLDEV->stats.tx_bytes += total_bytes; + RTLDEV->stats.tx_packets += total_packets; + } + tp->dynamic_aspm_packet_count -= tx_left; if (ring->dirty_tx != dirty_tx) { @@ -31289,12 +31423,12 @@ } static void -rtl8168_tx_all_interrupt(struct rtl8168_private *tp) +rtl8168_tx_all_interrupt(struct rtl8168_private *tp, int budget) { int i; for (i = 0; i < rtl8168_tot_tx_rings(tp); i++) - rtl8168_tx_interrupt(&tp->tx_ringi); + rtl8168_tx_interrupt(&tp->tx_ringi, budget); } static inline int @@ -31406,7 +31540,7 @@ goto rx_out; #ifdef ENABLE_LIB_SUPPORT - if (ring->index > 0) { + if (tp->num_rx_rings == 0 && ring->index == 0) { rtl8168_lib_rx_interrupt(tp); goto rx_out; } @@ -31595,37 +31729,8 @@ } #ifdef ENABLE_DASH_SUPPORT - if ( tp->DASH ) { - if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { - u8 DashIntType2Status; - - if (status & ISRIMR_DASH_INTR_CMAC_RESET) - tp->CmacResetIntr = TRUE; - - DashIntType2Status = RTL_CMAC_R8(tp, CMAC_IBISR0); - if (DashIntType2Status & ISRIMR_DASH_TYPE2_ROK) { - tp->RcvFwDashOkEvt = TRUE; - } - if (DashIntType2Status & ISRIMR_DASH_TYPE2_TOK) { - tp->SendFwHostOkEvt = TRUE; - } - if (DashIntType2Status & ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE) { - tp->DashFwDisableRx = TRUE; - } - - RTL_CMAC_W8(tp, CMAC_IBISR0, DashIntType2Status); - } else { - if (status & ISRIMR_DP_REQSYS_OK) { - tp->RcvFwReqSysOkEvt = TRUE; - } - if (status & ISRIMR_DP_DASH_OK) { - tp->RcvFwDashOkEvt = TRUE; - } - if (status & ISRIMR_DP_HOST_OK) { - tp->SendFwHostOkEvt = TRUE; - } - } - } + if (CheckDashInterrupt(dev, status)) + rtl8168_schedule_dash_work(tp); #endif #ifdef CONFIG_R8168_NAPI @@ -31658,7 +31763,7 @@ (other_q_status & other_q_intr_mask)) tp->keep_intr_cnt = RTK_KEEP_INTERRUPT_COUNT; - rtl8168_tx_all_interrupt(tp); + rtl8168_tx_all_interrupt(tp, budget); for (i = 0; i < max_rx_queue; i++) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) @@ -31668,14 +31773,6 @@ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) } -#ifdef ENABLE_DASH_SUPPORT - if ( tp->DASH ) { - struct net_device *dev = tp->dev; - - HandleDashInterrupt(dev); - } -#endif - rtl8168_switch_to_timer_interrupt(tp); } else { tp->keep_intr_cnt = RTK_KEEP_INTERRUPT_COUNT; @@ -31712,9 +31809,15 @@ * Skip its interrupt here or its queue will be initialized * incorrectly. */ - if (message_id >= tp->num_rx_rings) + if (message_id >= tp->num_hw_tot_en_rx_rings) break; +#ifdef ENABLE_DASH_SUPPORT + if (message_id == 0 && + CheckDashInterrupt(dev, rtl8168_get_isr_by_vector(tp, 0))) + rtl8168_schedule_dash_work(tp); +#endif + #ifdef CONFIG_R8168_NAPI if (likely(RTL_NETIF_RX_SCHEDULE_PREP(dev, &r8168napi->napi))) { rtl8168_disable_interrupt_by_vector(tp, message_id); @@ -31724,10 +31827,14 @@ dev->name, message_id); rtl8168_self_clear_isr_by_vector(tp, message_id); #else + rtl8168_disable_interrupt_by_vector(tp, message_id); + + rtl8168_self_clear_isr_by_vector(tp, message_id); + if (message_id == 0) - rtl8168_tx_all_interrupt(tp); + rtl8168_tx_all_interrupt(tp, budget); - if (message_id < tp->num_rx_rings) { + if (message_id < tp->num_hw_tot_en_rx_rings) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) rtl8168_rx_interrupt(dev, tp, &tp->rx_ringmessage_id, &budget); #else @@ -31755,10 +31862,10 @@ int i; if (message_id == 0) - rtl8168_tx_all_interrupt(tp); + rtl8168_tx_all_interrupt(tp, budget); if (all_rx_q) - for (i = 0; i < tp->num_rx_rings; i++) + for (i = 0; i < tp->num_hw_tot_en_rx_rings; i++) work_done += rtl8168_rx_interrupt(dev, tp, &tp->rx_ringi, budget); else work_done += rtl8168_rx_interrupt(dev, tp, &tp->rx_ringmessage_id, budget); @@ -31766,16 +31873,6 @@ RTL_NAPI_QUOTA_UPDATE(dev, work_done, budget); if (work_done < work_to_do) { -#ifdef ENABLE_DASH_SUPPORT - if (message_id == 0) { - if ( tp->DASH ) { - struct net_device *dev = tp->dev; - - HandleDashInterrupt(dev); - } - } -#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) if (RTL_NETIF_RX_COMPLETE(dev, napi, work_done) == FALSE) return RTL_NAPI_RETURN_VALUE; @@ -31874,8 +31971,6 @@ _rtl8168_wait_for_quiescence(dev); - rtl8168_dsm(dev, DSM_IF_DOWN); - rtl8168_hw_reset(dev); rtl8168_tx_clear(tp); @@ -31888,7 +31983,8 @@ int i; for (i = 0; i < tp->num_tx_rings; i++) - if (tp->tx_ringi.TxDescArray) return 0; + if (tp->tx_ringi.TxDescArray) + return 0; if (tp->RxDescArray) return 0; @@ -31922,6 +32018,8 @@ rtl8168_powerdown_pll(dev); } + rtl8168_dsm(dev, DSM_IF_DOWN); + return 0; } @@ -32090,9 +32188,8 @@ rtl8168_rar_set(tp, dev->dev_addr); if (!netif_running(dev)) { - if (HW_DASH_SUPPORT_DASH(tp)) { + if (HW_DASH_SUPPORT_DASH(tp)) rtl8168_driver_start(tp); - } goto out_unlock; }
View file
r8168-8.052.01.tar.gz/src/r8168_realwow.h -> r8168-8.053.00.tar.gz/src/r8168_realwow.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_rss.c -> r8168-8.053.00.tar.gz/src/r8168_rss.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -57,13 +57,13 @@ switch (cmd->flow_type) { case TCP_V4_FLOW: cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; - /* fallthrough */ + fallthrough; case IPV4_FLOW: cmd->data |= RXH_IP_SRC | RXH_IP_DST; break; case TCP_V6_FLOW: cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; - /* fallthrough */ + fallthrough; case IPV6_FLOW: cmd->data |= RXH_IP_SRC | RXH_IP_DST; break; @@ -258,28 +258,6 @@ indiri = tp->rss_indir_tbli; } -int rtl8168_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, - u8 *hfunc) -{ - struct rtl8168_private *tp = netdev_priv(dev); - - netif_info(tp, drv, tp->dev, "rss get rxfh\n"); - - if (!(dev->features & NETIF_F_RXHASH)) - return -EOPNOTSUPP; - - if (hfunc) - *hfunc = ETH_RSS_HASH_TOP; - - if (indir) - rtl8168_get_reta(tp, indir); - - if (key) - memcpy(key, tp->rss_key, RTL8168_RSS_KEY_SIZE); - - return 0; -} - static u32 rtl8168_rss_key_reg(struct rtl8168_private *tp) { return RSS_KEY_8168; @@ -330,6 +308,88 @@ rtl8168_eri_write(tp, rss_key_reg + i, 4, *rss_key++, ERIAR_ExGMAC); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) +int rtl8168_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + netif_info(tp, drv, tp->dev, "rss get rxfh\n"); + + if (!(dev->features & NETIF_F_RXHASH)) + return -EOPNOTSUPP; + + rxfh->hfunc = ETH_RSS_HASH_TOP; + + if (rxfh->indir) + rtl8168_get_reta(tp, rxfh->indir); + + if (rxfh->key) + memcpy(rxfh->key, tp->rss_key, RTL8168_RSS_KEY_SIZE); + + return 0; +} + +int rtl8168_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, + struct netlink_ext_ack *extack) +{ + struct rtl8168_private *tp = netdev_priv(dev); + u32 reta_entries = rtl8168_rss_indir_tbl_entries(tp); + int i; + + netif_info(tp, drv, tp->dev, "rss set rxfh\n"); + + /* We require at least one supported parameter to be changed and no + * change in any of the unsupported parameters + */ + if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && rxfh->hfunc != ETH_RSS_HASH_TOP) + return -EOPNOTSUPP; + + /* Fill out the redirection table */ + if (rxfh->indir) { + int max_queues = tp->num_rx_rings; + + /* Verify user input. */ + for (i = 0; i < reta_entries; i++) + if (rxfh->indiri >= max_queues) + return -EINVAL; + + for (i = 0; i < reta_entries; i++) + tp->rss_indir_tbli = rxfh->indiri; + } + + /* Fill out the rss hash key */ + if (rxfh->key) + memcpy(tp->rss_key, rxfh->key, RTL8168_RSS_KEY_SIZE); + + rtl8168_store_reta(tp); + + rtl8168_store_rss_key(tp); + + return 0; +} +#else +int rtl8168_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, + u8 *hfunc) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + netif_info(tp, drv, tp->dev, "rss get rxfh\n"); + + if (!(dev->features & NETIF_F_RXHASH)) + return -EOPNOTSUPP; + + if (hfunc) + *hfunc = ETH_RSS_HASH_TOP; + + if (indir) + rtl8168_get_reta(tp, indir); + + if (key) + memcpy(key, tp->rss_key, RTL8168_RSS_KEY_SIZE); + + return 0; +} + int rtl8168_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc) { @@ -368,6 +428,7 @@ return 0; } +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) */ static u32 rtl8168_get_rx_desc_hash(struct rtl8168_private *tp, struct RxDescV2 *desc)
View file
r8168-8.052.01.tar.gz/src/r8168_rss.h -> r8168-8.053.00.tar.gz/src/r8168_rss.h
Changed
@@ -5,7 +5,7 @@ # r8125 is the Linux device driver released for Realtek 2.5Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -50,10 +50,16 @@ int rtl8168_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd); u32 rtl8168_get_rxfh_key_size(struct net_device *netdev); u32 rtl8168_rss_indir_size(struct net_device *netdev); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) +int rtl8168_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh); +int rtl8168_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, + struct netlink_ext_ack *extack); +#else int rtl8168_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc); int rtl8168_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key, const u8 hfunc); +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) */ void rtl8168_rx_hash(struct rtl8168_private *tp, struct RxDescV2 *desc, struct sk_buff *skb);
View file
r8168-8.052.01.tar.gz/src/rtl_eeprom.c -> r8168-8.053.00.tar.gz/src/rtl_eeprom.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free @@ -93,7 +93,7 @@ rtl8168_lower_clock(tp, &x); } -int rtl8168_eeprom_cmd_done(struct rtl8168_private *tp) +static int rtl8168_eeprom_cmd_done(struct rtl8168_private *tp) { u8 x; int i; @@ -157,9 +157,8 @@ int addr_sz = 6; int w_dummy_addr = 4; - if(tp->eeprom_type == EEPROM_TYPE_NONE) { - return ; - } + if(tp->eeprom_type == EEPROM_TYPE_NONE) + return; if (tp->eeprom_type==EEPROM_TYPE_93C46) { addr_sz = 6; @@ -178,17 +177,15 @@ rtl8168_shift_out_bits(tp, RTL_EEPROM_ERASE_OPCODE, 3); rtl8168_shift_out_bits(tp, reg, addr_sz); - if (rtl8168_eeprom_cmd_done(tp) < 0) { + if (rtl8168_eeprom_cmd_done(tp) < 0) return; - } rtl8168_stand_by(tp); rtl8168_shift_out_bits(tp, RTL_EEPROM_WRITE_OPCODE, 3); rtl8168_shift_out_bits(tp, reg, addr_sz); rtl8168_shift_out_bits(tp, data, 16); - if (rtl8168_eeprom_cmd_done(tp) < 0) { + if (rtl8168_eeprom_cmd_done(tp) < 0) return; - } rtl8168_stand_by(tp); rtl8168_shift_out_bits(tp, RTL_EEPROM_EWDS_OPCODE, 5);
View file
r8168-8.052.01.tar.gz/src/rtl_eeprom.h -> r8168-8.053.00.tar.gz/src/rtl_eeprom.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/rtltool.c -> r8168-8.053.00.tar.gz/src/rtltool.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/rtltool.h -> r8168-8.053.00.tar.gz/src/rtltool.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2023 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 # 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
.