Projects
home:bitstreamout:Essentials
r8168
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
r8168.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed Jan 10 14:37:17 UTC 2018 - werner.fink@opensuse.org + +- Update to version r8168-8.045.08 + +------------------------------------------------------------------- Thu Aug 10 12:14:26 UTC 2017 - werner@suse.de - Rework build of module, that is use obj directory
View file
r8168.spec
Changed
@@ -16,7 +16,7 @@ # Name: r8168 -Version: 8.044.02 +Version: 8.045.08 Release: 0 License: GPL-2.0+ Summary: Device driver for RealTek Gigabit Ethernet controllers @@ -24,7 +24,7 @@ # http://www.realtek.com.tw/Downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#2 Url: http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4 Group: System/Kernel -Source0: 0009-r8168-8.044.02.tar.bz2 +Source0: 0010-r8168-8.045.08.tar.bz2 Source1: preamble Source2: Module.supported Patch0: r8168-kernel_version.patch
View file
r8168-configuration.patch
Changed
@@ -3,8 +3,8 @@ 1 file changed, 1 insertion(+) --- src/Makefile -+++ src/Makefile 2017-08-10 11:57:29.034677787 +0000 -@@ -42,6 +42,7 @@ ENABLE_S0_MAGIC_PACKET = n ++++ src/Makefile 2018-01-10 14:35:59.981468278 +0000 +@@ -44,6 +44,7 @@ ENABLE_S0_MAGIC_PACKET = n ifneq ($(KERNELRELEASE),) obj-m := r8168.o r8168-objs := r8168_n.o r8168_asf.o rtl_eeprom.o rtltool.o
View file
r8168-kernel_version.patch
Changed
@@ -1,13 +1,13 @@ --- src/r8168.h | 4 ++++ - src/r8168_n.c | 2 ++ - 2 files changed, 6 insertions(+) + src/r8168_n.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) --- src/r8168.h -+++ src/r8168.h 2017-08-10 11:34:04.607885256 +0000 -@@ -36,6 +36,10 @@ - #include "r8168_realwow.h" - #include "r8168_fiber.h" ++++ src/r8168.h 2018-01-10 14:30:36.443694357 +0000 +@@ -113,6 +113,10 @@ do { \ + } while (0) + #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) +#include <linux/sched/signal.h> @@ -17,14 +17,13 @@ #if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present) #define vlan_tx_tag_present skb_vlan_tag_present --- src/r8168_n.c -+++ src/r8168_n.c 2017-08-10 11:32:43.809331183 +0000 -@@ -25732,7 +25732,9 @@ process_pkt: ++++ src/r8168_n.c 2018-01-10 14:33:25.348444039 +0000 +@@ -27607,7 +27607,7 @@ process_pkt: + if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) rtl8168_rx_skb(tp, skb); - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) dev->last_rx = jiffies; -+#endif + #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) RTLDEV->stats.rx_bytes += pkt_size; - RTLDEV->stats.rx_packets++; - }
View file
0009-r8168-8.044.02.tar.bz2/src/Makefile -> 0010-r8168-8.045.08.tar.bz2/src/Makefile
Changed
@@ -33,9 +33,11 @@ ENABLE_FIBER_SUPPORT = n ENABLE_REALWOW_SUPPORT = n ENABLE_DASH_SUPPORT = n +ENABLE_DASH_PRINTER_SUPPORT = n CONFIG_DOWN_SPEED_100 = n CONFIG_ASPM = y ENABLE_S5WOL = y +ENABLE_S5_KEEP_CURR_MAC = n ENABLE_EEE = n ENABLE_S0_MAGIC_PACKET = n @@ -57,6 +59,10 @@ r8168-objs += r8168_dash.o EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT endif + ifeq ($(ENABLE_DASH_PRINTER_SUPPORT), y) + r8168-objs += r8168_dash.o + EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT -DENABLE_DASH_PRINTER_SUPPORT + endif EXTRA_CFLAGS += -DCONFIG_R8168_NAPI EXTRA_CFLAGS += -DCONFIG_R8168_VLAN ifeq ($(CONFIG_DOWN_SPEED_100), y) @@ -68,6 +74,9 @@ ifeq ($(ENABLE_S5WOL), y) EXTRA_CFLAGS += -DENABLE_S5WOL endif + ifeq ($(ENABLE_S5_KEEP_CURR_MAC), y) + EXTRA_CFLAGS += -DENABLE_S5_KEEP_CURR_MAC + endif ifeq ($(ENABLE_EEE), y) EXTRA_CFLAGS += -DENABLE_EEE endif
View file
0009-r8168-8.044.02.tar.bz2/src/r8168.h -> 0010-r8168-8.045.08.tar.bz2/src/r8168.h
Changed
@@ -36,6 +36,83 @@ #include "r8168_realwow.h" #include "r8168_fiber.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +static inline void eth_hw_addr_random(struct net_device *dev) +{ + random_ether_addr(dev->dev_addr); +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) +static inline void ether_addr_copy(u8 *dst, const u8 *src) +{ + u16 *a = (u16 *)dst; + const u16 *b = (const u16 *)src; + + a[0] = b[0]; + a[1] = b[1]; + a[2] = b[2]; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) +#define IS_ERR_OR_NULL(ptr) (!ptr) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) +#define reinit_completion(x) ((x)->done = 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) +#define pm_runtime_mark_last_busy(x) +#define pm_runtime_put_autosuspend(x) pm_runtime_put(x) +#define pm_runtime_put_sync_autosuspend(x) pm_runtime_put_sync(x) + +static inline bool pm_runtime_suspended(struct device *dev) +{ + return dev->power.runtime_status == RPM_SUSPENDED + && !dev->power.disable_depth; +} + +static inline bool pm_runtime_active(struct device *dev) +{ + return dev->power.runtime_status == RPM_ACTIVE + || dev->power.disable_depth; +} +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) +#define queue_delayed_work(long_wq, work, delay) schedule_delayed_work(work, delay) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +#define netif_printk(priv, type, level, netdev, fmt, args...) \ + do { \ + if (netif_msg_##type(priv)) \ + printk(level "%s: " fmt,(netdev)->name , ##args); \ + } while (0) + +#define netif_emerg(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_EMERG, netdev, fmt, ##args) +#define netif_alert(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_ALERT, netdev, fmt, ##args) +#define netif_crit(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_CRIT, netdev, fmt, ##args) +#define netif_err(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_ERR, netdev, fmt, ##args) +#define netif_warn(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_WARNING, netdev, fmt, ##args) +#define netif_notice(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_NOTICE, netdev, fmt, ##args) +#define netif_info(priv, type, netdev, fmt, args...) \ + netif_printk(priv, type, KERN_INFO, (netdev), fmt, ##args) +#endif +#endif +#endif +#endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) +#define setup_timer(_timer, _function, _data) \ +do { \ + (_timer)->function = _function; \ + (_timer)->data = _data; \ + init_timer(_timer); \ +} while (0) +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) + #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) #if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present) #define vlan_tx_tag_present skb_vlan_tag_present @@ -193,8 +270,25 @@ #else #define NAPI_SUFFIX "" #endif +#ifdef ENABLE_FIBER_SUPPORT +#define FIBER_SUFFIX "-FIBER" +#else +#define FIBER_SUFFIX "" +#endif +#ifdef ENABLE_REALWOW_SUPPORT +#define REALWOW_SUFFIX "-REALWOW" +#else +#define REALWOW_SUFFIX "" +#endif +#if defined(ENABLE_DASH_PRINTER_SUPPORT) +#define DASH_SUFFIX "-PRINTER" +#elif defined(ENABLE_DASH_SUPPORT) +#define DASH_SUFFIX "-DASH" +#else +#define DASH_SUFFIX "" +#endif -#define RTL8168_VERSION "8.044.02" NAPI_SUFFIX +#define RTL8168_VERSION "8.045.08" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX #define MODULENAME "r8168" #define PFX MODULENAME ": " @@ -250,14 +344,15 @@ #define TX_DMA_BURST_16 0 #define Reserved1_data 0x3F #define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ -#define Jumbo_Frame_2k (2 * 1024) -#define Jumbo_Frame_3k (3 * 1024) -#define Jumbo_Frame_4k (4 * 1024) -#define Jumbo_Frame_5k (5 * 1024) -#define Jumbo_Frame_6k (6 * 1024) -#define Jumbo_Frame_7k (7 * 1024) -#define Jumbo_Frame_8k (8 * 1024) -#define Jumbo_Frame_9k (9 * 1024) +#define Jumbo_Frame_1k ETH_DATA_LEN +#define Jumbo_Frame_2k (2*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_3k (3*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_4k (4*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_5k (5*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_6k (6*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_7k (7*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_8k (8*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) +#define Jumbo_Frame_9k (9*1024 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define RxEarly_off_V1 (0x07 << 11) #define RxEarly_off_V2 (1 << 11) @@ -382,7 +477,7 @@ #define RTL_RX_QUOTA(budget) *budget #define RTL_NAPI_QUOTA_UPDATE(ndev, work_done, budget) *budget -= work_done; \ ndev->quota -= work_done; -#define RTL_NETIF_RX_COMPLETE(dev, napi) netif_rx_complete(dev) +#define RTL_NETIF_RX_COMPLETE(dev, napi, work_done) netif_rx_complete(dev) #define RTL_NETIF_RX_SCHEDULE_PREP(dev, napi) netif_rx_schedule_prep(dev) #define __RTL_NETIF_RX_SCHEDULE(dev, napi) __netif_rx_schedule(dev) #define RTL_NAPI_RETURN_VALUE work_done >= work_to_do @@ -400,17 +495,21 @@ #define RTL_RX_QUOTA(budget) budget #define RTL_NAPI_QUOTA_UPDATE(ndev, work_done, budget) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) -#define RTL_NETIF_RX_COMPLETE(dev, napi) netif_rx_complete(dev, napi) +#define RTL_NETIF_RX_COMPLETE(dev, napi, work_done) netif_rx_complete(dev, napi) #define RTL_NETIF_RX_SCHEDULE_PREP(dev, napi) netif_rx_schedule_prep(dev, napi) #define __RTL_NETIF_RX_SCHEDULE(dev, napi) __netif_rx_schedule(dev, napi) #endif #if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,29) -#define RTL_NETIF_RX_COMPLETE(dev, napi) netif_rx_complete(napi) +#define RTL_NETIF_RX_COMPLETE(dev, napi, work_done) netif_rx_complete(napi) #define RTL_NETIF_RX_SCHEDULE_PREP(dev, napi) netif_rx_schedule_prep(napi) #define __RTL_NETIF_RX_SCHEDULE(dev, napi) __netif_rx_schedule(napi) #endif #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29) -#define RTL_NETIF_RX_COMPLETE(dev, napi) napi_complete(napi) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) +#define RTL_NETIF_RX_COMPLETE(dev, napi, work_done) napi_complete_done(napi, work_done) +#else +#define RTL_NETIF_RX_COMPLETE(dev, napi, work_done) napi_complete(napi) +#endif #define RTL_NETIF_RX_SCHEDULE_PREP(dev, napi) napi_schedule_prep(napi) #define __RTL_NETIF_RX_SCHEDULE(dev, napi) __napi_schedule(napi) #endif @@ -940,10 +1039,10 @@ FuncEventMask = 0xF4, TimeInt3 = 0xF4, FuncPresetState = 0xF8, - IBCR0 = 0xF8, - IBCR2 = 0xF9, - IBIMR0 = 0xFA, - IBISR0 = 0xFB, + CMAC_IBCR0 = 0xF8, + CMAC_IBCR2 = 0xF9, + CMAC_IBIMR0 = 0xFA, + CMAC_IBISR0 = 0xFB, FuncForceEvent = 0xFC, }; @@ -1352,13 +1451,17 @@ u8 eeprom_type; u8 autoneg; u8 duplex; - u16 speed; + u32 speed; u16 eeprom_len; u16 cur_page; u32 bios_setting; - int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex); + int (*set_speed)(struct net_device *, u8 autoneg, u32 speed, u8 duplex); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) void (*get_settings)(struct net_device *, struct ethtool_cmd *); +#else + void (*get_settings)(struct net_device *, struct ethtool_link_ksettings *); +#endif void (*phy_reset_enable)(struct net_device *); unsigned int (*phy_reset_pending)(struct net_device *); unsigned int (*link_ok)(struct net_device *); @@ -1407,12 +1510,21 @@ u8 RequiredSecLanDonglePatch; u32 HwFiberModeVer; + u32 HwFiberStat; u8 HwSuppMagicPktVer; + u8 HwSuppCheckPhyDisableModeVer; + + u8 random_mac; + //Dash+++++++++++++++++ u8 HwSuppDashVer; u8 DASH; + u8 dash_printer_enabled; + u8 HwPkgDet; + void __iomem *mapped_cmac_ioaddr; /* mapped cmac memory map physical address */ + void __iomem *cmac_ioaddr; /* cmac memory map physical address */ #ifdef ENABLE_DASH_SUPPORT u16 AfterRecvFromFwBufLen; @@ -1470,10 +1582,15 @@ u16 HostReqValue; u32 CmacResetIsrCounter; - u8 CmacResetIsr1st ; - u8 CmacResetIsr2nd ; + u8 CmacResetIntr ; u8 CmacResetting ; u8 CmacOobIssueCmacReset ; + +#if defined(ENABLE_DASH_PRINTER_SUPPORT) + struct completion fw_ack; + struct completion fw_req; + struct completion fw_host_ok; +#endif //Dash----------------- #endif //ENABLE_DASH_SUPPORT @@ -1533,6 +1650,8 @@ CFG_METHOD_28, CFG_METHOD_29, CFG_METHOD_30, + CFG_METHOD_31, + CFG_METHOD_32, CFG_METHOD_MAX, CFG_METHOD_DEFAULT = 0xFF }; @@ -1572,6 +1691,7 @@ #define NIC_RAMCODE_VERSION_CFG_METHOD_26 (0x0012) #define NIC_RAMCODE_VERSION_CFG_METHOD_28 (0x0010) #define NIC_RAMCODE_VERSION_CFG_METHOD_29 (0x0018) +#define NIC_RAMCODE_VERSION_CFG_METHOD_31 (0x0003) //hwoptimize #define HW_PATCH_SOC_LAN (BIT_0) @@ -1592,9 +1712,12 @@ void OOB_mutex_lock(struct rtl8168_private *tp); u32 mdio_read(struct rtl8168_private *tp, u32 RegAddr); u32 OCP_read(struct rtl8168_private *tp, u16 addr, u8 len); +u32 OCP_read_with_oob_base_address(struct rtl8168_private *tp, u16 addr, u8 len, u32 base_address); +u32 OCP_write_with_oob_base_address(struct rtl8168_private *tp, u16 addr, u8 len, u32 value, u32 base_address); u32 rtl8168_eri_read(void __iomem *ioaddr, int addr, int len, int type); +u32 rtl8168_eri_read_with_oob_base_address(void __iomem *ioaddr, int addr, int len, int type, u32 base_address); +int rtl8168_eri_write_with_oob_base_address(void __iomem *ioaddr, int addr, int len, u32 value, int type, u32 base_address); u16 rtl8168_ephy_read(void __iomem *ioaddr, int RegAddr); -void rtl8168_hw_disable_mac_mcu_bps(struct net_device *dev); void rtl8168_wait_txrx_fifo_empty(struct net_device *dev); void EnableNowIsOob(struct rtl8168_private *tp); void DisableNowIsOob(struct rtl8168_private *tp); @@ -1603,7 +1726,9 @@ void Dash2EnableTx(struct rtl8168_private *tp); void Dash2DisableRx(struct rtl8168_private *tp); void Dash2EnableRx(struct rtl8168_private *tp); +void rtl8168_hw_disable_mac_mcu_bps(struct net_device *dev); +#define HW_SUPPORT_CHECK_PHY_DISABLE_MODE(_M) ((_M)->HwSuppCheckPhyDisableModeVer > 0 ) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) #define netdev_mc_count(dev) ((dev)->mc_count)
View file
0009-r8168-8.044.02.tar.bz2/src/r8168_dash.h -> 0010-r8168-8.045.08.tar.bz2/src/r8168_dash.h
Changed
@@ -37,8 +37,7 @@ #define SIOCDEVPRIVATE_RTLDASH SIOCDEVPRIVATE+2 enum rtl_dash_cmd { - - RTL_DASH_ARP_NS_OFFLOAD=0, + RTL_DASH_ARP_NS_OFFLOAD = 0, RTL_DASH_SET_OOB_IPMAC, RTL_DASH_NOTIFY_OOB, @@ -46,7 +45,17 @@ RTL_DASH_CHECK_SEND_BUFFER_TO_DASH_FW_COMPLETE, RTL_DASH_GET_RCV_FROM_FW_BUFFER_DATA, - RTLT_DASH_COMMAND_INVALID + RTL_FW_SET_IPV4 = 0x10, + RTL_FW_GET_IPV4, + RTL_FW_SET_IPV6, + RTL_FW_GET_IPV6, + RTL_FW_SET_EXT_SNMP, + RTL_FW_GET_EXT_SNMP, + RTL_FW_SET_WAKEUP_PATTERN, + RTL_FW_GET_WAKEUP_PATTERN, + RTL_FW_DEL_WAKEUP_PATTERN, + + RTLT_DASH_COMMAND_INVALID, }; struct rtl_dash_ip_mac { @@ -65,6 +74,41 @@ }; }; +struct settings_ipv4 { + __u32 IPv4addr; + __u32 IPv4mask; + __u32 IPv4Gateway; +}; + +struct settings_ipv6 { + __u32 reserved; + __u32 prefixLen; + __u16 IPv6addr[8]; + __u16 IPv6Gateway[8]; +}; + +struct settings_ext_snmp { + __u16 index; + __u16 oid_get_len; + __u8 oid_for_get[24]; + __u8 reserved0[26]; + __u16 value_len; + __u8 value[256]; + __u8 supported; + __u8 reserved1[27]; +}; + +struct wakeup_pattern { + __u8 index; + __u8 valid; + __u8 start; + __u8 length; + __u8 name[36]; + __u8 mask[16]; + __u8 pattern[128]; + __u32 reserved[2]; +}; + typedef struct _RX_DASH_FROM_FW_DESC { u16 length; u8 statusLowByte; @@ -94,7 +138,7 @@ typedef struct _RX_DASH_BUFFER_TYPE_2 { OSOOBHdr oobhdr; - void *RxDataBuffer; + u8 RxDataBuffer[0]; } RX_DASH_BUFFER_TYPE_2, *PRX_DASH_BUFFER_TYPE_2; @@ -127,9 +171,10 @@ #define HW_DASH_SUPPORT_DASH(_M) ((_M)->HwSuppDashVer > 0 ) #define HW_DASH_SUPPORT_TYPE_1(_M) ((_M)->HwSuppDashVer == 1 ) #define HW_DASH_SUPPORT_TYPE_2(_M) ((_M)->HwSuppDashVer == 2 ) +#define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3 ) -#define RECV_FROM_FW_BUF_SIZE (1518) -#define SEND_TO_FW_BUF_SIZE (1518) +#define RECV_FROM_FW_BUF_SIZE (1520) +#define SEND_TO_FW_BUF_SIZE (1520) #define RX_DASH_FROM_FW_OWN BIT_15 #define TX_DASH_SEND_FW_OWN BIT_15 @@ -183,6 +228,22 @@ #define CMAC_OOB_INIT 0x26 #define CMAC_OOB_RESET 0x2a +#define NO_BASE_ADDRESS 0x00000000 +#define RTL8168FP_OOBMAC_BASE 0xBAF70000 +#define RTL8168FP_CMAC_IOBASE 0xBAF20000 +#define RTL8168FP_KVM_BASE 0xBAF80400 +#define CMAC_SYNC_REG 0x20 +#define CMAC_RXDESC_OFFSET 0x90 //RX: 0x90 - 0x98 +#define CMAC_TXDESC_OFFSET 0x98 //TX: 0x98 - 0x9F + +/* cmac write/read MMIO register */ +#define RTL_CMAC_W8(reg, val8) writeb ((val8), tp->cmac_ioaddr + (reg)) +#define RTL_CMAC_W16(reg, val16) writew ((val16), tp->cmac_ioaddr + (reg)) +#define RTL_CMAC_W32(reg, val32) writel ((val32), tp->cmac_ioaddr + (reg)) +#define RTL_CMAC_R8(reg) readb (tp->cmac_ioaddr + (reg)) +#define RTL_CMAC_R16(reg) readw (tp->cmac_ioaddr + (reg)) +#define RTL_CMAC_R32(reg) ((unsigned long) readl (tp->cmac_ioaddr + (reg))) + int rtl8168_dash_ioctl(struct net_device *dev, struct ifreq *ifr); void HandleDashInterrupt(struct net_device *dev); int AllocateDashShareMemory(struct net_device *dev);
View file
0009-r8168-8.044.02.tar.bz2/src/r8168_fiber.h -> 0010-r8168-8.045.08.tar.bz2/src/r8168_fiber.h
Changed
@@ -47,11 +47,19 @@ FIBER_MODE_MAX }; +enum { + FIBER_STAT_NOT_CHECKED = 0, + FIBER_STAT_CONNECT, + FIBER_STAT_DISCONNECT, + FIBER_STAT_MAX +}; + #define HW_FIBER_MODE_ENABLED(_M) ((_M)->HwFiberModeVer > 0) void rtl8168_hw_fiber_phy_config(struct net_device *dev); +u32 rtl8168_hw_fiber_get_connect_status(struct net_device *dev); #endif /* _LINUX_R8168_FIBER_H */
View file
0009-r8168-8.044.02.tar.bz2/src/r8168_n.c -> 0010-r8168-8.045.08.tar.bz2/src/r8168_n.c
Changed
@@ -54,6 +54,7 @@ #include <linux/tcp.h> #include <linux/init.h> #include <linux/rtnetlink.h> +#include <linux/completion.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) #include <linux/pci-aspm.h> @@ -69,6 +70,10 @@ #include <linux/moduleparam.h> #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) +#include <linux/mdio.h> +#endif + #include <asm/io.h> #include <asm/irq.h> @@ -276,11 +281,23 @@ 0xff7e5880, Jumbo_Frame_9k), + _R("RTL8168FP/8111FP", + CFG_METHOD_31, + RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + + _R("RTL8168FP/8111FP", + CFG_METHOD_32, + RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + _R("Unknown", CFG_METHOD_DEFAULT, (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, - RX_BUF_SIZE) + Jumbo_Frame_1k) }; #undef _R @@ -305,9 +322,9 @@ u32 msg_enable; } debug = { -1 }; -static unsigned short speed = SPEED_1000; -static int duplex = DUPLEX_FULL; -static int autoneg = AUTONEG_ENABLE; +static unsigned int speed_mode = SPEED_1000; +static unsigned int duplex_mode = DUPLEX_FULL; +static unsigned int autoneg_mode = AUTONEG_ENABLE; #ifdef CONFIG_ASPM static int aspm = 1; #else @@ -318,6 +335,11 @@ #else static int s5wol = 0; #endif +#ifdef ENABLE_S5_KEEP_CURR_MAC +static int s5_keep_curr_mac = 1; +#else +static int s5_keep_curr_mac = 0; +#endif #ifdef ENABLE_EEE static int eee_enable = 1; #else @@ -337,14 +359,14 @@ MODULE_AUTHOR("Realtek and the Linux r8168 crew <netdev@vger.kernel.org>"); MODULE_DESCRIPTION("RealTek RTL-8168 Gigabit Ethernet driver"); -module_param(speed, ushort, 0); -MODULE_PARM_DESC(speed, "force phy operation. Deprecated by ethtool (8)."); +module_param(speed_mode, uint, 0); +MODULE_PARM_DESC(speed_mode, "force phy operation. Deprecated by ethtool (8)."); -module_param(duplex, int, 0); -MODULE_PARM_DESC(duplex, "force phy operation. Deprecated by ethtool (8)."); +module_param(duplex_mode, uint, 0); +MODULE_PARM_DESC(duplex_mode, "force phy operation. Deprecated by ethtool (8)."); -module_param(autoneg, int, 0); -MODULE_PARM_DESC(autoneg, "force phy operation. Deprecated by ethtool (8)."); +module_param(autoneg_mode, uint, 0); +MODULE_PARM_DESC(autoneg_mode, "force phy operation. Deprecated by ethtool (8)."); module_param(aspm, int, 0); MODULE_PARM_DESC(aspm, "Enable ASPM."); @@ -352,6 +374,9 @@ module_param(s5wol, int, 0); MODULE_PARM_DESC(s5wol, "Enable Shutdown Wake On Lan."); +module_param(s5_keep_curr_mac, int, 0); +MODULE_PARM_DESC(s5_keep_curr_mac, "Enable Shutdown Keep Current MAC Address."); + module_param(rx_copybreak, int, 0); MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); @@ -416,7 +441,7 @@ static void rtl8168_phy_power_up(struct net_device *dev); static void rtl8168_phy_power_down(struct net_device *dev); -static int rtl8168_set_speed(struct net_device *dev, u8 autoneg, u16 speed, u8 duplex); +static int rtl8168_set_speed(struct net_device *dev, u8 autoneg, u32 speed, u8 duplex); #ifdef CONFIG_R8168_NAPI static int rtl8168_poll(napi_ptr napi, napi_budget budget); @@ -729,17 +754,27 @@ seq_printf(m, "RequiredSecLanDonglePatch\t0x%x\n", tp->RequiredSecLanDonglePatch); seq_printf(m, "HwSuppDashVer\t0x%x\n", tp->HwSuppDashVer); seq_printf(m, "DASH\t0x%x\n", tp->DASH); + seq_printf(m, "dash_printer_enabled\t0x%x\n", tp->dash_printer_enabled); seq_printf(m, "HwSuppKCPOffloadVer\t0x%x\n", tp->HwSuppKCPOffloadVer); - seq_printf(m, "speed\t0x%x\n", speed); - seq_printf(m, "duplex\t0x%x\n", duplex); - seq_printf(m, "autoneg\t0x%x\n", autoneg); + seq_printf(m, "speed_mode\t0x%x\n", speed_mode); + seq_printf(m, "duplex_mode\t0x%x\n", duplex_mode); + seq_printf(m, "autoneg_mode\t0x%x\n", autoneg_mode); seq_printf(m, "aspm\t0x%x\n", aspm); seq_printf(m, "s5wol\t0x%x\n", s5wol); + seq_printf(m, "s5_keep_curr_mac\t0x%x\n", s5_keep_curr_mac); seq_printf(m, "eee_enable\t0x%x\n", eee_enable); seq_printf(m, "hwoptimize\t0x%lx\n", hwoptimize); seq_printf(m, "proc_init_num\t0x%x\n", proc_init_num); seq_printf(m, "s0_magic_packet\t0x%x\n", s0_magic_packet); seq_printf(m, "HwSuppMagicPktVer\t0x%x\n", tp->HwSuppMagicPktVer); + seq_printf(m, "HwSuppCheckPhyDisableModeVer\t0x%x\n", tp->HwSuppCheckPhyDisableModeVer); + seq_printf(m, "HwPkgDet\t0x%x\n", tp->HwPkgDet); + seq_printf(m, "random_mac\t0x%x\n", tp->random_mac); + seq_printf(m, "org_mac_addr\t%pM\n", tp->org_mac_addr); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + seq_printf(m, "perm_addr\t%pM\n", dev->perm_addr); +#endif + seq_printf(m, "dev_addr\t%pM\n", dev->dev_addr); spin_unlock_irqrestore(&tp->lock, flags); seq_putc(m, '\n'); @@ -1025,17 +1060,27 @@ "RequiredSecLanDonglePatch\t0x%x\n" "HwSuppDashVer\t0x%x\n" "DASH\t0x%x\n" + "dash_printer_enabled\t0x%x\n" "HwSuppKCPOffloadVer\t0x%x\n" - "speed\t0x%x\n" - "duplex\t0x%x\n" - "autoneg\t0x%x\n" + "speed_mode\t0x%x\n" + "duplex_mode\t0x%x\n" + "autoneg_mode\t0x%x\n" "aspm\t0x%x\n" "s5wol\t0x%x\n" + "s5_keep_curr_mac\t0x%x\n" "eee_enable\t0x%x\n" "hwoptimize\t0x%lx\n" "proc_init_num\t0x%x\n" "s0_magic_packet\t0x%x\n" - "HwSuppMagicPktVer\t0x%x\n", + "HwSuppMagicPktVer\t0x%x\n" + "HwSuppCheckPhyDisableModeVer\t0x%x\n" + "HwPkgDet\t0x%x\n" + "random_mac\t0x%x\n" + "org_mac_addr\t%pM\n" +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + "perm_addr\t%pM\n" +#endif + "dev_addr\t%pM\n", MODULENAME, RTL8168_VERSION, tp->chipset, @@ -1089,17 +1134,27 @@ tp->RequiredSecLanDonglePatch, tp->HwSuppDashVer, tp->DASH, + tp->dash_printer_enabled, tp->HwSuppKCPOffloadVer, - speed, - duplex, - autoneg, + speed_mode, + duplex_mode, + autoneg_mode, aspm, s5wol, + s5_keep_curr_mac, eee_enable, hwoptimize, proc_init_num, s0_magic_packet, - tp->HwSuppMagicPktVer + tp->HwSuppMagicPktVer, + tp->HwSuppCheckPhyDisableModeVer, + tp->HwPkgDet, + tp->random_mac, + tp->org_mac_addr, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + dev->perm_addr, +#endif + dev->dev_addr ); spin_unlock_irqrestore(&tp->lock, flags); @@ -1535,7 +1590,7 @@ u8 OcpRegNum = 0; u16 OcpPhyAddress = 0; - if( PageNum == 0 ) { + if ( PageNum == 0 ) { OcpPageNum = OCP_STD_PHY_BASE_PAGE + ( RegNum / 8 ); OcpRegNum = 0x10 + ( RegNum % 8 ); } else { @@ -1545,7 +1600,7 @@ OcpPageNum <<= 4; - if( OcpRegNum < 16 ) { + if ( OcpRegNum < 16 ) { OcpPhyAddress = 0; } else { OcpRegNum -= 16; @@ -1613,7 +1668,8 @@ tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { if (RegAddr == 0x1F) { return; } @@ -1719,7 +1775,8 @@ tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { value = mdio_read_phy_ocp(tp, tp->cur_page, RegAddr); } else { if (tp->mcfg == CFG_METHOD_12 || tp->mcfg == CFG_METHOD_13) @@ -1854,17 +1911,23 @@ return value2; } -u32 OCP_read(struct rtl8168_private *tp, u16 addr, u8 len) +u32 OCP_read_with_oob_base_address(struct rtl8168_private *tp, u16 addr, u8 len, const u32 base_address) { void __iomem *ioaddr = tp->mmio_addr; + + return rtl8168_eri_read_with_oob_base_address(ioaddr, addr, len, ERIAR_OOB, base_address); +} + +u32 OCP_read(struct rtl8168_private *tp, u16 addr, u8 len) +{ u32 value = 0; - if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || - tp->mcfg == CFG_METHOD_28) { - value = rtl8168_eri_read(ioaddr, addr, len, ERIAR_OOB); - } else { + if (HW_DASH_SUPPORT_TYPE_2(tp)) + value = OCP_read_with_oob_base_address(tp, addr, len, NO_BASE_ADDRESS); + else if (HW_DASH_SUPPORT_TYPE_3(tp)) + value = OCP_read_with_oob_base_address(tp, addr, len, RTL8168FP_OOBMAC_BASE); + else value = real_ocp_read(tp, addr, len); - } return value; } @@ -1915,16 +1978,21 @@ return 0; } -void OCP_write(struct rtl8168_private *tp, u16 addr, u8 len, u32 value) +u32 OCP_write_with_oob_base_address(struct rtl8168_private *tp, u16 addr, u8 len, u32 value, const u32 base_address) { void __iomem *ioaddr = tp->mmio_addr; - if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || - tp->mcfg == CFG_METHOD_28) { - rtl8168_eri_write(ioaddr, addr, len, value, ERIAR_OOB); - } else { + return rtl8168_eri_write_with_oob_base_address(ioaddr, addr, len, value, ERIAR_OOB, base_address); +} + +void OCP_write(struct rtl8168_private *tp, u16 addr, u8 len, u32 value) +{ + if (HW_DASH_SUPPORT_TYPE_2(tp)) + OCP_write_with_oob_base_address(tp, addr, len, value, NO_BASE_ADDRESS); + else if (HW_DASH_SUPPORT_TYPE_3(tp)) + OCP_write_with_oob_base_address(tp, addr, len, value, RTL8168FP_OOBMAC_BASE); + else real_ocp_write(tp, addr, len, value); - } } void OOB_mutex_lock(struct rtl8168_private *tp) @@ -1935,6 +2003,8 @@ u16 ocp_reg_mutex_oob; u16 ocp_reg_mutex_prio; + if (!tp->DASH) return; + switch (tp->mcfg) { case CFG_METHOD_11: case CFG_METHOD_12: @@ -1950,6 +2020,8 @@ case CFG_METHOD_23: case CFG_METHOD_27: case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: default: ocp_reg_mutex_oob = 0x110; ocp_reg_mutex_ib = 0x114; @@ -1962,7 +2034,7 @@ wait_cnt_0 = 0; while(reg_16) { reg_a0 = OCP_read(tp, ocp_reg_mutex_prio, 1); - if(reg_a0) { + if (reg_a0) { OCP_write(tp, ocp_reg_mutex_ib, 1, 0x00); reg_a0 = OCP_read(tp, ocp_reg_mutex_prio, 1); wait_Cnt_1 = 0; @@ -1971,7 +2043,7 @@ wait_Cnt_1++; - if(wait_Cnt_1 > 2000) + if (wait_Cnt_1 > 2000) break; }; OCP_write(tp, ocp_reg_mutex_ib, 1, BIT_0); @@ -1981,7 +2053,7 @@ wait_cnt_0++; - if(wait_cnt_0 > 2000) + if (wait_cnt_0 > 2000) break; }; } @@ -1992,6 +2064,8 @@ u16 ocp_reg_mutex_oob; u16 ocp_reg_mutex_prio; + if (!tp->DASH) return; + switch (tp->mcfg) { case CFG_METHOD_11: case CFG_METHOD_12: @@ -2007,6 +2081,8 @@ case CFG_METHOD_23: case CFG_METHOD_27: case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: default: ocp_reg_mutex_oob = 0x110; ocp_reg_mutex_ib = 0x114; @@ -2029,8 +2105,7 @@ static int rtl8168_check_dash(struct rtl8168_private *tp) { - if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || - tp->mcfg == CFG_METHOD_28) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { if (OCP_read(tp, 0x128, 1) & BIT_0) return 1; else @@ -2052,23 +2127,21 @@ void Dash2DisableTx(struct rtl8168_private *tp) { - void __iomem *ioaddr = tp->mmio_addr; - if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { u16 WaitCnt; u8 TmpUchar; //Disable oob Tx - RTL_W8(IBCR2, RTL_R8(IBCR2) & ~( BIT_0 )); + RTL_CMAC_W8(CMAC_IBCR2, RTL_CMAC_R8(CMAC_IBCR2) & ~( BIT_0 )); WaitCnt = 0; //wait oob tx disable do { - TmpUchar = RTL_R8(IBISR0); + TmpUchar = RTL_CMAC_R8(CMAC_IBISR0); - if( TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE ) { + if ( TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE ) { break; } @@ -2077,45 +2150,42 @@ } while(WaitCnt < 2000); //Clear ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE - RTL_W8(IBISR0, RTL_R8(IBISR0) | ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE); + RTL_CMAC_W8(CMAC_IBISR0, RTL_CMAC_R8(CMAC_IBISR0) | ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE); } } void Dash2EnableTx(struct rtl8168_private *tp) { - void __iomem *ioaddr = tp->mmio_addr; - if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) - RTL_W8(IBCR2, RTL_R8(IBCR2) | BIT_0); + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(CMAC_IBCR2, RTL_CMAC_R8(CMAC_IBCR2) | BIT_0); + } } void Dash2DisableRx(struct rtl8168_private *tp) { - void __iomem *ioaddr = tp->mmio_addr; - if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) - RTL_W8(IBCR0, RTL_R8(IBCR0) & ~( BIT_0 )); + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(CMAC_IBCR0, RTL_CMAC_R8(CMAC_IBCR0) & ~( BIT_0 )); + } } void Dash2EnableRx(struct rtl8168_private *tp) { - void __iomem *ioaddr = tp->mmio_addr; - if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) - RTL_W8(IBCR0, RTL_R8(IBCR0) | BIT_0); + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(CMAC_IBCR0, RTL_CMAC_R8(CMAC_IBCR0) | BIT_0); + } } static void Dash2DisableTxRx(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { Dash2DisableTx( tp ); Dash2DisableRx( tp ); } @@ -2128,8 +2198,7 @@ if (!tp->DASH) return; - if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || - tp->mcfg == CFG_METHOD_28) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { int timeout; u32 tmp_value; @@ -2173,8 +2242,7 @@ if (!tp->DASH) return; - if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || - tp->mcfg == CFG_METHOD_28) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { struct net_device *dev = tp->dev; int timeout; u32 tmp_value; @@ -2300,11 +2368,12 @@ if (tp->mcfg != CFG_METHOD_20 && tp->mcfg != CFG_METHOD_23 && tp->mcfg != CFG_METHOD_26 && tp->mcfg != CFG_METHOD_27 && - tp->mcfg != CFG_METHOD_28) { + tp->mcfg != CFG_METHOD_28 && tp->mcfg != CFG_METHOD_31 && + tp->mcfg != CFG_METHOD_32) { multi_fun_sel_bit = 0; } - if( multi_fun_sel_bit > 7 ) { + if ( multi_fun_sel_bit > 7 ) { return 0xffffffff; } @@ -2341,11 +2410,12 @@ cmd = CSIAR_Write | CSIAR_ByteEn << CSIAR_ByteEn_shift | (addr & CSIAR_Addr_Mask); if (tp->mcfg != CFG_METHOD_20 && tp->mcfg != CFG_METHOD_23 && tp->mcfg != CFG_METHOD_26 && tp->mcfg != CFG_METHOD_27 && - tp->mcfg != CFG_METHOD_28) { + tp->mcfg != CFG_METHOD_28 && tp->mcfg != CFG_METHOD_31 && + tp->mcfg != CFG_METHOD_32) { multi_fun_sel_bit = 0; } - if( multi_fun_sel_bit > 7 ) { + if ( multi_fun_sel_bit > 7 ) { return; } @@ -2372,12 +2442,12 @@ if (tp->mcfg == CFG_METHOD_20) multi_fun_sel_bit = 2; - else if (tp->mcfg == CFG_METHOD_26) + else if (tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_31 || + tp->mcfg == CFG_METHOD_32) multi_fun_sel_bit = 1; else multi_fun_sel_bit = 0; - return rtl8168_csi_other_fun_read(tp, multi_fun_sel_bit, addr); } @@ -2390,7 +2460,8 @@ if (tp->mcfg == CFG_METHOD_20) multi_fun_sel_bit = 2; - else if (tp->mcfg == CFG_METHOD_26) + else if (tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_31 || + tp->mcfg == CFG_METHOD_32) multi_fun_sel_bit = 1; else multi_fun_sel_bit = 0; @@ -2404,7 +2475,8 @@ { u8 RetVal = 0; - if (tp->mcfg == CFG_METHOD_20 || tp->mcfg == CFG_METHOD_26) { + if (tp->mcfg == CFG_METHOD_20 || tp->mcfg == CFG_METHOD_26 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { u32 TmpUlong; u16 RegAlignAddr; u8 ShiftByte; @@ -2430,7 +2502,8 @@ u32 addr, u8 value) { - if (tp->mcfg == CFG_METHOD_20 || tp->mcfg == CFG_METHOD_26) { + if (tp->mcfg == CFG_METHOD_20 || tp->mcfg == CFG_METHOD_26 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { u32 TmpUlong; u16 RegAlignAddr; u8 ShiftByte; @@ -2450,11 +2523,70 @@ udelay(20); } -u32 rtl8168_eri_read(void __iomem *ioaddr, int addr, int len, int type) +static void +rtl8168_csi_set_dash_other_fun(struct rtl8168_private *tp, + u16 addr, + u32 clearmask, + u32 setmask, + u8 goto_d3) +{ + u8 multi_fun_sel_bit; + u32 TmpUlong; + + switch(tp->mcfg) { + case CFG_METHOD_23: + case CFG_METHOD_27: + case CFG_METHOD_28: + for (multi_fun_sel_bit = 1; multi_fun_sel_bit < 4; multi_fun_sel_bit++) { + TmpUlong = rtl8168_csi_other_fun_read(tp, multi_fun_sel_bit, addr); + TmpUlong &= ~clearmask; + TmpUlong |= setmask; + rtl8168_csi_other_fun_write(tp, multi_fun_sel_bit, addr, TmpUlong); + } + break; + case CFG_METHOD_31: + case CFG_METHOD_32: + for (multi_fun_sel_bit = 0; multi_fun_sel_bit < 8; multi_fun_sel_bit++) { + u8 set_other_fun = FALSE; + + if (multi_fun_sel_bit == 1) { + set_other_fun = FALSE; + } else if (multi_fun_sel_bit == 0 || multi_fun_sel_bit == 2 || multi_fun_sel_bit == 7) { + if (goto_d3) + set_other_fun = TRUE; + } else if (multi_fun_sel_bit == 3 || multi_fun_sel_bit == 4) { + TmpUlong = rtl8168_csi_other_fun_read(tp, multi_fun_sel_bit, 0xF000); + if (TmpUlong == 0xFFFFFFFF) + set_other_fun = TRUE; + else + set_other_fun = FALSE; + } else { //func 5, 6 + if (tp->DASH) { + TmpUlong = mac_ocp_read(tp, 0x184); + if (TmpUlong & BIT_26) + set_other_fun = FALSE; + else + set_other_fun = TRUE; + } + } + + if (set_other_fun) { + TmpUlong = rtl8168_csi_other_fun_read(tp, multi_fun_sel_bit, addr); + TmpUlong &= ~clearmask; + TmpUlong |= setmask; + rtl8168_csi_other_fun_write(tp, multi_fun_sel_bit, addr, TmpUlong); + } + } + break; + } +} + +u32 rtl8168_eri_read_with_oob_base_address(void __iomem *ioaddr, int addr, int len, int type, const u32 base_address) { int i, val_shift, shift = 0; u32 value1 = 0, value2 = 0, mask; u32 eri_cmd; + const u32 transformed_base_address = ((base_address & 0x00FFF000) << 6) | (base_address & 0x000FFF); if (len > 4 || len <= 0) return -1; @@ -2464,6 +2596,7 @@ addr = addr & ~0x3; eri_cmd = ERIAR_Read | + transformed_base_address | type << ERIAR_Type_shift | ERIAR_ByteEn << ERIAR_ByteEn_shift | (addr & 0x0FFF); @@ -2507,12 +2640,17 @@ return value2; } -int rtl8168_eri_write(void __iomem *ioaddr, int addr, int len, u32 value, int type) +u32 rtl8168_eri_read(void __iomem *ioaddr, int addr, int len, int type) { + return rtl8168_eri_read_with_oob_base_address(ioaddr, addr, len, type, 0); +} +int rtl8168_eri_write_with_oob_base_address(void __iomem *ioaddr, int addr, int len, u32 value, int type, const u32 base_address) +{ int i, val_shift, shift = 0; u32 value1 = 0, mask; u32 eri_cmd; + const u32 transformed_base_address = ((base_address & 0x00FFF000) << 6) | (base_address & 0x000FFF); if (len > 4 || len <= 0) return -1; @@ -2526,12 +2664,13 @@ else if (len == 3) mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF; else mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF; - value1 = rtl8168_eri_read(ioaddr, addr, 4, type) & ~mask; + value1 = rtl8168_eri_read_with_oob_base_address(ioaddr, addr, 4, type, base_address) & ~mask; value1 |= ((value << val_shift * 8) >> shift * 8); RTL_W32(ERIDR, value1); eri_cmd = ERIAR_Write | + transformed_base_address | type << ERIAR_Type_shift | ERIAR_ByteEn << ERIAR_ByteEn_shift | (addr & 0x0FFF); @@ -2567,6 +2706,11 @@ return 0; } +int rtl8168_eri_write(void __iomem *ioaddr, int addr, int len, u32 value, int type) +{ + return rtl8168_eri_write_with_oob_base_address(ioaddr, addr, len, value, type, NO_BASE_ADDRESS); +} + static void rtl8168_enable_rxdvgate(struct net_device *dev) { @@ -2584,6 +2728,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(0xF2, RTL_R8(0xF2) | BIT_3); mdelay(2); break; @@ -2607,12 +2753,117 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(0xF2, RTL_R8(0xF2) & ~BIT_3); mdelay(2); break; } } +static u8 +rtl8168_is_gpio_low(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + u8 gpio_low = FALSE; + + switch (tp->HwSuppCheckPhyDisableModeVer) { + case 1: + case 2: + if (!(mac_ocp_read(tp, 0xDC04) & BIT_9)) + gpio_low = TRUE; + break; + case 3: + if (!(mac_ocp_read(tp, 0xDC04) & BIT_13)) + gpio_low = TRUE; + break; + } + + if (gpio_low) + dprintk("gpio is low.\n"); + + return gpio_low; +} + +static u8 +rtl8168_is_phy_disable_mode_enabled(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + u8 phy_disable_mode_enabled = FALSE; + + switch (tp->HwSuppCheckPhyDisableModeVer) { + case 1: + if (mac_ocp_read(tp, 0xDC20) & BIT_1) + phy_disable_mode_enabled = TRUE; + break; + case 2: + case 3: + if (RTL_R8(0xF2) & BIT_5) + phy_disable_mode_enabled = TRUE; + break; + } + + if (phy_disable_mode_enabled) + dprintk("phy disable mode enabled.\n"); + + return phy_disable_mode_enabled; +} + +static u8 +rtl8168_is_in_phy_disable_mode(struct net_device *dev) +{ + u8 in_phy_disable_mode = FALSE; + + if (rtl8168_is_phy_disable_mode_enabled(dev) && rtl8168_is_gpio_low(dev)) + in_phy_disable_mode = TRUE; + + if (in_phy_disable_mode) + dprintk("Hardware is in phy disable mode.\n"); + + return in_phy_disable_mode; +} + +static void +rtl8168_enable_phy_disable_mode(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + + switch (tp->HwSuppCheckPhyDisableModeVer) { + case 1: + mac_ocp_write(tp, 0xDC20, mac_ocp_read(tp, 0xDC20) | BIT_1); + break; + case 2: + case 3: + RTL_W8(0xF2, RTL_R8(0xF2) | BIT_5); + break; + } + + dprintk("enable phy disable mode.\n"); +} + +static void +rtl8168_disable_phy_disable_mode(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + + switch (tp->HwSuppCheckPhyDisableModeVer) { + case 1: + mac_ocp_write(tp, 0xDC20, mac_ocp_read(tp, 0xDC20) & ~BIT_1); + break; + case 2: + case 3: + RTL_W8(0xF2, RTL_R8(0xF2) & ~BIT_5); + break; + } + + mdelay(1); + + dprintk("disable phy disable mode.\n"); +} + void rtl8168_wait_txrx_fifo_empty(struct net_device *dev) { @@ -2631,6 +2882,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: for (i = 0; i < 10; i++) { udelay(100); if (RTL_R32(TxConfig) & BIT_11) @@ -2654,8 +2907,9 @@ { if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) - RTL_W8(IBIMR0, ( ISRIMR_DASH_TYPE2_ROK | ISRIMR_DASH_TYPE2_TOK | ISRIMR_DASH_TYPE2_TDU | ISRIMR_DASH_TYPE2_RDU | ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE )); + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(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 @@ -2663,8 +2917,9 @@ { if (!tp->DASH) return; - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) - RTL_W8(IBIMR0, 0); + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(CMAC_IBIMR0, 0); + } } #endif @@ -2720,14 +2975,21 @@ rtl8168_irq_mask_and_ack(struct rtl8168_private *tp, void __iomem *ioaddr) { rtl8168_disable_hw_interrupt(tp, ioaddr); - RTL_W16(IntrStatus, RTL_R16(IntrStatus)); - #ifdef ENABLE_DASH_SUPPORT - if ( tp->DASH ) { - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { - RTL_W8(IBISR0, RTL_R16(IBISR0)); + if (tp->DASH) { + if (tp->dash_printer_enabled) { + RTL_W16(IntrStatus, RTL_R16(IntrStatus) & + ~(ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET)); + } else { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { + RTL_CMAC_W8(CMAC_IBISR0, RTL_CMAC_R8(CMAC_IBISR0)); + } } + } else { + RTL_W16(IntrStatus, RTL_R16(IntrStatus)); } +#else + RTL_W16(IntrStatus, RTL_R16(IntrStatus)); #endif } @@ -2778,6 +3040,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: mdelay(2); break; default: @@ -2855,6 +3119,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W32(TimeInt1, 0x0000); RTL_W32(TimeInt2, 0x0000); RTL_W32(TimeInt3, 0x0000); @@ -3005,6 +3271,11 @@ unsigned long flags; spin_lock_irqsave(&tp->phy_lock, flags); + if (rtl8168_is_in_phy_disable_mode(dev)) { + spin_unlock_irqrestore(&tp->phy_lock, flags); + return; + } + mdio_write(tp, 0x1f, 0x0000); mdio_write(tp, MII_ADVERTISE, mdio_read(tp, MII_ADVERTISE) & ~(ADVERTISE_10HALF | ADVERTISE_10FULL | @@ -3083,6 +3354,8 @@ break; case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: csi_tmp = rtl8168_eri_read(ioaddr, 0x1EA, 1, ERIAR_ExGMAC); csi_tmp |= BIT_0; rtl8168_eri_write(ioaddr, 0x1EA, 1, csi_tmp, ERIAR_ExGMAC); @@ -3100,7 +3373,7 @@ // // even disconnected, enable 3 dash interrupt mask bits for in-band/out-band communication // - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { rtl8168_enable_dash2_interrupt(tp, ioaddr); RTL_W16(IntrMask, (ISRIMR_DASH_INTR_EN | ISRIMR_DASH_INTR_CMAC_RESET)); } else { @@ -3125,6 +3398,8 @@ if (netif_carrier_ok(dev) != link_status_on) { if (link_status_on) { + rtl8168_hw_config(dev); + if (tp->mcfg == CFG_METHOD_18 || tp->mcfg == CFG_METHOD_19 || tp->mcfg == CFG_METHOD_20) { if (RTL_R8(PHYstatus) & _1000bpsF) { rtl8168_eri_write(ioaddr, 0x1bc, 4, 0x00000011, ERIAR_ExGMAC); @@ -3175,7 +3450,8 @@ tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) && + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) && netif_running(dev)) { if (RTL_R8(PHYstatus)&FullDup) RTL_W32(TxConfig, (RTL_R32(TxConfig) | (BIT_24 | BIT_25)) & ~BIT_19); @@ -3184,7 +3460,8 @@ } if (tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22 || - tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28) { + tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { /*half mode*/ if (!(RTL_R8(PHYstatus)&FullDup)) { spin_lock_irqsave(&tp->phy_lock, flags); @@ -3194,6 +3471,14 @@ } } + if ((tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) && (RTL_R8(PHYstatus) & _10bps)) { + u32 csi_tmp; + + csi_tmp = rtl8168_eri_read(ioaddr, 0x1D0, 1, ERIAR_ExGMAC); + csi_tmp |= BIT_1; + rtl8168_eri_write(ioaddr, 0x1D0, 1, csi_tmp, ERIAR_ExGMAC); + } + rtl8168_hw_start(dev); netif_carrier_on(dev); @@ -3307,6 +3592,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: csi_tmp = rtl8168_eri_read(ioaddr, 0x3F2, 2, ERIAR_ExGMAC); csi_tmp &= ~(BIT_0 | BIT_1); rtl8168_eri_write(ioaddr, 0x3F2, 2, csi_tmp, ERIAR_ExGMAC); @@ -3319,6 +3606,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_csi_fun0_write_byte(tp, 0x99, 0x00); break; } @@ -3336,6 +3625,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_csi_fun0_write_byte(tp, 0x99, tp->org_pci_offset_99); break; } @@ -3351,6 +3642,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: csi_tmp = rtl8168_eri_read(ioaddr, 0x3F2, 2, ERIAR_ExGMAC); csi_tmp &= ~(BIT_0 | BIT_1); if (!(tp->org_pci_offset_99 & (BIT_5 | BIT_6))) @@ -3389,6 +3682,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: csi_tmp = rtl8168_eri_read(ioaddr, 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 ); @@ -3409,14 +3704,19 @@ switch (tp->mcfg) { case CFG_METHOD_26: - case CFG_METHOD_29: - case CFG_METHOD_30: if (tp->org_pci_offset_99 & BIT_2) { csi_tmp = rtl8168_eri_read(ioaddr, 0x5C8, 1, ERIAR_ExGMAC); csi_tmp |= BIT_0; rtl8168_eri_write(ioaddr, 0x5C8, 1, csi_tmp, ERIAR_ExGMAC); } break; + case CFG_METHOD_29: + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: + if (tp->org_pci_offset_99 & BIT_2) + mac_ocp_write(tp, 0xE0A2, mac_ocp_read(tp, 0xE0A2) | BIT_0); + break; } switch (tp->mcfg) { @@ -3437,6 +3737,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_eri_write(ioaddr, 0x2E8, 2, 0x9003, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0x2EA, 2, 0x9003, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0x2EC, 2, 0x9003, ERIAR_ExGMAC); @@ -3486,6 +3788,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: csi_tmp = rtl8168_eri_read(ioaddr, 0x1E2, 1, ERIAR_ExGMAC); csi_tmp &= ~BIT_2; rtl8168_eri_write(ioaddr, 0x1E2, 1, csi_tmp, ERIAR_ExGMAC); @@ -3517,6 +3821,17 @@ csi_tmp &= ~(0x0000FF00); rtl8168_eri_write(ioaddr, 0x1E4, 4, csi_tmp, ERIAR_ExGMAC); break; + case CFG_METHOD_31: + case CFG_METHOD_32: + csi_tmp = rtl8168_eri_read(ioaddr, 0x1E8, 4, ERIAR_ExGMAC); + csi_tmp &= ~(0x0000FFF0); + csi_tmp |= (0x00000640); + rtl8168_eri_write(ioaddr, 0x1E8, 4, csi_tmp, ERIAR_ExGMAC); + + csi_tmp = rtl8168_eri_read(ioaddr, 0x1E4, 4, ERIAR_ExGMAC); + csi_tmp &= ~(0x0000FF00); + rtl8168_eri_write(ioaddr, 0x1E4, 4, csi_tmp, ERIAR_ExGMAC); + break; } switch (tp->mcfg) { @@ -3566,6 +3881,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_issue_offset_99_event(tp); break; } @@ -3581,6 +3898,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_disable_pci_offset_99(tp); break; } @@ -3592,6 +3911,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_disable_pci_offset_180(tp); break; } @@ -3640,6 +3961,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(0xF1, RTL_R8(0xF1) & ~BIT_7); rtl8168_enable_cfg9346_write(tp); RTL_W8(Config2, RTL_R8(Config2) & ~BIT_7); @@ -3663,7 +3986,8 @@ if (tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22 || tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || - tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28) { + tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { spin_lock_irqsave(&tp->phy_lock, flags); rtl8168_eri_write(ioaddr, 0x2F8, 2, 0x0064, ERIAR_ExGMAC); spin_unlock_irqrestore(&tp->phy_lock, flags); @@ -3694,13 +4018,19 @@ spin_unlock_irqrestore(&tp->phy_lock, flags); } } + if (tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { + spin_lock_irqsave(&tp->phy_lock, flags); + rtl8168_csi_set_dash_other_fun(tp, 0x44, 0x00, (BIT_0 | BIT_1), TRUE); + spin_unlock_irqrestore(&tp->phy_lock, flags); + } rtl8168_set_pci_99_180_exit_driver_para(dev); /*disable ocp phy power saving*/ if (tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { spin_lock_irqsave(&tp->phy_lock, flags); mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0000); mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0500); @@ -3819,8 +4149,6 @@ { WAKE_MAGIC, Config3, MagicPacket }, }; - rtl8168_enable_cfg9346_write(tp); - switch (tp->HwSuppMagicPktVer) { case WAKEUP_MAGIC_PACKET_V2: tmp = ARRAY_SIZE(cfg) - 1; @@ -3835,6 +4163,8 @@ break; } + rtl8168_enable_cfg9346_write(tp); + for (i = 0; i < tmp; i++) { u8 options = RTL_R8(cfg[i].reg) & ~cfg[i].mask; if (wolopts & cfg[i].opt) @@ -3846,6 +4176,49 @@ } static void +rtl8168_phy_restart_nway(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + if (rtl8168_is_in_phy_disable_mode(dev)) return; + + mdio_write(tp, 0x1F, 0x0000); + mdio_write(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE | BMCR_ANRESTART); +} + +static void +rtl8168_phy_setup_force_mode(struct net_device *dev, u32 speed, u8 duplex) +{ + struct rtl8168_private *tp = netdev_priv(dev); + u16 bmcr_true_force = 0; + + if (rtl8168_is_in_phy_disable_mode(dev)) return; + +#ifndef BMCR_SPEED100 +#define BMCR_SPEED100 0x0040 +#endif + +#ifndef BMCR_SPEED10 +#define BMCR_SPEED10 0x0000 +#endif + if ((speed == SPEED_10) && (duplex == DUPLEX_HALF)) { + bmcr_true_force = BMCR_SPEED10; + } else if ((speed == SPEED_10) && (duplex == DUPLEX_FULL)) { + bmcr_true_force = BMCR_SPEED10 | BMCR_FULLDPLX; + } else if ((speed == SPEED_100) && (duplex == DUPLEX_HALF)) { + bmcr_true_force = BMCR_SPEED100; + } else if ((speed == SPEED_100) && (duplex == DUPLEX_FULL)) { + bmcr_true_force = BMCR_SPEED100 | BMCR_FULLDPLX; + } else { + netif_err(tp, drv, dev, "Failed to set phy force mode!\n"); + return; + } + + mdio_write(tp, 0x1F, 0x0000); + mdio_write(tp, MII_BMCR, bmcr_true_force); +} + +static void rtl8168_powerdown_pll(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); @@ -3864,7 +4237,8 @@ tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { rtl8168_enable_cfg9346_write(tp); RTL_W8(Config2, RTL_R8(Config2) | PMSTS_En); rtl8168_disable_cfg9346_write(tp); @@ -3896,7 +4270,7 @@ giga_ctrl = mdio_read(tp, MII_CTRL1000) & ~(ADVERTISE_1000HALF | ADVERTISE_1000FULL); mdio_write(tp, MII_ADVERTISE, auto_nego); mdio_write(tp, MII_CTRL1000, giga_ctrl); - mdio_write(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE | BMCR_ANRESTART); + rtl8168_phy_restart_nway(dev); spin_unlock_irqrestore(&tp->phy_lock, flags); RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | AcceptMulticast | AcceptMyPhys); @@ -3910,9 +4284,6 @@ if (((tp->mcfg == CFG_METHOD_7) || (tp->mcfg == CFG_METHOD_8)) && (RTL_R16(CPlusCmd) & ASF)) return; - if (tp->HwFiberModeVer != FIBER_MODE_NIC_ONLY) - return; - rtl8168_phy_power_down(dev); switch (tp->mcfg) { @@ -3935,6 +4306,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(PMCH, RTL_R8(PMCH) & ~BIT_7); break; } @@ -3974,6 +4347,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(PMCH, RTL_R8(PMCH) | BIT_7 | BIT_6); break; } @@ -4030,6 +4405,8 @@ spin_unlock_irqrestore(&tp->lock, flags); + device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts); + return 0; } @@ -4056,16 +4433,16 @@ static int rtl8168_set_speed_xmii(struct net_device *dev, u8 autoneg, - u16 speed, + u32 speed, u8 duplex) { struct rtl8168_private *tp = netdev_priv(dev); int auto_nego = 0; int giga_ctrl = 0; - int bmcr_true_force = 0; unsigned long flags; - if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { //Disable Giga Lite spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0A42); @@ -4125,31 +4502,13 @@ mdio_write(tp, 0x1f, 0x0000); mdio_write(tp, MII_ADVERTISE, auto_nego); mdio_write(tp, MII_CTRL1000, giga_ctrl); - mdio_write(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE | BMCR_ANRESTART); + rtl8168_phy_restart_nway(dev); spin_unlock_irqrestore(&tp->phy_lock, flags); mdelay(20); } else { /*true force*/ -#ifndef BMCR_SPEED100 -#define BMCR_SPEED100 0x0040 -#endif - -#ifndef BMCR_SPEED10 -#define BMCR_SPEED10 0x0000 -#endif - if ((speed == SPEED_10) && (duplex == DUPLEX_HALF)) { - bmcr_true_force = BMCR_SPEED10; - } else if ((speed == SPEED_10) && (duplex == DUPLEX_FULL)) { - bmcr_true_force = BMCR_SPEED10 | BMCR_FULLDPLX; - } else if ((speed == SPEED_100) && (duplex == DUPLEX_HALF)) { - bmcr_true_force = BMCR_SPEED100; - } else if ((speed == SPEED_100) && (duplex == DUPLEX_FULL)) { - bmcr_true_force = BMCR_SPEED100 | BMCR_FULLDPLX; - } - spin_lock_irqsave(&tp->phy_lock, flags); - mdio_write(tp, 0x1f, 0x0000); - mdio_write(tp, MII_BMCR, bmcr_true_force); + rtl8168_phy_setup_force_mode(dev, speed, duplex); spin_unlock_irqrestore(&tp->phy_lock, flags); } @@ -4166,7 +4525,7 @@ static int rtl8168_set_speed(struct net_device *dev, u8 autoneg, - u16 speed, + u32 speed, u8 duplex) { struct rtl8168_private *tp = netdev_priv(dev); @@ -4180,14 +4539,33 @@ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) static int rtl8168_set_settings(struct net_device *dev, - struct ethtool_cmd *cmd) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + struct ethtool_cmd *cmd +#else + const struct ethtool_link_ksettings *cmd +#endif + ) { struct rtl8168_private *tp = netdev_priv(dev); int ret; unsigned long flags; + u8 autoneg; + u32 speed; + u8 duplex; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + autoneg = cmd->autoneg; + speed = cmd->speed; + duplex = cmd->duplex; +#else + const struct ethtool_link_settings *base = &cmd->base; + autoneg = base->autoneg; + speed = base->speed; + duplex = base->duplex; +#endif spin_lock_irqsave(&tp->lock, flags); - ret = rtl8168_set_speed(dev, cmd->autoneg, cmd->speed, cmd->duplex); + ret = rtl8168_set_speed(dev, autoneg, speed, duplex); spin_unlock_irqrestore(&tp->lock, flags); return ret; @@ -4464,63 +4842,90 @@ #endif static void rtl8168_gset_xmii(struct net_device *dev, - struct ethtool_cmd *cmd) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + struct ethtool_cmd *cmd +#else + struct ethtool_link_ksettings *cmd +#endif + ) { struct rtl8168_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; u8 status; + u8 autoneg, duplex; + u32 speed = 0; + u32 supported, advertising; unsigned long flags; - cmd->supported = SUPPORTED_10baseT_Half | - SUPPORTED_10baseT_Full | - SUPPORTED_100baseT_Half | - SUPPORTED_100baseT_Full | - SUPPORTED_1000baseT_Full | - SUPPORTED_Autoneg | - SUPPORTED_TP; + supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg | + SUPPORTED_TP; spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0000); - cmd->autoneg = (mdio_read(tp, MII_BMCR) & BMCR_ANENABLE) ? 1 : 0; + autoneg = (mdio_read(tp, MII_BMCR) & BMCR_ANENABLE) ? 1 : 0; spin_unlock_irqrestore(&tp->phy_lock, flags); - cmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg; + advertising = ADVERTISED_TP | ADVERTISED_Autoneg; if (tp->phy_auto_nego_reg & ADVERTISE_10HALF) - cmd->advertising |= ADVERTISED_10baseT_Half; + advertising |= ADVERTISED_10baseT_Half; if (tp->phy_auto_nego_reg & ADVERTISE_10FULL) - cmd->advertising |= ADVERTISED_10baseT_Full; + advertising |= ADVERTISED_10baseT_Full; if (tp->phy_auto_nego_reg & ADVERTISE_100HALF) - cmd->advertising |= ADVERTISED_100baseT_Half; + advertising |= ADVERTISED_100baseT_Half; if (tp->phy_auto_nego_reg & ADVERTISE_100FULL) - cmd->advertising |= ADVERTISED_100baseT_Full; + advertising |= ADVERTISED_100baseT_Full; if (tp->phy_1000_ctrl_reg & ADVERTISE_1000FULL) - cmd->advertising |= ADVERTISED_1000baseT_Full; + advertising |= ADVERTISED_1000baseT_Full; status = RTL_R8(PHYstatus); if (status & _1000bpsF) - cmd->speed = SPEED_1000; + speed = SPEED_1000; else if (status & _100bps) - cmd->speed = SPEED_100; + speed = SPEED_100; else if (status & _10bps) - cmd->speed = SPEED_10; + speed = SPEED_10; if (status & TxFlowCtrl) - cmd->advertising |= ADVERTISED_Asym_Pause; + advertising |= ADVERTISED_Asym_Pause; if (status & RxFlowCtrl) - cmd->advertising |= ADVERTISED_Pause; - - cmd->duplex = ((status & _1000bpsF) || (status & FullDup)) ? - DUPLEX_FULL : DUPLEX_HALF; + advertising |= ADVERTISED_Pause; + duplex = ((status & _1000bpsF) || (status & FullDup)) ? + DUPLEX_FULL : DUPLEX_HALF; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + cmd->supported = supported; + cmd->advertising = advertising; + cmd->autoneg = autoneg; + cmd->speed = speed; + cmd->duplex = duplex; +#else + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, + supported); + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, + advertising); + cmd->base.autoneg = autoneg; + cmd->base.speed = speed; + cmd->base.duplex = duplex; +#endif } #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) static int rtl8168_get_settings(struct net_device *dev, - struct ethtool_cmd *cmd) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + struct ethtool_cmd *cmd +#else + struct ethtool_link_ksettings *cmd +#endif + ) { struct rtl8168_private *tp = netdev_priv(dev); @@ -4816,13 +5221,147 @@ } #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) +static int +rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *eee) +{ + struct rtl8168_private *tp = netdev_priv(net); + void __iomem *ioaddr = tp->mmio_addr; + u32 lp, adv, supported = 0; + unsigned long flags; + u16 val; + + switch (tp->mcfg) { + case CFG_METHOD_27: + case CFG_METHOD_28: + break; + default: + return -EOPNOTSUPP; + } + + if (unlikely(tp->rtk_enable_diag)) + return -EBUSY; + + spin_lock_irqsave(&tp->phy_lock, flags); + + mdio_write(tp, 0x1F, 0x0A5C); + val = mdio_read(tp, 0x12); + supported = mmd_eee_cap_to_ethtool_sup_t(val); + + mdio_write(tp, 0x1F, 0x0A5D); + val = mdio_read(tp, 0x10); + adv = mmd_eee_adv_to_ethtool_adv_t(val); + + val = mdio_read(tp, 0x11); + lp = mmd_eee_adv_to_ethtool_adv_t(val); + + val = rtl8168_eri_read(ioaddr, 0x1B0, 2, ERIAR_ExGMAC); + val &= BIT_1 | BIT_0; + + mdio_write(tp, 0x1F, 0x0000); + spin_unlock_irqrestore(&tp->phy_lock, flags); + + eee->eee_enabled = !!val; + eee->eee_active = !!(supported & adv & lp); + eee->supported = supported; + eee->advertised = adv; + eee->lp_advertised = lp; + + return 0; +} + +static int +rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *eee) +{ + struct rtl8168_private *tp = netdev_priv(net); + void __iomem *ioaddr = tp->mmio_addr; + unsigned long flags; + u32 data; + + switch (tp->mcfg) { + case CFG_METHOD_27: + case CFG_METHOD_28: + break; + default: + return -EOPNOTSUPP; + } + + if (unlikely(tp->rtk_enable_diag)) + return -EBUSY; + + spin_lock_irqsave(&tp->phy_lock, flags); + + data = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + if (eee->eee_enabled) { + data |= BIT_1 | BIT_0; + rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + mdio_write(tp, 0x1F, 0x0A43); + data = mdio_read(tp, 0x11); + mdio_write(tp, 0x11, data | BIT_4); + data = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); + mdio_write(tp, 0x1F, 0x0A5D); + mdio_write(tp, 0x10, data); + } else { + data &= ~(BIT_1 | BIT_0); + rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + mdio_write(tp, 0x1F, 0x0A43); + data = mdio_read(tp, 0x11); + mdio_write(tp, 0x11, data & ~BIT_4); + mdio_write(tp, 0x1F, 0x0A5D); + mdio_write(tp, 0x10, 0x0000); + } + + mdio_write(tp, 0x1F, 0x0000); + data = mdio_read(tp, MII_BMCR); + data |= BMCR_RESET; + mdio_write(tp, MII_BMCR, data); + + spin_unlock_irqrestore(&tp->phy_lock, flags); + + return 0; +} +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ + +static int rtl_nway_reset(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + unsigned long flags; + int ret, bmcr; + + if (unlikely(tp->rtk_enable_diag)) + return -EBUSY; + + spin_lock_irqsave(&tp->phy_lock, flags); + + /* if autoneg is off, it's an error */ + mdio_write(tp, 0x1F, 0x0000); + bmcr = mdio_read(tp, MII_BMCR); + + if (bmcr & BMCR_ANENABLE) { + bmcr |= BMCR_ANRESTART; + mdio_write(tp, MII_BMCR, bmcr); + ret = 0; + } else { + ret = -EINVAL; + } + + spin_unlock_irqrestore(&tp->phy_lock, flags); + + return ret; +} + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) static const struct ethtool_ops rtl8168_ethtool_ops = { .get_drvinfo = rtl8168_get_drvinfo, .get_regs_len = rtl8168_get_regs_len, .get_link = ethtool_op_get_link, +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) .get_settings = rtl8168_get_settings, .set_settings = rtl8168_set_settings, +#else + .get_link_ksettings = rtl8168_get_settings, + .set_link_ksettings = rtl8168_set_settings, +#endif .get_msglevel = rtl8168_get_msglevel, .set_msglevel = rtl8168_set_msglevel, #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) @@ -4857,6 +5396,11 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) .get_ts_info = ethtool_op_get_ts_info, #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) + .get_eee = rtl_ethtool_get_eee, + .set_eee = rtl_ethtool_set_eee, +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ + .nway_reset = rtl_nway_reset, }; #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) @@ -4866,6 +5410,7 @@ int ret; u16 data; u16 PhyRegValue; + u32 csi_tmp; u32 WaitCnt; unsigned long flags; @@ -4908,8 +5453,8 @@ case CFG_METHOD_16: case CFG_METHOD_17: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr,0x1B0 ,4,ERIAR_ExGMAC) | 0x0003; - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC) | 0x0003; + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp,0x1F , 0x0004); mdio_write(tp,0x1F , 0x0007); mdio_write(tp,0x1E , 0x0020); @@ -4933,9 +5478,9 @@ case CFG_METHOD_19: case CFG_METHOD_20: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr,0x1B0 ,4,ERIAR_ExGMAC); - data |= BIT_1 | BIT_0; - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + csi_tmp |= BIT_1 | BIT_0; + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp, 0x1F, 0x0007); mdio_write(tp, 0x1e, 0x0020); data = mdio_read(tp, 0x15); @@ -4965,10 +5510,12 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); - data |= BIT_1 | BIT_0; - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + csi_tmp |= BIT_1 | BIT_0; + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp, 0x1F, 0x0A43); data = mdio_read(tp, 0x11); mdio_write(tp, 0x11, data | BIT_4); @@ -5004,6 +5551,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp,0x1F, 0x0B82); SetEthPhyBit(tp, 0x10, BIT_4); @@ -5099,6 +5648,25 @@ mdio_write(tp, 0x11, data); spin_unlock_irqrestore(&tp->phy_lock, flags); break; + case CFG_METHOD_31: + case CFG_METHOD_32: + OOB_mutex_lock(tp); + data = mac_ocp_read(tp, 0xE052); + data |= BIT_0; + mac_ocp_write(tp, 0xE052, data); + OOB_mutex_unlock(tp); + + spin_lock_irqsave(&tp->phy_lock, flags); + mdio_write(tp, 0x1F, 0x0A43); + data = mdio_read(tp, 0x10) | BIT_15; + mdio_write(tp, 0x10, data); + + mdio_write(tp, 0x1F, 0x0A44); + data = mdio_read(tp, 0x11) | BIT_13 | BIT_14; + data &= ~(BIT_12); + mdio_write(tp, 0x11, data); + spin_unlock_irqrestore(&tp->phy_lock, flags); + break; } switch (tp->mcfg) { @@ -5107,6 +5675,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0B82); ClearEthPhyBit(tp, 0x10, BIT_4); @@ -5124,6 +5694,7 @@ int ret; u16 data; u16 PhyRegValue; + u32 csi_tmp; u32 WaitCnt; unsigned long flags; @@ -5165,8 +5736,8 @@ case CFG_METHOD_16: case CFG_METHOD_17: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr,0x1B0 ,4,ERIAR_ExGMAC)& ~0x0003; - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0,4, ERIAR_ExGMAC)& ~0x0003; + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp, 0x1F, 0x0005); mdio_write(tp, 0x05, 0x8B85); data = mdio_read(tp, 0x06) & ~0x2000; @@ -5191,9 +5762,9 @@ case CFG_METHOD_19: case CFG_METHOD_20: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr,0x1B0 ,4,ERIAR_ExGMAC); - data &= ~(BIT_1 | BIT_0); - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + csi_tmp &= ~(BIT_1 | BIT_0); + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp, 0x1F, 0x0005); mdio_write(tp, 0x05, 0x8B85); data = mdio_read(tp, 0x06); @@ -5224,10 +5795,12 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); - data = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); - data &= ~(BIT_1 | BIT_0); - rtl8168_eri_write(ioaddr, 0x1B0, 4, data, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + csi_tmp &= ~(BIT_1 | BIT_0); + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); mdio_write(tp, 0x1F, 0x0A43); data = mdio_read(tp, 0x11); mdio_write(tp, 0x11, data & ~BIT_4); @@ -5263,6 +5836,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp,0x1F, 0x0B82); SetEthPhyBit(tp, 0x10, BIT_4); @@ -5315,6 +5890,8 @@ break; case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: data = mac_ocp_read(tp, 0xE052); data &= ~(BIT_0); mac_ocp_write(tp, 0xE052, data); @@ -5337,6 +5914,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0B82); ClearEthPhyBit(tp, 0x10, BIT_4); @@ -5400,21 +5979,34 @@ case CFG_METHOD_26: case CFG_METHOD_27: case CFG_METHOD_28: + spin_lock_irqsave(&tp->phy_lock, flags); + mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x8011); + SetEthPhyBit( tp, 0x14, BIT_14 ); + mdio_write(tp, 0x1F, 0x0A40); + mdio_write(tp, 0x1F, 0x0000); + mdio_write(tp, 0x00, 0x9200); + spin_unlock_irqrestore(&tp->phy_lock, flags); + break; case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x8045); + mdio_write(tp, 0x14, 0x0000); + mdio_write(tp, 0x13, 0x804d); + mdio_write(tp, 0x14, 0x1222); + mdio_write(tp, 0x13, 0x805d); + mdio_write(tp, 0x14, 0x0022); mdio_write(tp, 0x13, 0x8011); - if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { - SetEthPhyBit( tp, 0x14, BIT_15 ); - } else { - SetEthPhyBit( tp, 0x14, BIT_14 ); - } + SetEthPhyBit( tp, 0x14, BIT_15 ); mdio_write(tp, 0x1F, 0x0A40); + mdio_write(tp, 0x1F, 0x0000); mdio_write(tp, 0x00, 0x9200); spin_unlock_irqrestore(&tp->phy_lock, flags); break; - default: dev_printk(KERN_DEBUG, &tp->pci_dev->dev, "Not Support Green Feature\n"); break; @@ -5473,21 +6065,33 @@ case CFG_METHOD_26: case CFG_METHOD_27: case CFG_METHOD_28: + spin_lock_irqsave(&tp->phy_lock, flags); + mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x8011); + ClearEthPhyBit( tp, 0x14, BIT_14 ); + mdio_write(tp, 0x1F, 0x0A40); + mdio_write(tp, 0x00, 0x9200); + spin_unlock_irqrestore(&tp->phy_lock, flags); + break; case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: spin_lock_irqsave(&tp->phy_lock, flags); mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x8045); + mdio_write(tp, 0x14, 0x2444); + mdio_write(tp, 0x13, 0x804d); + mdio_write(tp, 0x14, 0x2444); + mdio_write(tp, 0x13, 0x805d); + mdio_write(tp, 0x14, 0x2444); mdio_write(tp, 0x13, 0x8011); - if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { - ClearEthPhyBit( tp, 0x14, BIT_15 ); - } else { - ClearEthPhyBit( tp, 0x14, BIT_14 ); - } + SetEthPhyBit( tp, 0x14, BIT_15 ); mdio_write(tp, 0x1F, 0x0A40); + mdio_write(tp, 0x1F, 0x0000); mdio_write(tp, 0x00, 0x9200); spin_unlock_irqrestore(&tp->phy_lock, flags); break; - default: dev_printk(KERN_DEBUG, &tp->pci_dev->dev, "Not Support Green Feature\n"); break; @@ -5503,7 +6107,7 @@ u32 reg,val32; u32 ICVerID; - val32 = RTL_R32(TxConfig) ; + val32 = RTL_R32(TxConfig); reg = val32 & 0x7c800000; ICVerID = val32 & 0x00700000; @@ -5672,6 +6276,18 @@ tp->efuse_ver = EFUSE_SUPPORT_V3; break; + case 0x54800000: + if (ICVerID == 0x00100000) { + tp->mcfg = CFG_METHOD_31; + } else if (ICVerID == 0x00200000) { + tp->mcfg = CFG_METHOD_32; + } else { + tp->mcfg = CFG_METHOD_32; + tp->HwIcVerUnknown = TRUE; + } + + tp->efuse_ver = EFUSE_SUPPORT_V3; + break; default: printk("unknown chip version (%x)\n",reg); tp->mcfg = CFG_METHOD_DEFAULT; @@ -5723,9 +6339,9 @@ u32 Dw17BitData; - if(tp->efuse_ver < 3) { + if (tp->efuse_ver < 3) { DeCodeDwCmd = (DwCmd>>(DummyPos+1))<<DummyPos; - if(DummyPos > 0) { + if (DummyPos > 0) { DeCodeDwCmd |= ((DwCmd<<(32-DummyPos))>>(32-DummyPos)); } } else { @@ -5735,7 +6351,7 @@ Dw17BitData <<= 16; Dw17BitData |= (DwCmd & 0x0000FFFF); DeCodeDwCmd = (Dw17BitData>>(DummyPos+1))<<DummyPos; - if(DummyPos > 0) { + if (DummyPos > 0) { DeCodeDwCmd |= ((Dw17BitData<<(32-DummyPos))>>(32-DummyPos)); } } @@ -5787,7 +6403,7 @@ temp = RTL_R32(EFUSEAR); temp = rtl8168_decode_efuse_cmd(tp, temp); - if(reg%2) { + if (reg%2) { temp >>= 8; efuse_data = (u8)temp; } else { @@ -5814,7 +6430,7 @@ temp = RTL_R32(EFUSEAR); temp = rtl8168_decode_efuse_cmd(tp, temp); - if(reg%2) { + if (reg%2) { temp >>= 8; efuse_data = (u8)temp; } else { @@ -5896,7 +6512,7 @@ { void __iomem *ioaddr = tp->mmio_addr; - if( tp->HwSuppNowIsOobVer == 1 ) { + if ( tp->HwSuppNowIsOobVer == 1 ) { RTL_W8(MCUCmd_reg, RTL_R8(MCUCmd_reg) | Now_is_oob); } } @@ -5906,7 +6522,7 @@ { void __iomem *ioaddr = tp->mmio_addr; - if( tp->HwSuppNowIsOobVer == 1 ) { + if ( tp->HwSuppNowIsOobVer == 1 ) { RTL_W8(MCUCmd_reg, RTL_R8(MCUCmd_reg) & ~Now_is_oob); } } @@ -5924,25 +6540,18 @@ case CFG_METHOD_23: case CFG_METHOD_27: case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: Dash2DisableTxRx(dev); break; } - switch (tp->mcfg) { - case CFG_METHOD_11: - case CFG_METHOD_12: - case CFG_METHOD_13: - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - if (tp->DASH) { - rtl8168_driver_stop(tp); - rtl8168_driver_start(tp); + if (tp->DASH) { + rtl8168_driver_stop(tp); + rtl8168_driver_start(tp); #ifdef ENABLE_DASH_SUPPORT - DashHwInit(dev); + DashHwInit(dev); #endif - } - break; } //Disable realwow function @@ -5982,6 +6591,8 @@ case CFG_METHOD_25: case CFG_METHOD_26: case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_eri_write(ioaddr, 0x174, 2, 0x00FF, ERIAR_ExGMAC); mac_ocp_write(tp, 0xE428, 0x0010); break; @@ -6023,6 +6634,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: DisableNowIsOob(tp); data16 = mac_ocp_read(tp, 0xE8DE) & ~BIT_14; @@ -6040,6 +6653,8 @@ switch (tp->mcfg) { case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: if (rtl8168_is_ups_resume(dev)) { unsigned long flags; @@ -6072,11 +6687,37 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_enable_cfg9346_write(tp); RTL_W8(Config5, RTL_R8(Config5) & ~BIT_0); RTL_W8(Config2, RTL_R8(Config2) & ~BIT_7); rtl8168_disable_cfg9346_write(tp); + break; + } + switch (tp->mcfg) { + case CFG_METHOD_29: + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: + mac_ocp_write(tp, 0xFC38, 0x0000); + break; + } + + switch (tp->mcfg) { + case CFG_METHOD_21: + case CFG_METHOD_22: + case CFG_METHOD_23: + 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: mac_ocp_write(tp, 0xFC28, 0x0000); mac_ocp_write(tp, 0xFC2A, 0x0000); mac_ocp_write(tp, 0xFC2C, 0x0000); @@ -6092,1353 +6733,2138 @@ } static void -rtl8168_hw_mac_mcu_config(struct net_device *dev) +rtl8168_set_mac_mcu_8168g_1(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); - if (tp->NotWrMcuPatchCode == TRUE) return; + mac_ocp_write(tp, 0xE43C, 0x0000); + mac_ocp_write(tp, 0xE43E, 0x0000); - if (tp->mcfg == CFG_METHOD_21) { - mac_ocp_write(tp, 0xE43C, 0x0000); - mac_ocp_write(tp, 0xE43E, 0x0000); - - mac_ocp_write(tp, 0xE434, 0x0004); - mac_ocp_write(tp, 0xE43C, 0x0004); - - rtl8168_hw_disable_mac_mcu_bps(dev); + mac_ocp_write(tp, 0xE434, 0x0004); + mac_ocp_write(tp, 0xE43C, 0x0004); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE01B ); + mac_ocp_write( tp, 0xF804, 0xE022 ); + mac_ocp_write( tp, 0xF806, 0xE094 ); + mac_ocp_write( tp, 0xF808, 0xE097 ); + mac_ocp_write( tp, 0xF80A, 0xE09A ); + mac_ocp_write( tp, 0xF80C, 0xE0B3 ); + mac_ocp_write( tp, 0xF80E, 0xE0BA ); + mac_ocp_write( tp, 0xF810, 0x49D2 ); + mac_ocp_write( tp, 0xF812, 0xF10D ); + mac_ocp_write( tp, 0xF814, 0x766C ); + mac_ocp_write( tp, 0xF816, 0x49E2 ); + mac_ocp_write( tp, 0xF818, 0xF00A ); + mac_ocp_write( tp, 0xF81A, 0x1EC0 ); + mac_ocp_write( tp, 0xF81C, 0x8EE1 ); + mac_ocp_write( tp, 0xF81E, 0xC60A ); + mac_ocp_write( tp, 0xF820, 0x77C0 ); + mac_ocp_write( tp, 0xF822, 0x4870 ); + mac_ocp_write( tp, 0xF824, 0x9FC0 ); + mac_ocp_write( tp, 0xF826, 0x1EA0 ); + mac_ocp_write( tp, 0xF828, 0xC707 ); + mac_ocp_write( tp, 0xF82A, 0x8EE1 ); + mac_ocp_write( tp, 0xF82C, 0x9D6C ); + mac_ocp_write( tp, 0xF82E, 0xC603 ); + mac_ocp_write( tp, 0xF830, 0xBE00 ); + mac_ocp_write( tp, 0xF832, 0xB416 ); + mac_ocp_write( tp, 0xF834, 0x0076 ); + mac_ocp_write( tp, 0xF836, 0xE86C ); + mac_ocp_write( tp, 0xF838, 0xC406 ); + mac_ocp_write( tp, 0xF83A, 0x7580 ); + mac_ocp_write( tp, 0xF83C, 0x4852 ); + mac_ocp_write( tp, 0xF83E, 0x8D80 ); + mac_ocp_write( tp, 0xF840, 0xC403 ); + mac_ocp_write( tp, 0xF842, 0xBC00 ); + mac_ocp_write( tp, 0xF844, 0xD3E0 ); + mac_ocp_write( tp, 0xF846, 0x02C8 ); + mac_ocp_write( tp, 0xF848, 0x8918 ); + mac_ocp_write( tp, 0xF84A, 0xE815 ); + mac_ocp_write( tp, 0xF84C, 0x1100 ); + mac_ocp_write( tp, 0xF84E, 0xF011 ); + mac_ocp_write( tp, 0xF850, 0xE812 ); + mac_ocp_write( tp, 0xF852, 0x4990 ); + mac_ocp_write( tp, 0xF854, 0xF002 ); + mac_ocp_write( tp, 0xF856, 0xE817 ); + mac_ocp_write( tp, 0xF858, 0xE80E ); + mac_ocp_write( tp, 0xF85A, 0x4992 ); + mac_ocp_write( tp, 0xF85C, 0xF002 ); + mac_ocp_write( tp, 0xF85E, 0xE80E ); + mac_ocp_write( tp, 0xF860, 0xE80A ); + mac_ocp_write( tp, 0xF862, 0x4993 ); + mac_ocp_write( tp, 0xF864, 0xF002 ); + mac_ocp_write( tp, 0xF866, 0xE818 ); + mac_ocp_write( tp, 0xF868, 0xE806 ); + mac_ocp_write( tp, 0xF86A, 0x4991 ); + mac_ocp_write( tp, 0xF86C, 0xF002 ); + mac_ocp_write( tp, 0xF86E, 0xE838 ); + mac_ocp_write( tp, 0xF870, 0xC25E ); + mac_ocp_write( tp, 0xF872, 0xBA00 ); + mac_ocp_write( tp, 0xF874, 0xC056 ); + mac_ocp_write( tp, 0xF876, 0x7100 ); + mac_ocp_write( tp, 0xF878, 0xFF80 ); + mac_ocp_write( tp, 0xF87A, 0x7100 ); + mac_ocp_write( tp, 0xF87C, 0x4892 ); + mac_ocp_write( tp, 0xF87E, 0x4813 ); + mac_ocp_write( tp, 0xF880, 0x8900 ); + mac_ocp_write( tp, 0xF882, 0xE00A ); + mac_ocp_write( tp, 0xF884, 0x7100 ); + mac_ocp_write( tp, 0xF886, 0x4890 ); + mac_ocp_write( tp, 0xF888, 0x4813 ); + mac_ocp_write( tp, 0xF88A, 0x8900 ); + mac_ocp_write( tp, 0xF88C, 0xC74B ); + mac_ocp_write( tp, 0xF88E, 0x74F8 ); + mac_ocp_write( tp, 0xF890, 0x48C2 ); + mac_ocp_write( tp, 0xF892, 0x4841 ); + mac_ocp_write( tp, 0xF894, 0x8CF8 ); + mac_ocp_write( tp, 0xF896, 0xC746 ); + mac_ocp_write( tp, 0xF898, 0x74FC ); + mac_ocp_write( tp, 0xF89A, 0x49C0 ); + mac_ocp_write( tp, 0xF89C, 0xF120 ); + mac_ocp_write( tp, 0xF89E, 0x49C1 ); + mac_ocp_write( tp, 0xF8A0, 0xF11E ); + mac_ocp_write( tp, 0xF8A2, 0x74F8 ); + mac_ocp_write( tp, 0xF8A4, 0x49C0 ); + mac_ocp_write( tp, 0xF8A6, 0xF01B ); + mac_ocp_write( tp, 0xF8A8, 0x49C6 ); + mac_ocp_write( tp, 0xF8AA, 0xF119 ); + mac_ocp_write( tp, 0xF8AC, 0x74F8 ); + mac_ocp_write( tp, 0xF8AE, 0x49C4 ); + mac_ocp_write( tp, 0xF8B0, 0xF013 ); + mac_ocp_write( tp, 0xF8B2, 0xC536 ); + mac_ocp_write( tp, 0xF8B4, 0x74B0 ); + mac_ocp_write( tp, 0xF8B6, 0x49C1 ); + mac_ocp_write( tp, 0xF8B8, 0xF1FD ); + mac_ocp_write( tp, 0xF8BA, 0xC537 ); + mac_ocp_write( tp, 0xF8BC, 0xC434 ); + mac_ocp_write( tp, 0xF8BE, 0x9CA0 ); + mac_ocp_write( tp, 0xF8C0, 0xC435 ); + mac_ocp_write( tp, 0xF8C2, 0x1C13 ); + mac_ocp_write( tp, 0xF8C4, 0x484F ); + mac_ocp_write( tp, 0xF8C6, 0x9CA2 ); + mac_ocp_write( tp, 0xF8C8, 0xC52B ); + mac_ocp_write( tp, 0xF8CA, 0x74B0 ); + mac_ocp_write( tp, 0xF8CC, 0x49C1 ); + mac_ocp_write( tp, 0xF8CE, 0xF1FD ); + mac_ocp_write( tp, 0xF8D0, 0x74F8 ); + mac_ocp_write( tp, 0xF8D2, 0x48C4 ); + mac_ocp_write( tp, 0xF8D4, 0x8CF8 ); + mac_ocp_write( tp, 0xF8D6, 0x7100 ); + mac_ocp_write( tp, 0xF8D8, 0x4893 ); + mac_ocp_write( tp, 0xF8DA, 0x8900 ); + mac_ocp_write( tp, 0xF8DC, 0xFF80 ); + mac_ocp_write( tp, 0xF8DE, 0xC520 ); + mac_ocp_write( tp, 0xF8E0, 0x74B0 ); + mac_ocp_write( tp, 0xF8E2, 0x49C1 ); + mac_ocp_write( tp, 0xF8E4, 0xF11C ); + mac_ocp_write( tp, 0xF8E6, 0xC71E ); + mac_ocp_write( tp, 0xF8E8, 0x74FC ); + mac_ocp_write( tp, 0xF8EA, 0x49C1 ); + mac_ocp_write( tp, 0xF8EC, 0xF118 ); + mac_ocp_write( tp, 0xF8EE, 0x49C0 ); + mac_ocp_write( tp, 0xF8F0, 0xF116 ); + mac_ocp_write( tp, 0xF8F2, 0x74F8 ); + mac_ocp_write( tp, 0xF8F4, 0x49C0 ); + mac_ocp_write( tp, 0xF8F6, 0xF013 ); + mac_ocp_write( tp, 0xF8F8, 0x48C3 ); + mac_ocp_write( tp, 0xF8FA, 0x8CF8 ); + mac_ocp_write( tp, 0xF8FC, 0xC516 ); + mac_ocp_write( tp, 0xF8FE, 0x74A2 ); + mac_ocp_write( tp, 0xF900, 0x49CE ); + mac_ocp_write( tp, 0xF902, 0xF1FE ); + mac_ocp_write( tp, 0xF904, 0xC411 ); + mac_ocp_write( tp, 0xF906, 0x9CA0 ); + mac_ocp_write( tp, 0xF908, 0xC411 ); + mac_ocp_write( tp, 0xF90A, 0x1C13 ); + mac_ocp_write( tp, 0xF90C, 0x484F ); + mac_ocp_write( tp, 0xF90E, 0x9CA2 ); + mac_ocp_write( tp, 0xF910, 0x74A2 ); + mac_ocp_write( tp, 0xF912, 0x49CF ); + mac_ocp_write( tp, 0xF914, 0xF1FE ); + mac_ocp_write( tp, 0xF916, 0x7100 ); + mac_ocp_write( tp, 0xF918, 0x4891 ); + mac_ocp_write( tp, 0xF91A, 0x8900 ); + mac_ocp_write( tp, 0xF91C, 0xFF80 ); + mac_ocp_write( tp, 0xF91E, 0xE400 ); + mac_ocp_write( tp, 0xF920, 0xD3E0 ); + mac_ocp_write( tp, 0xF922, 0xE000 ); + mac_ocp_write( tp, 0xF924, 0x0481 ); + mac_ocp_write( tp, 0xF926, 0x0C81 ); + mac_ocp_write( tp, 0xF928, 0xDE20 ); + mac_ocp_write( tp, 0xF92A, 0x0000 ); + mac_ocp_write( tp, 0xF92C, 0x0992 ); + mac_ocp_write( tp, 0xF92E, 0x1B76 ); + mac_ocp_write( tp, 0xF930, 0xC602 ); + mac_ocp_write( tp, 0xF932, 0xBE00 ); + mac_ocp_write( tp, 0xF934, 0x059C ); + mac_ocp_write( tp, 0xF936, 0x1B76 ); + mac_ocp_write( tp, 0xF938, 0xC602 ); + mac_ocp_write( tp, 0xF93A, 0xBE00 ); + mac_ocp_write( tp, 0xF93C, 0x065A ); + mac_ocp_write( tp, 0xF93E, 0xB400 ); + mac_ocp_write( tp, 0xF940, 0x18DE ); + mac_ocp_write( tp, 0xF942, 0x2008 ); + mac_ocp_write( tp, 0xF944, 0x4001 ); + mac_ocp_write( tp, 0xF946, 0xF10F ); + mac_ocp_write( tp, 0xF948, 0x7342 ); + mac_ocp_write( tp, 0xF94A, 0x1880 ); + mac_ocp_write( tp, 0xF94C, 0x2008 ); + mac_ocp_write( tp, 0xF94E, 0x0009 ); + mac_ocp_write( tp, 0xF950, 0x4018 ); + mac_ocp_write( tp, 0xF952, 0xF109 ); + mac_ocp_write( tp, 0xF954, 0x7340 ); + mac_ocp_write( tp, 0xF956, 0x25BC ); + mac_ocp_write( tp, 0xF958, 0x130F ); + mac_ocp_write( tp, 0xF95A, 0xF105 ); + mac_ocp_write( tp, 0xF95C, 0xC00A ); + mac_ocp_write( tp, 0xF95E, 0x7300 ); + mac_ocp_write( tp, 0xF960, 0x4831 ); + mac_ocp_write( tp, 0xF962, 0x9B00 ); + mac_ocp_write( tp, 0xF964, 0xB000 ); + mac_ocp_write( tp, 0xF966, 0x7340 ); + mac_ocp_write( tp, 0xF968, 0x8320 ); + mac_ocp_write( tp, 0xF96A, 0xC302 ); + mac_ocp_write( tp, 0xF96C, 0xBB00 ); + mac_ocp_write( tp, 0xF96E, 0x0C12 ); + mac_ocp_write( tp, 0xF970, 0xE860 ); + mac_ocp_write( tp, 0xF972, 0xC406 ); + mac_ocp_write( tp, 0xF974, 0x7580 ); + mac_ocp_write( tp, 0xF976, 0x4851 ); + mac_ocp_write( tp, 0xF978, 0x8D80 ); + mac_ocp_write( tp, 0xF97A, 0xC403 ); + mac_ocp_write( tp, 0xF97C, 0xBC00 ); + mac_ocp_write( tp, 0xF97E, 0xD3E0 ); + mac_ocp_write( tp, 0xF980, 0x02C8 ); + mac_ocp_write( tp, 0xF982, 0xC406 ); + mac_ocp_write( tp, 0xF984, 0x7580 ); + mac_ocp_write( tp, 0xF986, 0x4850 ); + mac_ocp_write( tp, 0xF988, 0x8D80 ); + mac_ocp_write( tp, 0xF98A, 0xC403 ); + mac_ocp_write( tp, 0xF98C, 0xBC00 ); + mac_ocp_write( tp, 0xF98E, 0xD3E0 ); + mac_ocp_write( tp, 0xF990, 0x0298 ); + + mac_ocp_write( tp, 0xDE30, 0x0080 ); + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC28, 0x0075 ); + mac_ocp_write( tp, 0xFC2A, 0x02B1 ); + mac_ocp_write( tp, 0xFC2C, 0x0991 ); + mac_ocp_write( tp, 0xFC2E, 0x059B ); + mac_ocp_write( tp, 0xFC30, 0x0659 ); + mac_ocp_write( tp, 0xFC32, 0x0000 ); + mac_ocp_write( tp, 0xFC34, 0x02C7 ); + mac_ocp_write( tp, 0xFC36, 0x0279 ); +} + +static void +rtl8168_set_mac_mcu_8168gu_1(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE011 ); + mac_ocp_write( tp, 0xF804, 0xE015 ); + mac_ocp_write( tp, 0xF806, 0xE018 ); + mac_ocp_write( tp, 0xF808, 0xE01B ); + mac_ocp_write( tp, 0xF80A, 0xE027 ); + mac_ocp_write( tp, 0xF80C, 0xE043 ); + mac_ocp_write( tp, 0xF80E, 0xE065 ); + mac_ocp_write( tp, 0xF810, 0x49E2 ); + mac_ocp_write( tp, 0xF812, 0xF005 ); + mac_ocp_write( tp, 0xF814, 0x49EA ); + mac_ocp_write( tp, 0xF816, 0xF003 ); + mac_ocp_write( tp, 0xF818, 0xC404 ); + mac_ocp_write( tp, 0xF81A, 0xBC00 ); + mac_ocp_write( tp, 0xF81C, 0xC403 ); + mac_ocp_write( tp, 0xF81E, 0xBC00 ); + mac_ocp_write( tp, 0xF820, 0x0496 ); + mac_ocp_write( tp, 0xF822, 0x051A ); + mac_ocp_write( tp, 0xF824, 0x1D01 ); + mac_ocp_write( tp, 0xF826, 0x8DE8 ); + mac_ocp_write( tp, 0xF828, 0xC602 ); + mac_ocp_write( tp, 0xF82A, 0xBE00 ); + mac_ocp_write( tp, 0xF82C, 0x0206 ); + mac_ocp_write( tp, 0xF82E, 0x1B76 ); + mac_ocp_write( tp, 0xF830, 0xC202 ); + mac_ocp_write( tp, 0xF832, 0xBA00 ); + mac_ocp_write( tp, 0xF834, 0x058A ); + mac_ocp_write( tp, 0xF836, 0x1B76 ); + mac_ocp_write( tp, 0xF838, 0xC602 ); + mac_ocp_write( tp, 0xF83A, 0xBE00 ); + mac_ocp_write( tp, 0xF83C, 0x0648 ); + mac_ocp_write( tp, 0xF83E, 0x74E6 ); + mac_ocp_write( tp, 0xF840, 0x1B78 ); + mac_ocp_write( tp, 0xF842, 0x46DC ); + mac_ocp_write( tp, 0xF844, 0x1300 ); + mac_ocp_write( tp, 0xF846, 0xF005 ); + mac_ocp_write( tp, 0xF848, 0x74F8 ); + mac_ocp_write( tp, 0xF84A, 0x48C3 ); + mac_ocp_write( tp, 0xF84C, 0x48C4 ); + mac_ocp_write( tp, 0xF84E, 0x8CF8 ); + mac_ocp_write( tp, 0xF850, 0x64E7 ); + mac_ocp_write( tp, 0xF852, 0xC302 ); + mac_ocp_write( tp, 0xF854, 0xBB00 ); + mac_ocp_write( tp, 0xF856, 0x068E ); + mac_ocp_write( tp, 0xF858, 0x74E4 ); + mac_ocp_write( tp, 0xF85A, 0x49C5 ); + mac_ocp_write( tp, 0xF85C, 0xF106 ); + mac_ocp_write( tp, 0xF85E, 0x49C6 ); + mac_ocp_write( tp, 0xF860, 0xF107 ); + mac_ocp_write( tp, 0xF862, 0x48C8 ); + mac_ocp_write( tp, 0xF864, 0x48C9 ); + mac_ocp_write( tp, 0xF866, 0xE011 ); + mac_ocp_write( tp, 0xF868, 0x48C9 ); + mac_ocp_write( tp, 0xF86A, 0x4848 ); + mac_ocp_write( tp, 0xF86C, 0xE00E ); + mac_ocp_write( tp, 0xF86E, 0x4848 ); + mac_ocp_write( tp, 0xF870, 0x49C7 ); + mac_ocp_write( tp, 0xF872, 0xF00A ); + mac_ocp_write( tp, 0xF874, 0x48C9 ); + mac_ocp_write( tp, 0xF876, 0xC60D ); + mac_ocp_write( tp, 0xF878, 0x1D1F ); + mac_ocp_write( tp, 0xF87A, 0x8DC2 ); + mac_ocp_write( tp, 0xF87C, 0x1D00 ); + mac_ocp_write( tp, 0xF87E, 0x8DC3 ); + mac_ocp_write( tp, 0xF880, 0x1D11 ); + mac_ocp_write( tp, 0xF882, 0x8DC0 ); + mac_ocp_write( tp, 0xF884, 0xE002 ); + mac_ocp_write( tp, 0xF886, 0x4849 ); + mac_ocp_write( tp, 0xF888, 0x94E5 ); + mac_ocp_write( tp, 0xF88A, 0xC602 ); + mac_ocp_write( tp, 0xF88C, 0xBE00 ); + mac_ocp_write( tp, 0xF88E, 0x0238 ); + mac_ocp_write( tp, 0xF890, 0xE434 ); + mac_ocp_write( tp, 0xF892, 0x49D9 ); + mac_ocp_write( tp, 0xF894, 0xF01B ); + mac_ocp_write( tp, 0xF896, 0xC31E ); + mac_ocp_write( tp, 0xF898, 0x7464 ); + mac_ocp_write( tp, 0xF89A, 0x49C4 ); + mac_ocp_write( tp, 0xF89C, 0xF114 ); + mac_ocp_write( tp, 0xF89E, 0xC31B ); + mac_ocp_write( tp, 0xF8A0, 0x6460 ); + mac_ocp_write( tp, 0xF8A2, 0x14FA ); + mac_ocp_write( tp, 0xF8A4, 0xFA02 ); + mac_ocp_write( tp, 0xF8A6, 0xE00F ); + mac_ocp_write( tp, 0xF8A8, 0xC317 ); + mac_ocp_write( tp, 0xF8AA, 0x7460 ); + mac_ocp_write( tp, 0xF8AC, 0x49C0 ); + mac_ocp_write( tp, 0xF8AE, 0xF10B ); + mac_ocp_write( tp, 0xF8B0, 0xC311 ); + mac_ocp_write( tp, 0xF8B2, 0x7462 ); + mac_ocp_write( tp, 0xF8B4, 0x48C1 ); + mac_ocp_write( tp, 0xF8B6, 0x9C62 ); + mac_ocp_write( tp, 0xF8B8, 0x4841 ); + mac_ocp_write( tp, 0xF8BA, 0x9C62 ); + mac_ocp_write( tp, 0xF8BC, 0xC30A ); + mac_ocp_write( tp, 0xF8BE, 0x1C04 ); + mac_ocp_write( tp, 0xF8C0, 0x8C60 ); + mac_ocp_write( tp, 0xF8C2, 0xE004 ); + mac_ocp_write( tp, 0xF8C4, 0x1C15 ); + mac_ocp_write( tp, 0xF8C6, 0xC305 ); + mac_ocp_write( tp, 0xF8C8, 0x8C60 ); + mac_ocp_write( tp, 0xF8CA, 0xC602 ); + mac_ocp_write( tp, 0xF8CC, 0xBE00 ); + mac_ocp_write( tp, 0xF8CE, 0x0374 ); + mac_ocp_write( tp, 0xF8D0, 0xE434 ); + mac_ocp_write( tp, 0xF8D2, 0xE030 ); + mac_ocp_write( tp, 0xF8D4, 0xE61C ); + mac_ocp_write( tp, 0xF8D6, 0xE906 ); + mac_ocp_write( tp, 0xF8D8, 0xC602 ); + mac_ocp_write( tp, 0xF8DA, 0xBE00 ); + mac_ocp_write( tp, 0xF8DC, 0x0000 ); + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC28, 0x0493 ); + mac_ocp_write( tp, 0xFC2A, 0x0205 ); + mac_ocp_write( tp, 0xFC2C, 0x0589 ); + mac_ocp_write( tp, 0xFC2E, 0x0647 ); + mac_ocp_write( tp, 0xFC30, 0x0000 ); + mac_ocp_write( tp, 0xFC32, 0x0215 ); + mac_ocp_write( tp, 0xFC34, 0x0285 ); +} + +static void +rtl8168_set_mac_mcu_8168gu_2(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE00A ); + mac_ocp_write( tp, 0xF804, 0xE00D ); + mac_ocp_write( tp, 0xF806, 0xE02F ); + mac_ocp_write( tp, 0xF808, 0xE031 ); + mac_ocp_write( tp, 0xF80A, 0xE038 ); + mac_ocp_write( tp, 0xF80C, 0xE03A ); + mac_ocp_write( tp, 0xF80E, 0xE051 ); + mac_ocp_write( tp, 0xF810, 0xC202 ); + mac_ocp_write( tp, 0xF812, 0xBA00 ); + mac_ocp_write( tp, 0xF814, 0x0DFC ); + mac_ocp_write( tp, 0xF816, 0x7444 ); + mac_ocp_write( tp, 0xF818, 0xC502 ); + mac_ocp_write( tp, 0xF81A, 0xBD00 ); + mac_ocp_write( tp, 0xF81C, 0x0A30 ); + mac_ocp_write( tp, 0xF81E, 0x49D9 ); + mac_ocp_write( tp, 0xF820, 0xF019 ); + mac_ocp_write( tp, 0xF822, 0xC520 ); + mac_ocp_write( tp, 0xF824, 0x64A5 ); + mac_ocp_write( tp, 0xF826, 0x1400 ); + mac_ocp_write( tp, 0xF828, 0xF007 ); + mac_ocp_write( tp, 0xF82A, 0x0C01 ); + mac_ocp_write( tp, 0xF82C, 0x8CA5 ); + mac_ocp_write( tp, 0xF82E, 0x1C15 ); + mac_ocp_write( tp, 0xF830, 0xC515 ); + mac_ocp_write( tp, 0xF832, 0x9CA0 ); + mac_ocp_write( tp, 0xF834, 0xE00F ); + mac_ocp_write( tp, 0xF836, 0xC513 ); + mac_ocp_write( tp, 0xF838, 0x74A0 ); + mac_ocp_write( tp, 0xF83A, 0x48C8 ); + mac_ocp_write( tp, 0xF83C, 0x48CA ); + mac_ocp_write( tp, 0xF83E, 0x9CA0 ); + mac_ocp_write( tp, 0xF840, 0xC510 ); + mac_ocp_write( tp, 0xF842, 0x1B00 ); + mac_ocp_write( tp, 0xF844, 0x9BA0 ); + mac_ocp_write( tp, 0xF846, 0x1B1C ); + mac_ocp_write( tp, 0xF848, 0x483F ); + mac_ocp_write( tp, 0xF84A, 0x9BA2 ); + mac_ocp_write( tp, 0xF84C, 0x1B04 ); + mac_ocp_write( tp, 0xF84E, 0xC506 ); + mac_ocp_write( tp, 0xF850, 0x9BA0 ); + mac_ocp_write( tp, 0xF852, 0xC603 ); + mac_ocp_write( tp, 0xF854, 0xBE00 ); + mac_ocp_write( tp, 0xF856, 0x0298 ); + mac_ocp_write( tp, 0xF858, 0x03DE ); + mac_ocp_write( tp, 0xF85A, 0xE434 ); + mac_ocp_write( tp, 0xF85C, 0xE096 ); + mac_ocp_write( tp, 0xF85E, 0xE860 ); + mac_ocp_write( tp, 0xF860, 0xDE20 ); + mac_ocp_write( tp, 0xF862, 0xD3C0 ); + mac_ocp_write( tp, 0xF864, 0xC602 ); + mac_ocp_write( tp, 0xF866, 0xBE00 ); + mac_ocp_write( tp, 0xF868, 0x0A64 ); + mac_ocp_write( tp, 0xF86A, 0xC707 ); + mac_ocp_write( tp, 0xF86C, 0x1D00 ); + mac_ocp_write( tp, 0xF86E, 0x8DE2 ); + mac_ocp_write( tp, 0xF870, 0x48C1 ); + mac_ocp_write( tp, 0xF872, 0xC502 ); + mac_ocp_write( tp, 0xF874, 0xBD00 ); + mac_ocp_write( tp, 0xF876, 0x00AA ); + mac_ocp_write( tp, 0xF878, 0xE0C0 ); + mac_ocp_write( tp, 0xF87A, 0xC502 ); + mac_ocp_write( tp, 0xF87C, 0xBD00 ); + mac_ocp_write( tp, 0xF87E, 0x0132 ); + mac_ocp_write( tp, 0xF880, 0xC50C ); + mac_ocp_write( tp, 0xF882, 0x74A2 ); + mac_ocp_write( tp, 0xF884, 0x49CE ); + mac_ocp_write( tp, 0xF886, 0xF1FE ); + mac_ocp_write( tp, 0xF888, 0x1C00 ); + mac_ocp_write( tp, 0xF88A, 0x9EA0 ); + mac_ocp_write( tp, 0xF88C, 0x1C1C ); + mac_ocp_write( tp, 0xF88E, 0x484F ); + mac_ocp_write( tp, 0xF890, 0x9CA2 ); + mac_ocp_write( tp, 0xF892, 0xC402 ); + mac_ocp_write( tp, 0xF894, 0xBC00 ); + mac_ocp_write( tp, 0xF896, 0x0AFA ); + mac_ocp_write( tp, 0xF898, 0xDE20 ); + mac_ocp_write( tp, 0xF89A, 0xE000 ); + mac_ocp_write( tp, 0xF89C, 0xE092 ); + mac_ocp_write( tp, 0xF89E, 0xE430 ); + mac_ocp_write( tp, 0xF8A0, 0xDE20 ); + mac_ocp_write( tp, 0xF8A2, 0xE0C0 ); + mac_ocp_write( tp, 0xF8A4, 0xE860 ); + mac_ocp_write( tp, 0xF8A6, 0xE84C ); + mac_ocp_write( tp, 0xF8A8, 0xB400 ); + mac_ocp_write( tp, 0xF8AA, 0xB430 ); + mac_ocp_write( tp, 0xF8AC, 0xE410 ); + mac_ocp_write( tp, 0xF8AE, 0xC0AE ); + mac_ocp_write( tp, 0xF8B0, 0xB407 ); + mac_ocp_write( tp, 0xF8B2, 0xB406 ); + mac_ocp_write( tp, 0xF8B4, 0xB405 ); + mac_ocp_write( tp, 0xF8B6, 0xB404 ); + mac_ocp_write( tp, 0xF8B8, 0xB403 ); + mac_ocp_write( tp, 0xF8BA, 0xB402 ); + mac_ocp_write( tp, 0xF8BC, 0xB401 ); + mac_ocp_write( tp, 0xF8BE, 0xC7EE ); + mac_ocp_write( tp, 0xF8C0, 0x76F4 ); + mac_ocp_write( tp, 0xF8C2, 0xC2ED ); + mac_ocp_write( tp, 0xF8C4, 0xC3ED ); + mac_ocp_write( tp, 0xF8C6, 0xC1EF ); + mac_ocp_write( tp, 0xF8C8, 0xC5F3 ); + mac_ocp_write( tp, 0xF8CA, 0x74A0 ); + mac_ocp_write( tp, 0xF8CC, 0x49CD ); + mac_ocp_write( tp, 0xF8CE, 0xF001 ); + mac_ocp_write( tp, 0xF8D0, 0xC5EE ); + mac_ocp_write( tp, 0xF8D2, 0x74A0 ); + mac_ocp_write( tp, 0xF8D4, 0x49C1 ); + mac_ocp_write( tp, 0xF8D6, 0xF105 ); + mac_ocp_write( tp, 0xF8D8, 0xC5E4 ); + mac_ocp_write( tp, 0xF8DA, 0x74A2 ); + mac_ocp_write( tp, 0xF8DC, 0x49CE ); + mac_ocp_write( tp, 0xF8DE, 0xF00B ); + mac_ocp_write( tp, 0xF8E0, 0x7444 ); + mac_ocp_write( tp, 0xF8E2, 0x484B ); + mac_ocp_write( tp, 0xF8E4, 0x9C44 ); + mac_ocp_write( tp, 0xF8E6, 0x1C10 ); + mac_ocp_write( tp, 0xF8E8, 0x9C62 ); + mac_ocp_write( tp, 0xF8EA, 0x1C11 ); + mac_ocp_write( tp, 0xF8EC, 0x8C60 ); + mac_ocp_write( tp, 0xF8EE, 0x1C00 ); + mac_ocp_write( tp, 0xF8F0, 0x9CF6 ); + mac_ocp_write( tp, 0xF8F2, 0xE0EC ); + mac_ocp_write( tp, 0xF8F4, 0x49E7 ); + mac_ocp_write( tp, 0xF8F6, 0xF016 ); + mac_ocp_write( tp, 0xF8F8, 0x1D80 ); + mac_ocp_write( tp, 0xF8FA, 0x8DF4 ); + mac_ocp_write( tp, 0xF8FC, 0x74F8 ); + mac_ocp_write( tp, 0xF8FE, 0x4843 ); + mac_ocp_write( tp, 0xF900, 0x8CF8 ); + mac_ocp_write( tp, 0xF902, 0x74F8 ); + mac_ocp_write( tp, 0xF904, 0x74F8 ); + mac_ocp_write( tp, 0xF906, 0x7444 ); + mac_ocp_write( tp, 0xF908, 0x48C8 ); + mac_ocp_write( tp, 0xF90A, 0x48C9 ); + mac_ocp_write( tp, 0xF90C, 0x48CA ); + mac_ocp_write( tp, 0xF90E, 0x9C44 ); + mac_ocp_write( tp, 0xF910, 0x74F8 ); + mac_ocp_write( tp, 0xF912, 0x4844 ); + mac_ocp_write( tp, 0xF914, 0x8CF8 ); + mac_ocp_write( tp, 0xF916, 0x1E01 ); + mac_ocp_write( tp, 0xF918, 0xE8DB ); + mac_ocp_write( tp, 0xF91A, 0x7420 ); + mac_ocp_write( tp, 0xF91C, 0x48C1 ); + mac_ocp_write( tp, 0xF91E, 0x9C20 ); + mac_ocp_write( tp, 0xF920, 0xE0D5 ); + mac_ocp_write( tp, 0xF922, 0x49E6 ); + mac_ocp_write( tp, 0xF924, 0xF02A ); + mac_ocp_write( tp, 0xF926, 0x1D40 ); + mac_ocp_write( tp, 0xF928, 0x8DF4 ); + mac_ocp_write( tp, 0xF92A, 0x74FC ); + mac_ocp_write( tp, 0xF92C, 0x49C0 ); + mac_ocp_write( tp, 0xF92E, 0xF124 ); + mac_ocp_write( tp, 0xF930, 0x49C1 ); + mac_ocp_write( tp, 0xF932, 0xF122 ); + mac_ocp_write( tp, 0xF934, 0x74F8 ); + mac_ocp_write( tp, 0xF936, 0x49C0 ); + mac_ocp_write( tp, 0xF938, 0xF01F ); + mac_ocp_write( tp, 0xF93A, 0xE8D3 ); + mac_ocp_write( tp, 0xF93C, 0x48C4 ); + mac_ocp_write( tp, 0xF93E, 0x8CF8 ); + mac_ocp_write( tp, 0xF940, 0x1E00 ); + mac_ocp_write( tp, 0xF942, 0xE8C6 ); + mac_ocp_write( tp, 0xF944, 0xC5B1 ); + mac_ocp_write( tp, 0xF946, 0x74A0 ); + mac_ocp_write( tp, 0xF948, 0x49C3 ); + mac_ocp_write( tp, 0xF94A, 0xF016 ); + mac_ocp_write( tp, 0xF94C, 0xC5AF ); + mac_ocp_write( tp, 0xF94E, 0x74A4 ); + mac_ocp_write( tp, 0xF950, 0x49C2 ); + mac_ocp_write( tp, 0xF952, 0xF005 ); + mac_ocp_write( tp, 0xF954, 0xC5AA ); + mac_ocp_write( tp, 0xF956, 0x74B2 ); + mac_ocp_write( tp, 0xF958, 0x49C9 ); + mac_ocp_write( tp, 0xF95A, 0xF10E ); + mac_ocp_write( tp, 0xF95C, 0xC5A6 ); + mac_ocp_write( tp, 0xF95E, 0x74A8 ); + mac_ocp_write( tp, 0xF960, 0x4845 ); + mac_ocp_write( tp, 0xF962, 0x4846 ); + mac_ocp_write( tp, 0xF964, 0x4847 ); + mac_ocp_write( tp, 0xF966, 0x4848 ); + mac_ocp_write( tp, 0xF968, 0x9CA8 ); + mac_ocp_write( tp, 0xF96A, 0x74B2 ); + mac_ocp_write( tp, 0xF96C, 0x4849 ); + mac_ocp_write( tp, 0xF96E, 0x9CB2 ); + mac_ocp_write( tp, 0xF970, 0x74A0 ); + mac_ocp_write( tp, 0xF972, 0x484F ); + mac_ocp_write( tp, 0xF974, 0x9CA0 ); + mac_ocp_write( tp, 0xF976, 0xE0AA ); + mac_ocp_write( tp, 0xF978, 0x49E4 ); + mac_ocp_write( tp, 0xF97A, 0xF018 ); + mac_ocp_write( tp, 0xF97C, 0x1D10 ); + mac_ocp_write( tp, 0xF97E, 0x8DF4 ); + mac_ocp_write( tp, 0xF980, 0x74F8 ); + mac_ocp_write( tp, 0xF982, 0x74F8 ); + mac_ocp_write( tp, 0xF984, 0x74F8 ); + mac_ocp_write( tp, 0xF986, 0x4843 ); + mac_ocp_write( tp, 0xF988, 0x8CF8 ); + mac_ocp_write( tp, 0xF98A, 0x74F8 ); + mac_ocp_write( tp, 0xF98C, 0x74F8 ); + mac_ocp_write( tp, 0xF98E, 0x74F8 ); + mac_ocp_write( tp, 0xF990, 0x4844 ); + mac_ocp_write( tp, 0xF992, 0x4842 ); + mac_ocp_write( tp, 0xF994, 0x4841 ); + mac_ocp_write( tp, 0xF996, 0x8CF8 ); + mac_ocp_write( tp, 0xF998, 0x1E01 ); + mac_ocp_write( tp, 0xF99A, 0xE89A ); + mac_ocp_write( tp, 0xF99C, 0x7420 ); + mac_ocp_write( tp, 0xF99E, 0x4841 ); + mac_ocp_write( tp, 0xF9A0, 0x9C20 ); + mac_ocp_write( tp, 0xF9A2, 0x7444 ); + mac_ocp_write( tp, 0xF9A4, 0x4848 ); + mac_ocp_write( tp, 0xF9A6, 0x9C44 ); + mac_ocp_write( tp, 0xF9A8, 0xE091 ); + mac_ocp_write( tp, 0xF9AA, 0x49E5 ); + mac_ocp_write( tp, 0xF9AC, 0xF03E ); + mac_ocp_write( tp, 0xF9AE, 0x1D20 ); + mac_ocp_write( tp, 0xF9B0, 0x8DF4 ); + mac_ocp_write( tp, 0xF9B2, 0x74F8 ); + mac_ocp_write( tp, 0xF9B4, 0x48C2 ); + mac_ocp_write( tp, 0xF9B6, 0x4841 ); + mac_ocp_write( tp, 0xF9B8, 0x8CF8 ); + mac_ocp_write( tp, 0xF9BA, 0x1E01 ); + mac_ocp_write( tp, 0xF9BC, 0x7444 ); + mac_ocp_write( tp, 0xF9BE, 0x49CA ); + mac_ocp_write( tp, 0xF9C0, 0xF103 ); + mac_ocp_write( tp, 0xF9C2, 0x49C2 ); + mac_ocp_write( tp, 0xF9C4, 0xF00C ); + mac_ocp_write( tp, 0xF9C6, 0x49C1 ); + mac_ocp_write( tp, 0xF9C8, 0xF004 ); + mac_ocp_write( tp, 0xF9CA, 0x6447 ); + mac_ocp_write( tp, 0xF9CC, 0x2244 ); + mac_ocp_write( tp, 0xF9CE, 0xE002 ); + mac_ocp_write( tp, 0xF9D0, 0x1C01 ); + mac_ocp_write( tp, 0xF9D2, 0x9C62 ); + mac_ocp_write( tp, 0xF9D4, 0x1C11 ); + mac_ocp_write( tp, 0xF9D6, 0x8C60 ); + mac_ocp_write( tp, 0xF9D8, 0x1C00 ); + mac_ocp_write( tp, 0xF9DA, 0x9CF6 ); + mac_ocp_write( tp, 0xF9DC, 0x7444 ); + mac_ocp_write( tp, 0xF9DE, 0x49C8 ); + mac_ocp_write( tp, 0xF9E0, 0xF01D ); + mac_ocp_write( tp, 0xF9E2, 0x74FC ); + mac_ocp_write( tp, 0xF9E4, 0x49C0 ); + mac_ocp_write( tp, 0xF9E6, 0xF11A ); + mac_ocp_write( tp, 0xF9E8, 0x49C1 ); + mac_ocp_write( tp, 0xF9EA, 0xF118 ); + mac_ocp_write( tp, 0xF9EC, 0x74F8 ); + mac_ocp_write( tp, 0xF9EE, 0x49C0 ); + mac_ocp_write( tp, 0xF9F0, 0xF015 ); + mac_ocp_write( tp, 0xF9F2, 0x49C6 ); + mac_ocp_write( tp, 0xF9F4, 0xF113 ); + mac_ocp_write( tp, 0xF9F6, 0xE875 ); + mac_ocp_write( tp, 0xF9F8, 0x48C4 ); + mac_ocp_write( tp, 0xF9FA, 0x8CF8 ); + mac_ocp_write( tp, 0xF9FC, 0x7420 ); + mac_ocp_write( tp, 0xF9FE, 0x48C1 ); + mac_ocp_write( tp, 0xFA00, 0x9C20 ); + mac_ocp_write( tp, 0xFA02, 0xC50A ); + mac_ocp_write( tp, 0xFA04, 0x74A2 ); + mac_ocp_write( tp, 0xFA06, 0x8CA5 ); + mac_ocp_write( tp, 0xFA08, 0x74A0 ); + mac_ocp_write( tp, 0xFA0A, 0xC505 ); + mac_ocp_write( tp, 0xFA0C, 0x9CA2 ); + mac_ocp_write( tp, 0xFA0E, 0x1C11 ); + mac_ocp_write( tp, 0xFA10, 0x9CA0 ); + mac_ocp_write( tp, 0xFA12, 0xE00A ); + mac_ocp_write( tp, 0xFA14, 0xE434 ); + mac_ocp_write( tp, 0xFA16, 0xD3C0 ); + mac_ocp_write( tp, 0xFA18, 0xDC00 ); + mac_ocp_write( tp, 0xFA1A, 0x7444 ); + mac_ocp_write( tp, 0xFA1C, 0x49CA ); + mac_ocp_write( tp, 0xFA1E, 0xF004 ); + mac_ocp_write( tp, 0xFA20, 0x48CA ); + mac_ocp_write( tp, 0xFA22, 0x9C44 ); + mac_ocp_write( tp, 0xFA24, 0xE855 ); + mac_ocp_write( tp, 0xFA26, 0xE052 ); + mac_ocp_write( tp, 0xFA28, 0x49E8 ); + mac_ocp_write( tp, 0xFA2A, 0xF024 ); + mac_ocp_write( tp, 0xFA2C, 0x1D01 ); + mac_ocp_write( tp, 0xFA2E, 0x8DF5 ); + mac_ocp_write( tp, 0xFA30, 0x7440 ); + mac_ocp_write( tp, 0xFA32, 0x49C0 ); + mac_ocp_write( tp, 0xFA34, 0xF11E ); + mac_ocp_write( tp, 0xFA36, 0x7444 ); + mac_ocp_write( tp, 0xFA38, 0x49C8 ); + mac_ocp_write( tp, 0xFA3A, 0xF01B ); + mac_ocp_write( tp, 0xFA3C, 0x49CA ); + mac_ocp_write( tp, 0xFA3E, 0xF119 ); + mac_ocp_write( tp, 0xFA40, 0xC5EC ); + mac_ocp_write( tp, 0xFA42, 0x76A4 ); + mac_ocp_write( tp, 0xFA44, 0x49E3 ); + mac_ocp_write( tp, 0xFA46, 0xF015 ); + mac_ocp_write( tp, 0xFA48, 0x49C0 ); + mac_ocp_write( tp, 0xFA4A, 0xF103 ); + mac_ocp_write( tp, 0xFA4C, 0x49C1 ); + mac_ocp_write( tp, 0xFA4E, 0xF011 ); + mac_ocp_write( tp, 0xFA50, 0x4849 ); + mac_ocp_write( tp, 0xFA52, 0x9C44 ); + mac_ocp_write( tp, 0xFA54, 0x1C00 ); + mac_ocp_write( tp, 0xFA56, 0x9CF6 ); + mac_ocp_write( tp, 0xFA58, 0x7444 ); + mac_ocp_write( tp, 0xFA5A, 0x49C1 ); + mac_ocp_write( tp, 0xFA5C, 0xF004 ); + mac_ocp_write( tp, 0xFA5E, 0x6446 ); + mac_ocp_write( tp, 0xFA60, 0x1E07 ); + mac_ocp_write( tp, 0xFA62, 0xE003 ); + mac_ocp_write( tp, 0xFA64, 0x1C01 ); + mac_ocp_write( tp, 0xFA66, 0x1E03 ); + mac_ocp_write( tp, 0xFA68, 0x9C62 ); + mac_ocp_write( tp, 0xFA6A, 0x1C11 ); + mac_ocp_write( tp, 0xFA6C, 0x8C60 ); + mac_ocp_write( tp, 0xFA6E, 0xE830 ); + mac_ocp_write( tp, 0xFA70, 0xE02D ); + mac_ocp_write( tp, 0xFA72, 0x49E9 ); + mac_ocp_write( tp, 0xFA74, 0xF004 ); + mac_ocp_write( tp, 0xFA76, 0x1D02 ); + mac_ocp_write( tp, 0xFA78, 0x8DF5 ); + mac_ocp_write( tp, 0xFA7A, 0xE79C ); + mac_ocp_write( tp, 0xFA7C, 0x49E3 ); + mac_ocp_write( tp, 0xFA7E, 0xF006 ); + mac_ocp_write( tp, 0xFA80, 0x1D08 ); + mac_ocp_write( tp, 0xFA82, 0x8DF4 ); + mac_ocp_write( tp, 0xFA84, 0x74F8 ); + mac_ocp_write( tp, 0xFA86, 0x74F8 ); + mac_ocp_write( tp, 0xFA88, 0xE73A ); + mac_ocp_write( tp, 0xFA8A, 0x49E1 ); + mac_ocp_write( tp, 0xFA8C, 0xF007 ); + mac_ocp_write( tp, 0xFA8E, 0x1D02 ); + mac_ocp_write( tp, 0xFA90, 0x8DF4 ); + mac_ocp_write( tp, 0xFA92, 0x1E01 ); + mac_ocp_write( tp, 0xFA94, 0xE7A7 ); + mac_ocp_write( tp, 0xFA96, 0xDE20 ); + mac_ocp_write( tp, 0xFA98, 0xE410 ); + mac_ocp_write( tp, 0xFA9A, 0x49E0 ); + mac_ocp_write( tp, 0xFA9C, 0xF017 ); + mac_ocp_write( tp, 0xFA9E, 0x1D01 ); + mac_ocp_write( tp, 0xFAA0, 0x8DF4 ); + mac_ocp_write( tp, 0xFAA2, 0xC5FA ); + mac_ocp_write( tp, 0xFAA4, 0x1C00 ); + mac_ocp_write( tp, 0xFAA6, 0x8CA0 ); + mac_ocp_write( tp, 0xFAA8, 0x1C1B ); + mac_ocp_write( tp, 0xFAAA, 0x9CA2 ); + mac_ocp_write( tp, 0xFAAC, 0x74A2 ); + mac_ocp_write( tp, 0xFAAE, 0x49CF ); + mac_ocp_write( tp, 0xFAB0, 0xF0FE ); + mac_ocp_write( tp, 0xFAB2, 0xC5F3 ); + mac_ocp_write( tp, 0xFAB4, 0x74A0 ); + mac_ocp_write( tp, 0xFAB6, 0x4849 ); + mac_ocp_write( tp, 0xFAB8, 0x9CA0 ); + mac_ocp_write( tp, 0xFABA, 0x74F8 ); + mac_ocp_write( tp, 0xFABC, 0x49C0 ); + mac_ocp_write( tp, 0xFABE, 0xF006 ); + mac_ocp_write( tp, 0xFAC0, 0x48C3 ); + mac_ocp_write( tp, 0xFAC2, 0x8CF8 ); + mac_ocp_write( tp, 0xFAC4, 0xE820 ); + mac_ocp_write( tp, 0xFAC6, 0x74F8 ); + mac_ocp_write( tp, 0xFAC8, 0x74F8 ); + mac_ocp_write( tp, 0xFACA, 0xC432 ); + mac_ocp_write( tp, 0xFACC, 0xBC00 ); + mac_ocp_write( tp, 0xFACE, 0xC5E4 ); + mac_ocp_write( tp, 0xFAD0, 0x74A2 ); + mac_ocp_write( tp, 0xFAD2, 0x49CE ); + mac_ocp_write( tp, 0xFAD4, 0xF1FE ); + mac_ocp_write( tp, 0xFAD6, 0x9EA0 ); + mac_ocp_write( tp, 0xFAD8, 0x1C1C ); + mac_ocp_write( tp, 0xFADA, 0x484F ); + mac_ocp_write( tp, 0xFADC, 0x9CA2 ); + mac_ocp_write( tp, 0xFADE, 0xFF80 ); + mac_ocp_write( tp, 0xFAE0, 0xB404 ); + mac_ocp_write( tp, 0xFAE2, 0xB405 ); + mac_ocp_write( tp, 0xFAE4, 0xC5D9 ); + mac_ocp_write( tp, 0xFAE6, 0x74A2 ); + mac_ocp_write( tp, 0xFAE8, 0x49CE ); + mac_ocp_write( tp, 0xFAEA, 0xF1FE ); + mac_ocp_write( tp, 0xFAEC, 0xC41F ); + mac_ocp_write( tp, 0xFAEE, 0x9CA0 ); + mac_ocp_write( tp, 0xFAF0, 0xC41C ); + mac_ocp_write( tp, 0xFAF2, 0x1C13 ); + mac_ocp_write( tp, 0xFAF4, 0x484F ); + mac_ocp_write( tp, 0xFAF6, 0x9CA2 ); + mac_ocp_write( tp, 0xFAF8, 0x74A2 ); + mac_ocp_write( tp, 0xFAFA, 0x49CF ); + mac_ocp_write( tp, 0xFAFC, 0xF1FE ); + mac_ocp_write( tp, 0xFAFE, 0xB005 ); + mac_ocp_write( tp, 0xFB00, 0xB004 ); + mac_ocp_write( tp, 0xFB02, 0xFF80 ); + mac_ocp_write( tp, 0xFB04, 0xB404 ); + mac_ocp_write( tp, 0xFB06, 0xB405 ); + mac_ocp_write( tp, 0xFB08, 0xC5C7 ); + mac_ocp_write( tp, 0xFB0A, 0x74A2 ); + mac_ocp_write( tp, 0xFB0C, 0x49CE ); + mac_ocp_write( tp, 0xFB0E, 0xF1FE ); + mac_ocp_write( tp, 0xFB10, 0xC40E ); + mac_ocp_write( tp, 0xFB12, 0x9CA0 ); + mac_ocp_write( tp, 0xFB14, 0xC40A ); + mac_ocp_write( tp, 0xFB16, 0x1C13 ); + mac_ocp_write( tp, 0xFB18, 0x484F ); + mac_ocp_write( tp, 0xFB1A, 0x9CA2 ); + mac_ocp_write( tp, 0xFB1C, 0x74A2 ); + mac_ocp_write( tp, 0xFB1E, 0x49CF ); + mac_ocp_write( tp, 0xFB20, 0xF1FE ); + mac_ocp_write( tp, 0xFB22, 0xB005 ); + mac_ocp_write( tp, 0xFB24, 0xB004 ); + mac_ocp_write( tp, 0xFB26, 0xFF80 ); + mac_ocp_write( tp, 0xFB28, 0x0000 ); + mac_ocp_write( tp, 0xFB2A, 0x0481 ); + mac_ocp_write( tp, 0xFB2C, 0x0C81 ); + mac_ocp_write( tp, 0xFB2E, 0x0AE0 ); + + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC28, 0x0000 ); + mac_ocp_write( tp, 0xFC2A, 0x0000 ); + mac_ocp_write( tp, 0xFC2C, 0x0297 ); + mac_ocp_write( tp, 0xFC2E, 0x0000 ); + mac_ocp_write( tp, 0xFC30, 0x00A9 ); + mac_ocp_write( tp, 0xFC32, 0x012D ); + mac_ocp_write( tp, 0xFC34, 0x0000 ); + mac_ocp_write( tp, 0xFC36, 0x08DF ); +} + +static void +rtl8168_set_mac_mcu_8411b_1(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE00A ); + mac_ocp_write( tp, 0xF804, 0xE00C ); + mac_ocp_write( tp, 0xF806, 0xE00E ); + mac_ocp_write( tp, 0xF808, 0xE027 ); + mac_ocp_write( tp, 0xF80A, 0xE04F ); + mac_ocp_write( tp, 0xF80C, 0xE05E ); + mac_ocp_write( tp, 0xF80E, 0xE065 ); + mac_ocp_write( tp, 0xF810, 0xC602 ); + mac_ocp_write( tp, 0xF812, 0xBE00 ); + mac_ocp_write( tp, 0xF814, 0x0000 ); + mac_ocp_write( tp, 0xF816, 0xC502 ); + mac_ocp_write( tp, 0xF818, 0xBD00 ); + mac_ocp_write( tp, 0xF81A, 0x074C ); + mac_ocp_write( tp, 0xF81C, 0xC302 ); + mac_ocp_write( tp, 0xF81E, 0xBB00 ); + mac_ocp_write( tp, 0xF820, 0x080A ); + mac_ocp_write( tp, 0xF822, 0x6420 ); + mac_ocp_write( tp, 0xF824, 0x48C2 ); + mac_ocp_write( tp, 0xF826, 0x8C20 ); + mac_ocp_write( tp, 0xF828, 0xC516 ); + mac_ocp_write( tp, 0xF82A, 0x64A4 ); + mac_ocp_write( tp, 0xF82C, 0x49C0 ); + mac_ocp_write( tp, 0xF82E, 0xF009 ); + mac_ocp_write( tp, 0xF830, 0x74A2 ); + mac_ocp_write( tp, 0xF832, 0x8CA5 ); + mac_ocp_write( tp, 0xF834, 0x74A0 ); + mac_ocp_write( tp, 0xF836, 0xC50E ); + mac_ocp_write( tp, 0xF838, 0x9CA2 ); + mac_ocp_write( tp, 0xF83A, 0x1C11 ); + mac_ocp_write( tp, 0xF83C, 0x9CA0 ); + mac_ocp_write( tp, 0xF83E, 0xE006 ); + mac_ocp_write( tp, 0xF840, 0x74F8 ); + mac_ocp_write( tp, 0xF842, 0x48C4 ); + mac_ocp_write( tp, 0xF844, 0x8CF8 ); + mac_ocp_write( tp, 0xF846, 0xC404 ); + mac_ocp_write( tp, 0xF848, 0xBC00 ); + mac_ocp_write( tp, 0xF84A, 0xC403 ); + mac_ocp_write( tp, 0xF84C, 0xBC00 ); + mac_ocp_write( tp, 0xF84E, 0x0BF2 ); + mac_ocp_write( tp, 0xF850, 0x0C0A ); + mac_ocp_write( tp, 0xF852, 0xE434 ); + mac_ocp_write( tp, 0xF854, 0xD3C0 ); + mac_ocp_write( tp, 0xF856, 0x49D9 ); + mac_ocp_write( tp, 0xF858, 0xF01F ); + mac_ocp_write( tp, 0xF85A, 0xC526 ); + mac_ocp_write( tp, 0xF85C, 0x64A5 ); + mac_ocp_write( tp, 0xF85E, 0x1400 ); + mac_ocp_write( tp, 0xF860, 0xF007 ); + mac_ocp_write( tp, 0xF862, 0x0C01 ); + mac_ocp_write( tp, 0xF864, 0x8CA5 ); + mac_ocp_write( tp, 0xF866, 0x1C15 ); + mac_ocp_write( tp, 0xF868, 0xC51B ); + mac_ocp_write( tp, 0xF86A, 0x9CA0 ); + mac_ocp_write( tp, 0xF86C, 0xE013 ); + mac_ocp_write( tp, 0xF86E, 0xC519 ); + mac_ocp_write( tp, 0xF870, 0x74A0 ); + mac_ocp_write( tp, 0xF872, 0x48C4 ); + mac_ocp_write( tp, 0xF874, 0x8CA0 ); + mac_ocp_write( tp, 0xF876, 0xC516 ); + mac_ocp_write( tp, 0xF878, 0x74A4 ); + mac_ocp_write( tp, 0xF87A, 0x48C8 ); + mac_ocp_write( tp, 0xF87C, 0x48CA ); + mac_ocp_write( tp, 0xF87E, 0x9CA4 ); + mac_ocp_write( tp, 0xF880, 0xC512 ); + mac_ocp_write( tp, 0xF882, 0x1B00 ); + mac_ocp_write( tp, 0xF884, 0x9BA0 ); + mac_ocp_write( tp, 0xF886, 0x1B1C ); + mac_ocp_write( tp, 0xF888, 0x483F ); + mac_ocp_write( tp, 0xF88A, 0x9BA2 ); + mac_ocp_write( tp, 0xF88C, 0x1B04 ); + mac_ocp_write( tp, 0xF88E, 0xC508 ); + mac_ocp_write( tp, 0xF890, 0x9BA0 ); + mac_ocp_write( tp, 0xF892, 0xC505 ); + mac_ocp_write( tp, 0xF894, 0xBD00 ); + mac_ocp_write( tp, 0xF896, 0xC502 ); + mac_ocp_write( tp, 0xF898, 0xBD00 ); + mac_ocp_write( tp, 0xF89A, 0x0300 ); + mac_ocp_write( tp, 0xF89C, 0x051E ); + mac_ocp_write( tp, 0xF89E, 0xE434 ); + mac_ocp_write( tp, 0xF8A0, 0xE018 ); + mac_ocp_write( tp, 0xF8A2, 0xE092 ); + mac_ocp_write( tp, 0xF8A4, 0xDE20 ); + mac_ocp_write( tp, 0xF8A6, 0xD3C0 ); + mac_ocp_write( tp, 0xF8A8, 0xC50F ); + mac_ocp_write( tp, 0xF8AA, 0x76A4 ); + mac_ocp_write( tp, 0xF8AC, 0x49E3 ); + mac_ocp_write( tp, 0xF8AE, 0xF007 ); + mac_ocp_write( tp, 0xF8B0, 0x49C0 ); + mac_ocp_write( tp, 0xF8B2, 0xF103 ); + mac_ocp_write( tp, 0xF8B4, 0xC607 ); + mac_ocp_write( tp, 0xF8B6, 0xBE00 ); + mac_ocp_write( tp, 0xF8B8, 0xC606 ); + mac_ocp_write( tp, 0xF8BA, 0xBE00 ); + mac_ocp_write( tp, 0xF8BC, 0xC602 ); + mac_ocp_write( tp, 0xF8BE, 0xBE00 ); + mac_ocp_write( tp, 0xF8C0, 0x0C4C ); + mac_ocp_write( tp, 0xF8C2, 0x0C28 ); + mac_ocp_write( tp, 0xF8C4, 0x0C2C ); + mac_ocp_write( tp, 0xF8C6, 0xDC00 ); + mac_ocp_write( tp, 0xF8C8, 0xC707 ); + mac_ocp_write( tp, 0xF8CA, 0x1D00 ); + mac_ocp_write( tp, 0xF8CC, 0x8DE2 ); + mac_ocp_write( tp, 0xF8CE, 0x48C1 ); + mac_ocp_write( tp, 0xF8D0, 0xC502 ); + mac_ocp_write( tp, 0xF8D2, 0xBD00 ); + mac_ocp_write( tp, 0xF8D4, 0x00AA ); + mac_ocp_write( tp, 0xF8D6, 0xE0C0 ); + mac_ocp_write( tp, 0xF8D8, 0xC502 ); + mac_ocp_write( tp, 0xF8DA, 0xBD00 ); + mac_ocp_write( tp, 0xF8DC, 0x0132 ); + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC2A, 0x0743 ); + mac_ocp_write( tp, 0xFC2C, 0x0801 ); + mac_ocp_write( tp, 0xFC2E, 0x0BE9 ); + mac_ocp_write( tp, 0xFC30, 0x02FD ); + mac_ocp_write( tp, 0xFC32, 0x0C25 ); + mac_ocp_write( tp, 0xFC34, 0x00A9 ); + mac_ocp_write( tp, 0xFC36, 0x012D ); +} + +static void +rtl8168_set_mac_mcu_8168ep_1(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE0D3 ); + mac_ocp_write( tp, 0xF804, 0xE0D6 ); + mac_ocp_write( tp, 0xF806, 0xE0D9 ); + mac_ocp_write( tp, 0xF808, 0xE0DB ); + mac_ocp_write( tp, 0xF80A, 0xE0DD ); + mac_ocp_write( tp, 0xF80C, 0xE0DF ); + mac_ocp_write( tp, 0xF80E, 0xE0E1 ); + mac_ocp_write( tp, 0xF810, 0xC251 ); + mac_ocp_write( tp, 0xF812, 0x7340 ); + mac_ocp_write( tp, 0xF814, 0x49B1 ); + mac_ocp_write( tp, 0xF816, 0xF010 ); + mac_ocp_write( tp, 0xF818, 0x1D02 ); + mac_ocp_write( tp, 0xF81A, 0x8D40 ); + mac_ocp_write( tp, 0xF81C, 0xC202 ); + mac_ocp_write( tp, 0xF81E, 0xBA00 ); + mac_ocp_write( tp, 0xF820, 0x2C3A ); + mac_ocp_write( tp, 0xF822, 0xC0F0 ); + mac_ocp_write( tp, 0xF824, 0xE8DE ); + mac_ocp_write( tp, 0xF826, 0x2000 ); + mac_ocp_write( tp, 0xF828, 0x8000 ); + mac_ocp_write( tp, 0xF82A, 0xC0B6 ); + mac_ocp_write( tp, 0xF82C, 0x268C ); + mac_ocp_write( tp, 0xF82E, 0x752C ); + mac_ocp_write( tp, 0xF830, 0x49D4 ); + mac_ocp_write( tp, 0xF832, 0xF112 ); + mac_ocp_write( tp, 0xF834, 0xE025 ); + mac_ocp_write( tp, 0xF836, 0xC2F6 ); + mac_ocp_write( tp, 0xF838, 0x7146 ); + mac_ocp_write( tp, 0xF83A, 0xC2F5 ); + mac_ocp_write( tp, 0xF83C, 0x7340 ); + mac_ocp_write( tp, 0xF83E, 0x49BE ); + mac_ocp_write( tp, 0xF840, 0xF103 ); + mac_ocp_write( tp, 0xF842, 0xC7F2 ); + mac_ocp_write( tp, 0xF844, 0xE002 ); + mac_ocp_write( tp, 0xF846, 0xC7F1 ); + mac_ocp_write( tp, 0xF848, 0x304F ); + mac_ocp_write( tp, 0xF84A, 0x6226 ); + mac_ocp_write( tp, 0xF84C, 0x49A1 ); + mac_ocp_write( tp, 0xF84E, 0xF1F0 ); + mac_ocp_write( tp, 0xF850, 0x7222 ); + mac_ocp_write( tp, 0xF852, 0x49A0 ); + mac_ocp_write( tp, 0xF854, 0xF1ED ); + mac_ocp_write( tp, 0xF856, 0x2525 ); + mac_ocp_write( tp, 0xF858, 0x1F28 ); + mac_ocp_write( tp, 0xF85A, 0x3097 ); + mac_ocp_write( tp, 0xF85C, 0x3091 ); + mac_ocp_write( tp, 0xF85E, 0x9A36 ); + mac_ocp_write( tp, 0xF860, 0x752C ); + mac_ocp_write( tp, 0xF862, 0x21DC ); + mac_ocp_write( tp, 0xF864, 0x25BC ); + mac_ocp_write( tp, 0xF866, 0xC6E2 ); + mac_ocp_write( tp, 0xF868, 0x77C0 ); + mac_ocp_write( tp, 0xF86A, 0x1304 ); + mac_ocp_write( tp, 0xF86C, 0xF014 ); + mac_ocp_write( tp, 0xF86E, 0x1303 ); + mac_ocp_write( tp, 0xF870, 0xF014 ); + mac_ocp_write( tp, 0xF872, 0x1302 ); + mac_ocp_write( tp, 0xF874, 0xF014 ); + mac_ocp_write( tp, 0xF876, 0x1301 ); + mac_ocp_write( tp, 0xF878, 0xF014 ); + mac_ocp_write( tp, 0xF87A, 0x49D4 ); + mac_ocp_write( tp, 0xF87C, 0xF103 ); + mac_ocp_write( tp, 0xF87E, 0xC3D7 ); + mac_ocp_write( tp, 0xF880, 0xBB00 ); + mac_ocp_write( tp, 0xF882, 0xC618 ); + mac_ocp_write( tp, 0xF884, 0x67C6 ); + mac_ocp_write( tp, 0xF886, 0x752E ); + mac_ocp_write( tp, 0xF888, 0x22D7 ); + mac_ocp_write( tp, 0xF88A, 0x26DD ); + mac_ocp_write( tp, 0xF88C, 0x1505 ); + mac_ocp_write( tp, 0xF88E, 0xF013 ); + mac_ocp_write( tp, 0xF890, 0xC60A ); + mac_ocp_write( tp, 0xF892, 0xBE00 ); + mac_ocp_write( tp, 0xF894, 0xC309 ); + mac_ocp_write( tp, 0xF896, 0xBB00 ); + mac_ocp_write( tp, 0xF898, 0xC308 ); + mac_ocp_write( tp, 0xF89A, 0xBB00 ); + mac_ocp_write( tp, 0xF89C, 0xC307 ); + mac_ocp_write( tp, 0xF89E, 0xBB00 ); + mac_ocp_write( tp, 0xF8A0, 0xC306 ); + mac_ocp_write( tp, 0xF8A2, 0xBB00 ); + mac_ocp_write( tp, 0xF8A4, 0x25C8 ); + mac_ocp_write( tp, 0xF8A6, 0x25A6 ); + mac_ocp_write( tp, 0xF8A8, 0x25AC ); + mac_ocp_write( tp, 0xF8AA, 0x25B2 ); + mac_ocp_write( tp, 0xF8AC, 0x25B8 ); + mac_ocp_write( tp, 0xF8AE, 0xCD08 ); + mac_ocp_write( tp, 0xF8B0, 0x0000 ); + mac_ocp_write( tp, 0xF8B2, 0xC0BC ); + mac_ocp_write( tp, 0xF8B4, 0xC2FF ); + mac_ocp_write( tp, 0xF8B6, 0x7340 ); + mac_ocp_write( tp, 0xF8B8, 0x49B0 ); + mac_ocp_write( tp, 0xF8BA, 0xF04E ); + mac_ocp_write( tp, 0xF8BC, 0x1F46 ); + mac_ocp_write( tp, 0xF8BE, 0x308F ); + mac_ocp_write( tp, 0xF8C0, 0xC3F7 ); + mac_ocp_write( tp, 0xF8C2, 0x1C04 ); + mac_ocp_write( tp, 0xF8C4, 0xE84D ); + mac_ocp_write( tp, 0xF8C6, 0x1401 ); + mac_ocp_write( tp, 0xF8C8, 0xF147 ); + mac_ocp_write( tp, 0xF8CA, 0x7226 ); + mac_ocp_write( tp, 0xF8CC, 0x49A7 ); + mac_ocp_write( tp, 0xF8CE, 0xF044 ); + mac_ocp_write( tp, 0xF8D0, 0x7222 ); + mac_ocp_write( tp, 0xF8D2, 0x2525 ); + mac_ocp_write( tp, 0xF8D4, 0x1F30 ); + mac_ocp_write( tp, 0xF8D6, 0x3097 ); + mac_ocp_write( tp, 0xF8D8, 0x3091 ); + mac_ocp_write( tp, 0xF8DA, 0x7340 ); + mac_ocp_write( tp, 0xF8DC, 0xC4EA ); + mac_ocp_write( tp, 0xF8DE, 0x401C ); + mac_ocp_write( tp, 0xF8E0, 0xF006 ); + mac_ocp_write( tp, 0xF8E2, 0xC6E8 ); + mac_ocp_write( tp, 0xF8E4, 0x75C0 ); + mac_ocp_write( tp, 0xF8E6, 0x49D7 ); + mac_ocp_write( tp, 0xF8E8, 0xF105 ); + mac_ocp_write( tp, 0xF8EA, 0xE036 ); + mac_ocp_write( tp, 0xF8EC, 0x1D08 ); + mac_ocp_write( tp, 0xF8EE, 0x8DC1 ); + mac_ocp_write( tp, 0xF8F0, 0x0208 ); + mac_ocp_write( tp, 0xF8F2, 0x6640 ); + mac_ocp_write( tp, 0xF8F4, 0x2764 ); + mac_ocp_write( tp, 0xF8F6, 0x1606 ); + mac_ocp_write( tp, 0xF8F8, 0xF12F ); + mac_ocp_write( tp, 0xF8FA, 0x6346 ); + mac_ocp_write( tp, 0xF8FC, 0x133B ); + mac_ocp_write( tp, 0xF8FE, 0xF12C ); + mac_ocp_write( tp, 0xF900, 0x9B34 ); + mac_ocp_write( tp, 0xF902, 0x1B18 ); + mac_ocp_write( tp, 0xF904, 0x3093 ); + mac_ocp_write( tp, 0xF906, 0xC32A ); + mac_ocp_write( tp, 0xF908, 0x1C10 ); + mac_ocp_write( tp, 0xF90A, 0xE82A ); + mac_ocp_write( tp, 0xF90C, 0x1401 ); + mac_ocp_write( tp, 0xF90E, 0xF124 ); + mac_ocp_write( tp, 0xF910, 0x1A36 ); + mac_ocp_write( tp, 0xF912, 0x308A ); + mac_ocp_write( tp, 0xF914, 0x7322 ); + mac_ocp_write( tp, 0xF916, 0x25B5 ); + mac_ocp_write( tp, 0xF918, 0x0B0E ); + mac_ocp_write( tp, 0xF91A, 0x1C00 ); + mac_ocp_write( tp, 0xF91C, 0xE82C ); + mac_ocp_write( tp, 0xF91E, 0xC71F ); + mac_ocp_write( tp, 0xF920, 0x4027 ); + mac_ocp_write( tp, 0xF922, 0xF11A ); + mac_ocp_write( tp, 0xF924, 0xE838 ); + mac_ocp_write( tp, 0xF926, 0x1F42 ); + mac_ocp_write( tp, 0xF928, 0x308F ); + mac_ocp_write( tp, 0xF92A, 0x1B08 ); + mac_ocp_write( tp, 0xF92C, 0xE824 ); + mac_ocp_write( tp, 0xF92E, 0x7236 ); + mac_ocp_write( tp, 0xF930, 0x7746 ); + mac_ocp_write( tp, 0xF932, 0x1700 ); + mac_ocp_write( tp, 0xF934, 0xF00D ); + mac_ocp_write( tp, 0xF936, 0xC313 ); + mac_ocp_write( tp, 0xF938, 0x401F ); + mac_ocp_write( tp, 0xF93A, 0xF103 ); + mac_ocp_write( tp, 0xF93C, 0x1F00 ); + mac_ocp_write( tp, 0xF93E, 0x9F46 ); + mac_ocp_write( tp, 0xF940, 0x7744 ); + mac_ocp_write( tp, 0xF942, 0x449F ); + mac_ocp_write( tp, 0xF944, 0x445F ); + mac_ocp_write( tp, 0xF946, 0xE817 ); + mac_ocp_write( tp, 0xF948, 0xC70A ); + mac_ocp_write( tp, 0xF94A, 0x4027 ); + mac_ocp_write( tp, 0xF94C, 0xF105 ); + mac_ocp_write( tp, 0xF94E, 0xC302 ); + mac_ocp_write( tp, 0xF950, 0xBB00 ); + mac_ocp_write( tp, 0xF952, 0x2E08 ); + mac_ocp_write( tp, 0xF954, 0x2DC2 ); + mac_ocp_write( tp, 0xF956, 0xC7FF ); + mac_ocp_write( tp, 0xF958, 0xBF00 ); + mac_ocp_write( tp, 0xF95A, 0xCDB8 ); + mac_ocp_write( tp, 0xF95C, 0xFFFF ); + mac_ocp_write( tp, 0xF95E, 0x0C02 ); + mac_ocp_write( tp, 0xF960, 0xA554 ); + mac_ocp_write( tp, 0xF962, 0xA5DC ); + mac_ocp_write( tp, 0xF964, 0x402F ); + mac_ocp_write( tp, 0xF966, 0xF105 ); + mac_ocp_write( tp, 0xF968, 0x1400 ); + mac_ocp_write( tp, 0xF96A, 0xF1FA ); + mac_ocp_write( tp, 0xF96C, 0x1C01 ); + mac_ocp_write( tp, 0xF96E, 0xE002 ); + mac_ocp_write( tp, 0xF970, 0x1C00 ); + mac_ocp_write( tp, 0xF972, 0xFF80 ); + mac_ocp_write( tp, 0xF974, 0x49B0 ); + mac_ocp_write( tp, 0xF976, 0xF004 ); + mac_ocp_write( tp, 0xF978, 0x0B01 ); + mac_ocp_write( tp, 0xF97A, 0xA1D3 ); + mac_ocp_write( tp, 0xF97C, 0xE003 ); + mac_ocp_write( tp, 0xF97E, 0x0B02 ); + mac_ocp_write( tp, 0xF980, 0xA5D3 ); + mac_ocp_write( tp, 0xF982, 0x3127 ); + mac_ocp_write( tp, 0xF984, 0x3720 ); + mac_ocp_write( tp, 0xF986, 0x0B02 ); + mac_ocp_write( tp, 0xF988, 0xA5D3 ); + mac_ocp_write( tp, 0xF98A, 0x3127 ); + mac_ocp_write( tp, 0xF98C, 0x3720 ); + mac_ocp_write( tp, 0xF98E, 0x1300 ); + mac_ocp_write( tp, 0xF990, 0xF1FB ); + mac_ocp_write( tp, 0xF992, 0xFF80 ); + mac_ocp_write( tp, 0xF994, 0x7322 ); + mac_ocp_write( tp, 0xF996, 0x25B5 ); + mac_ocp_write( tp, 0xF998, 0x1E28 ); + mac_ocp_write( tp, 0xF99A, 0x30DE ); + mac_ocp_write( tp, 0xF99C, 0x30D9 ); + mac_ocp_write( tp, 0xF99E, 0x7264 ); + mac_ocp_write( tp, 0xF9A0, 0x1E11 ); + mac_ocp_write( tp, 0xF9A2, 0x2368 ); + mac_ocp_write( tp, 0xF9A4, 0x3116 ); + mac_ocp_write( tp, 0xF9A6, 0xFF80 ); + mac_ocp_write( tp, 0xF9A8, 0x1B7E ); + mac_ocp_write( tp, 0xF9AA, 0xC602 ); + mac_ocp_write( tp, 0xF9AC, 0xBE00 ); + mac_ocp_write( tp, 0xF9AE, 0x06A6 ); + mac_ocp_write( tp, 0xF9B0, 0x1B7E ); + mac_ocp_write( tp, 0xF9B2, 0xC602 ); + mac_ocp_write( tp, 0xF9B4, 0xBE00 ); + mac_ocp_write( tp, 0xF9B6, 0x0764 ); + mac_ocp_write( tp, 0xF9B8, 0xC602 ); + mac_ocp_write( tp, 0xF9BA, 0xBE00 ); + mac_ocp_write( tp, 0xF9BC, 0x0000 ); + mac_ocp_write( tp, 0xF9BE, 0xC602 ); + mac_ocp_write( tp, 0xF9C0, 0xBE00 ); + mac_ocp_write( tp, 0xF9C2, 0x0000 ); + mac_ocp_write( tp, 0xF9C4, 0xC602 ); + mac_ocp_write( tp, 0xF9C6, 0xBE00 ); + mac_ocp_write( tp, 0xF9C8, 0x0000 ); + mac_ocp_write( tp, 0xF9CA, 0xC602 ); + mac_ocp_write( tp, 0xF9CC, 0xBE00 ); + mac_ocp_write( tp, 0xF9CE, 0x0000 ); + mac_ocp_write( tp, 0xF9D0, 0xC602 ); + mac_ocp_write( tp, 0xF9D2, 0xBE00 ); + mac_ocp_write( tp, 0xF9D4, 0x0000 ); + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC28, 0x2549 ); + mac_ocp_write( tp, 0xFC2A, 0x06A5 ); + mac_ocp_write( tp, 0xFC2C, 0x0763 ); +} + +static void +rtl8168_set_mac_mcu_8168ep_2(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write( tp, 0xF800, 0xE008 ); + mac_ocp_write( tp, 0xF802, 0xE017 ); + mac_ocp_write( tp, 0xF804, 0xE019 ); + mac_ocp_write( tp, 0xF806, 0xE01B ); + mac_ocp_write( tp, 0xF808, 0xE01D ); + mac_ocp_write( tp, 0xF80A, 0xE01F ); + mac_ocp_write( tp, 0xF80C, 0xE021 ); + mac_ocp_write( tp, 0xF80E, 0xE023 ); + mac_ocp_write( tp, 0xF810, 0xC50F ); + mac_ocp_write( tp, 0xF812, 0x76A4 ); + mac_ocp_write( tp, 0xF814, 0x49E3 ); + mac_ocp_write( tp, 0xF816, 0xF007 ); + mac_ocp_write( tp, 0xF818, 0x49C0 ); + mac_ocp_write( tp, 0xF81A, 0xF103 ); + mac_ocp_write( tp, 0xF81C, 0xC607 ); + mac_ocp_write( tp, 0xF81E, 0xBE00 ); + mac_ocp_write( tp, 0xF820, 0xC606 ); + mac_ocp_write( tp, 0xF822, 0xBE00 ); + mac_ocp_write( tp, 0xF824, 0xC602 ); + mac_ocp_write( tp, 0xF826, 0xBE00 ); + mac_ocp_write( tp, 0xF828, 0x0BDA ); + mac_ocp_write( tp, 0xF82A, 0x0BB0 ); + mac_ocp_write( tp, 0xF82C, 0x0BBA ); + mac_ocp_write( tp, 0xF82E, 0xDC00 ); + mac_ocp_write( tp, 0xF830, 0xC602 ); + mac_ocp_write( tp, 0xF832, 0xBE00 ); + mac_ocp_write( tp, 0xF834, 0x0000 ); + mac_ocp_write( tp, 0xF836, 0xC602 ); + mac_ocp_write( tp, 0xF838, 0xBE00 ); + mac_ocp_write( tp, 0xF83A, 0x0000 ); + mac_ocp_write( tp, 0xF83C, 0xC602 ); + mac_ocp_write( tp, 0xF83E, 0xBE00 ); + mac_ocp_write( tp, 0xF840, 0x0000 ); + mac_ocp_write( tp, 0xF842, 0xC602 ); + mac_ocp_write( tp, 0xF844, 0xBE00 ); + mac_ocp_write( tp, 0xF846, 0x0000 ); + mac_ocp_write( tp, 0xF848, 0xC602 ); + mac_ocp_write( tp, 0xF84A, 0xBE00 ); + mac_ocp_write( tp, 0xF84C, 0x0000 ); + mac_ocp_write( tp, 0xF84E, 0xC602 ); + mac_ocp_write( tp, 0xF850, 0xBE00 ); + mac_ocp_write( tp, 0xF852, 0x0000 ); + mac_ocp_write( tp, 0xF854, 0xC602 ); + mac_ocp_write( tp, 0xF856, 0xBE00 ); + mac_ocp_write( tp, 0xF858, 0x0000 ); + + mac_ocp_write( tp, 0xFC26, 0x8000 ); + + mac_ocp_write( tp, 0xFC28, 0x0BB3 ); +} + +static void +rtl8168_set_mac_mcu_8168h_1(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write(tp, 0xF800, 0xE008); + mac_ocp_write(tp, 0xF802, 0xE00F); + mac_ocp_write(tp, 0xF804, 0xE011); + mac_ocp_write(tp, 0xF806, 0xE047); + mac_ocp_write(tp, 0xF808, 0xE049); + mac_ocp_write(tp, 0xF80A, 0xE073); + mac_ocp_write(tp, 0xF80C, 0xE075); + mac_ocp_write(tp, 0xF80E, 0xE077); + mac_ocp_write(tp, 0xF810, 0xC707); + mac_ocp_write(tp, 0xF812, 0x1D00); + mac_ocp_write(tp, 0xF814, 0x8DE2); + mac_ocp_write(tp, 0xF816, 0x48C1); + mac_ocp_write(tp, 0xF818, 0xC502); + mac_ocp_write(tp, 0xF81A, 0xBD00); + mac_ocp_write(tp, 0xF81C, 0x00E4); + mac_ocp_write(tp, 0xF81E, 0xE0C0); + mac_ocp_write(tp, 0xF820, 0xC502); + mac_ocp_write(tp, 0xF822, 0xBD00); + mac_ocp_write(tp, 0xF824, 0x0216); + mac_ocp_write(tp, 0xF826, 0xC634); + mac_ocp_write(tp, 0xF828, 0x75C0); + mac_ocp_write(tp, 0xF82A, 0x49D3); + mac_ocp_write(tp, 0xF82C, 0xF027); + mac_ocp_write(tp, 0xF82E, 0xC631); + mac_ocp_write(tp, 0xF830, 0x75C0); + mac_ocp_write(tp, 0xF832, 0x49D3); + mac_ocp_write(tp, 0xF834, 0xF123); + mac_ocp_write(tp, 0xF836, 0xC627); + mac_ocp_write(tp, 0xF838, 0x75C0); + mac_ocp_write(tp, 0xF83A, 0xB405); + mac_ocp_write(tp, 0xF83C, 0xC525); + mac_ocp_write(tp, 0xF83E, 0x9DC0); + mac_ocp_write(tp, 0xF840, 0xC621); + mac_ocp_write(tp, 0xF842, 0x75C8); + mac_ocp_write(tp, 0xF844, 0x49D5); + mac_ocp_write(tp, 0xF846, 0xF00A); + mac_ocp_write(tp, 0xF848, 0x49D6); + mac_ocp_write(tp, 0xF84A, 0xF008); + mac_ocp_write(tp, 0xF84C, 0x49D7); + mac_ocp_write(tp, 0xF84E, 0xF006); + mac_ocp_write(tp, 0xF850, 0x49D8); + mac_ocp_write(tp, 0xF852, 0xF004); + mac_ocp_write(tp, 0xF854, 0x75D2); + mac_ocp_write(tp, 0xF856, 0x49D9); + mac_ocp_write(tp, 0xF858, 0xF111); + mac_ocp_write(tp, 0xF85A, 0xC517); + mac_ocp_write(tp, 0xF85C, 0x9DC8); + mac_ocp_write(tp, 0xF85E, 0xC516); + mac_ocp_write(tp, 0xF860, 0x9DD2); + mac_ocp_write(tp, 0xF862, 0xC618); + mac_ocp_write(tp, 0xF864, 0x75C0); + mac_ocp_write(tp, 0xF866, 0x49D4); + mac_ocp_write(tp, 0xF868, 0xF003); + mac_ocp_write(tp, 0xF86A, 0x49D0); + mac_ocp_write(tp, 0xF86C, 0xF104); + mac_ocp_write(tp, 0xF86E, 0xC60A); + mac_ocp_write(tp, 0xF870, 0xC50E); + mac_ocp_write(tp, 0xF872, 0x9DC0); + mac_ocp_write(tp, 0xF874, 0xB005); + mac_ocp_write(tp, 0xF876, 0xC607); + mac_ocp_write(tp, 0xF878, 0x9DC0); + mac_ocp_write(tp, 0xF87A, 0xB007); + mac_ocp_write(tp, 0xF87C, 0xC602); + mac_ocp_write(tp, 0xF87E, 0xBE00); + mac_ocp_write(tp, 0xF880, 0x1A06); + mac_ocp_write(tp, 0xF882, 0xB400); + mac_ocp_write(tp, 0xF884, 0xE86C); + mac_ocp_write(tp, 0xF886, 0xA000); + mac_ocp_write(tp, 0xF888, 0x01E1); + mac_ocp_write(tp, 0xF88A, 0x0200); + mac_ocp_write(tp, 0xF88C, 0x9200); + mac_ocp_write(tp, 0xF88E, 0xE84C); + mac_ocp_write(tp, 0xF890, 0xE004); + mac_ocp_write(tp, 0xF892, 0xE908); + mac_ocp_write(tp, 0xF894, 0xC502); + mac_ocp_write(tp, 0xF896, 0xBD00); + mac_ocp_write(tp, 0xF898, 0x0B58); + mac_ocp_write(tp, 0xF89A, 0xB407); + mac_ocp_write(tp, 0xF89C, 0xB404); + mac_ocp_write(tp, 0xF89E, 0x2195); + mac_ocp_write(tp, 0xF8A0, 0x25BD); + mac_ocp_write(tp, 0xF8A2, 0x9BE0); + mac_ocp_write(tp, 0xF8A4, 0x1C1C); + mac_ocp_write(tp, 0xF8A6, 0x484F); + mac_ocp_write(tp, 0xF8A8, 0x9CE2); + mac_ocp_write(tp, 0xF8AA, 0x72E2); + mac_ocp_write(tp, 0xF8AC, 0x49AE); + mac_ocp_write(tp, 0xF8AE, 0xF1FE); + mac_ocp_write(tp, 0xF8B0, 0x0B00); + mac_ocp_write(tp, 0xF8B2, 0xF116); + mac_ocp_write(tp, 0xF8B4, 0xC71C); + mac_ocp_write(tp, 0xF8B6, 0xC419); + mac_ocp_write(tp, 0xF8B8, 0x9CE0); + mac_ocp_write(tp, 0xF8BA, 0x1C13); + mac_ocp_write(tp, 0xF8BC, 0x484F); + mac_ocp_write(tp, 0xF8BE, 0x9CE2); + mac_ocp_write(tp, 0xF8C0, 0x74E2); + mac_ocp_write(tp, 0xF8C2, 0x49CE); + mac_ocp_write(tp, 0xF8C4, 0xF1FE); + mac_ocp_write(tp, 0xF8C6, 0xC412); + mac_ocp_write(tp, 0xF8C8, 0x9CE0); + mac_ocp_write(tp, 0xF8CA, 0x1C13); + mac_ocp_write(tp, 0xF8CC, 0x484F); + mac_ocp_write(tp, 0xF8CE, 0x9CE2); + mac_ocp_write(tp, 0xF8D0, 0x74E2); + mac_ocp_write(tp, 0xF8D2, 0x49CE); + mac_ocp_write(tp, 0xF8D4, 0xF1FE); + mac_ocp_write(tp, 0xF8D6, 0xC70C); + mac_ocp_write(tp, 0xF8D8, 0x74F8); + mac_ocp_write(tp, 0xF8DA, 0x48C3); + mac_ocp_write(tp, 0xF8DC, 0x8CF8); + mac_ocp_write(tp, 0xF8DE, 0xB004); + mac_ocp_write(tp, 0xF8E0, 0xB007); + mac_ocp_write(tp, 0xF8E2, 0xC502); + mac_ocp_write(tp, 0xF8E4, 0xBD00); + mac_ocp_write(tp, 0xF8E6, 0x0F24); + mac_ocp_write(tp, 0xF8E8, 0x0481); + mac_ocp_write(tp, 0xF8EA, 0x0C81); + mac_ocp_write(tp, 0xF8EC, 0xDE24); + mac_ocp_write(tp, 0xF8EE, 0xE000); + mac_ocp_write(tp, 0xF8F0, 0xC602); + mac_ocp_write(tp, 0xF8F2, 0xBE00); + mac_ocp_write(tp, 0xF8F4, 0x0CA4); + mac_ocp_write(tp, 0xF8F6, 0xC502); + mac_ocp_write(tp, 0xF8F8, 0xBD00); + mac_ocp_write(tp, 0xF8FA, 0x0000); + mac_ocp_write(tp, 0xF8FC, 0xC602); + mac_ocp_write(tp, 0xF8FE, 0xBE00); + mac_ocp_write(tp, 0xF900, 0x0000); + + mac_ocp_write(tp, 0xFC26, 0x8000); + + mac_ocp_write(tp, 0xFC28, 0x00E2); + mac_ocp_write(tp, 0xFC2A, 0x0210); + mac_ocp_write(tp, 0xFC2C, 0x1A04); + mac_ocp_write(tp, 0xFC2E, 0x0B26); + mac_ocp_write(tp, 0xFC30, 0x0F02); + mac_ocp_write(tp, 0xFC32, 0x0CA0); + + mac_ocp_write(tp, 0xFC38, 0x003F); +} + +static void +rtl8168_set_mac_mcu_8168fp_1(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write(tp, 0xF800, 0xE00A); + mac_ocp_write(tp, 0xF802, 0xE0C1); + mac_ocp_write(tp, 0xF804, 0xE104); + mac_ocp_write(tp, 0xF806, 0xE108); + mac_ocp_write(tp, 0xF808, 0xE10D); + mac_ocp_write(tp, 0xF80A, 0xE112); + mac_ocp_write(tp, 0xF80C, 0xE11C); + mac_ocp_write(tp, 0xF80E, 0xE121); + mac_ocp_write(tp, 0xF810, 0xE000); + mac_ocp_write(tp, 0xF812, 0xE0C8); + mac_ocp_write(tp, 0xF814, 0xB400); + mac_ocp_write(tp, 0xF816, 0xC1FE); + mac_ocp_write(tp, 0xF818, 0x49E2); + mac_ocp_write(tp, 0xF81A, 0xF04C); + mac_ocp_write(tp, 0xF81C, 0x49EA); + mac_ocp_write(tp, 0xF81E, 0xF04A); + mac_ocp_write(tp, 0xF820, 0x74E6); + mac_ocp_write(tp, 0xF822, 0xC246); + mac_ocp_write(tp, 0xF824, 0x7542); + mac_ocp_write(tp, 0xF826, 0x73EC); + mac_ocp_write(tp, 0xF828, 0x1800); + mac_ocp_write(tp, 0xF82A, 0x49C0); + mac_ocp_write(tp, 0xF82C, 0xF10D); + mac_ocp_write(tp, 0xF82E, 0x49C1); + mac_ocp_write(tp, 0xF830, 0xF10B); + mac_ocp_write(tp, 0xF832, 0x49C2); + mac_ocp_write(tp, 0xF834, 0xF109); + mac_ocp_write(tp, 0xF836, 0x49B0); + mac_ocp_write(tp, 0xF838, 0xF107); + mac_ocp_write(tp, 0xF83A, 0x49B1); + mac_ocp_write(tp, 0xF83C, 0xF105); + mac_ocp_write(tp, 0xF83E, 0x7220); + mac_ocp_write(tp, 0xF840, 0x49A2); + mac_ocp_write(tp, 0xF842, 0xF102); + mac_ocp_write(tp, 0xF844, 0xE002); + mac_ocp_write(tp, 0xF846, 0x4800); + mac_ocp_write(tp, 0xF848, 0x49D0); + mac_ocp_write(tp, 0xF84A, 0xF10A); + mac_ocp_write(tp, 0xF84C, 0x49D1); + mac_ocp_write(tp, 0xF84E, 0xF108); + mac_ocp_write(tp, 0xF850, 0x49D2); + mac_ocp_write(tp, 0xF852, 0xF106); + mac_ocp_write(tp, 0xF854, 0x49D3); + mac_ocp_write(tp, 0xF856, 0xF104); + mac_ocp_write(tp, 0xF858, 0x49DF); + mac_ocp_write(tp, 0xF85A, 0xF102); + mac_ocp_write(tp, 0xF85C, 0xE00C); + mac_ocp_write(tp, 0xF85E, 0x4801); + mac_ocp_write(tp, 0xF860, 0x72E4); + mac_ocp_write(tp, 0xF862, 0x49AD); + mac_ocp_write(tp, 0xF864, 0xF108); + mac_ocp_write(tp, 0xF866, 0xC225); + mac_ocp_write(tp, 0xF868, 0x6741); + mac_ocp_write(tp, 0xF86A, 0x48F0); + mac_ocp_write(tp, 0xF86C, 0x8F41); + mac_ocp_write(tp, 0xF86E, 0x4870); + mac_ocp_write(tp, 0xF870, 0x8F41); + mac_ocp_write(tp, 0xF872, 0xC7CF); + mac_ocp_write(tp, 0xF874, 0x49B5); + mac_ocp_write(tp, 0xF876, 0xF01F); + mac_ocp_write(tp, 0xF878, 0x49B2); + mac_ocp_write(tp, 0xF87A, 0xF00B); + mac_ocp_write(tp, 0xF87C, 0x4980); + mac_ocp_write(tp, 0xF87E, 0xF003); + mac_ocp_write(tp, 0xF880, 0x484E); + mac_ocp_write(tp, 0xF882, 0x94E7); + mac_ocp_write(tp, 0xF884, 0x4981); + mac_ocp_write(tp, 0xF886, 0xF004); + mac_ocp_write(tp, 0xF888, 0x485E); + mac_ocp_write(tp, 0xF88A, 0xC212); + mac_ocp_write(tp, 0xF88C, 0x9543); + mac_ocp_write(tp, 0xF88E, 0xE071); + mac_ocp_write(tp, 0xF890, 0x49B6); + mac_ocp_write(tp, 0xF892, 0xF003); + mac_ocp_write(tp, 0xF894, 0x49B3); + mac_ocp_write(tp, 0xF896, 0xF10F); + mac_ocp_write(tp, 0xF898, 0x4980); + mac_ocp_write(tp, 0xF89A, 0xF003); + mac_ocp_write(tp, 0xF89C, 0x484E); + mac_ocp_write(tp, 0xF89E, 0x94E7); + mac_ocp_write(tp, 0xF8A0, 0x4981); + mac_ocp_write(tp, 0xF8A2, 0xF004); + mac_ocp_write(tp, 0xF8A4, 0x485E); + mac_ocp_write(tp, 0xF8A6, 0xC204); + mac_ocp_write(tp, 0xF8A8, 0x9543); + mac_ocp_write(tp, 0xF8AA, 0xE005); + mac_ocp_write(tp, 0xF8AC, 0xE000); + mac_ocp_write(tp, 0xF8AE, 0xE0FC); + mac_ocp_write(tp, 0xF8B0, 0xE0FA); + mac_ocp_write(tp, 0xF8B2, 0xE065); + mac_ocp_write(tp, 0xF8B4, 0x49B7); + mac_ocp_write(tp, 0xF8B6, 0xF007); + mac_ocp_write(tp, 0xF8B8, 0x4980); + mac_ocp_write(tp, 0xF8BA, 0xF005); + mac_ocp_write(tp, 0xF8BC, 0x1A38); + mac_ocp_write(tp, 0xF8BE, 0x46D4); + mac_ocp_write(tp, 0xF8C0, 0x1200); + mac_ocp_write(tp, 0xF8C2, 0xF109); + mac_ocp_write(tp, 0xF8C4, 0x4981); + mac_ocp_write(tp, 0xF8C6, 0xF055); + mac_ocp_write(tp, 0xF8C8, 0x49C3); + mac_ocp_write(tp, 0xF8CA, 0xF105); + mac_ocp_write(tp, 0xF8CC, 0x1A30); + mac_ocp_write(tp, 0xF8CE, 0x46D5); + mac_ocp_write(tp, 0xF8D0, 0x1200); + mac_ocp_write(tp, 0xF8D2, 0xF04F); + mac_ocp_write(tp, 0xF8D4, 0x7220); + mac_ocp_write(tp, 0xF8D6, 0x49A2); + mac_ocp_write(tp, 0xF8D8, 0xF130); + mac_ocp_write(tp, 0xF8DA, 0x49C1); + mac_ocp_write(tp, 0xF8DC, 0xF12E); + mac_ocp_write(tp, 0xF8DE, 0x49B0); + mac_ocp_write(tp, 0xF8E0, 0xF12C); + mac_ocp_write(tp, 0xF8E2, 0xC2E6); + mac_ocp_write(tp, 0xF8E4, 0x7240); + mac_ocp_write(tp, 0xF8E6, 0x49A8); + mac_ocp_write(tp, 0xF8E8, 0xF003); + mac_ocp_write(tp, 0xF8EA, 0x49D0); + mac_ocp_write(tp, 0xF8EC, 0xF126); + mac_ocp_write(tp, 0xF8EE, 0x49A9); + mac_ocp_write(tp, 0xF8F0, 0xF003); + mac_ocp_write(tp, 0xF8F2, 0x49D1); + mac_ocp_write(tp, 0xF8F4, 0xF122); + mac_ocp_write(tp, 0xF8F6, 0x49AA); + mac_ocp_write(tp, 0xF8F8, 0xF003); + mac_ocp_write(tp, 0xF8FA, 0x49D2); + mac_ocp_write(tp, 0xF8FC, 0xF11E); + mac_ocp_write(tp, 0xF8FE, 0x49AB); + mac_ocp_write(tp, 0xF900, 0xF003); + mac_ocp_write(tp, 0xF902, 0x49DF); + mac_ocp_write(tp, 0xF904, 0xF11A); + mac_ocp_write(tp, 0xF906, 0x49AC); + mac_ocp_write(tp, 0xF908, 0xF003); + mac_ocp_write(tp, 0xF90A, 0x49D3); + mac_ocp_write(tp, 0xF90C, 0xF116); + mac_ocp_write(tp, 0xF90E, 0x4980); + mac_ocp_write(tp, 0xF910, 0xF003); + mac_ocp_write(tp, 0xF912, 0x49C7); + mac_ocp_write(tp, 0xF914, 0xF105); + mac_ocp_write(tp, 0xF916, 0x4981); + mac_ocp_write(tp, 0xF918, 0xF02C); + mac_ocp_write(tp, 0xF91A, 0x49D7); + mac_ocp_write(tp, 0xF91C, 0xF02A); + mac_ocp_write(tp, 0xF91E, 0x49C0); + mac_ocp_write(tp, 0xF920, 0xF00C); + mac_ocp_write(tp, 0xF922, 0xC721); + mac_ocp_write(tp, 0xF924, 0x62F4); + mac_ocp_write(tp, 0xF926, 0x49A0); + mac_ocp_write(tp, 0xF928, 0xF008); + mac_ocp_write(tp, 0xF92A, 0x49A4); + mac_ocp_write(tp, 0xF92C, 0xF106); + mac_ocp_write(tp, 0xF92E, 0x4824); + mac_ocp_write(tp, 0xF930, 0x8AF4); + mac_ocp_write(tp, 0xF932, 0xC71A); + mac_ocp_write(tp, 0xF934, 0x1A40); + mac_ocp_write(tp, 0xF936, 0x9AE0); + mac_ocp_write(tp, 0xF938, 0x49B6); + mac_ocp_write(tp, 0xF93A, 0xF017); + mac_ocp_write(tp, 0xF93C, 0x200E); + mac_ocp_write(tp, 0xF93E, 0xC7B8); + mac_ocp_write(tp, 0xF940, 0x72E0); + mac_ocp_write(tp, 0xF942, 0x4710); + mac_ocp_write(tp, 0xF944, 0x92E1); + mac_ocp_write(tp, 0xF946, 0xC70E); + mac_ocp_write(tp, 0xF948, 0x77E0); + mac_ocp_write(tp, 0xF94A, 0x49F0); + mac_ocp_write(tp, 0xF94C, 0xF112); + mac_ocp_write(tp, 0xF94E, 0xC70B); + mac_ocp_write(tp, 0xF950, 0x77E0); + mac_ocp_write(tp, 0xF952, 0x27FE); + mac_ocp_write(tp, 0xF954, 0x1AFA); + mac_ocp_write(tp, 0xF956, 0x4317); + mac_ocp_write(tp, 0xF958, 0xC705); + mac_ocp_write(tp, 0xF95A, 0x9AE2); + mac_ocp_write(tp, 0xF95C, 0x1A11); + mac_ocp_write(tp, 0xF95E, 0x8AE0); + mac_ocp_write(tp, 0xF960, 0xE008); + mac_ocp_write(tp, 0xF962, 0xE41C); + mac_ocp_write(tp, 0xF964, 0xC0AE); + mac_ocp_write(tp, 0xF966, 0xD23A); + mac_ocp_write(tp, 0xF968, 0xC7A2); + mac_ocp_write(tp, 0xF96A, 0x74E6); + mac_ocp_write(tp, 0xF96C, 0x484F); + mac_ocp_write(tp, 0xF96E, 0x94E7); + mac_ocp_write(tp, 0xF970, 0xC79E); + mac_ocp_write(tp, 0xF972, 0x8CE6); + mac_ocp_write(tp, 0xF974, 0x8BEC); + mac_ocp_write(tp, 0xF976, 0xC29C); + mac_ocp_write(tp, 0xF978, 0x8D42); + mac_ocp_write(tp, 0xF97A, 0x7220); + mac_ocp_write(tp, 0xF97C, 0xB000); + mac_ocp_write(tp, 0xF97E, 0xC502); + mac_ocp_write(tp, 0xF980, 0xBD00); + mac_ocp_write(tp, 0xF982, 0x0932); + mac_ocp_write(tp, 0xF984, 0xB400); + mac_ocp_write(tp, 0xF986, 0xC240); + mac_ocp_write(tp, 0xF988, 0xC340); + mac_ocp_write(tp, 0xF98A, 0x7060); + mac_ocp_write(tp, 0xF98C, 0x498F); + mac_ocp_write(tp, 0xF98E, 0xF014); + mac_ocp_write(tp, 0xF990, 0x488F); + mac_ocp_write(tp, 0xF992, 0x9061); + mac_ocp_write(tp, 0xF994, 0x744C); + mac_ocp_write(tp, 0xF996, 0x49C3); + mac_ocp_write(tp, 0xF998, 0xF004); + mac_ocp_write(tp, 0xF99A, 0x7562); + mac_ocp_write(tp, 0xF99C, 0x485E); + mac_ocp_write(tp, 0xF99E, 0x9563); + mac_ocp_write(tp, 0xF9A0, 0x7446); + mac_ocp_write(tp, 0xF9A2, 0x49C3); + mac_ocp_write(tp, 0xF9A4, 0xF106); + mac_ocp_write(tp, 0xF9A6, 0x7562); + mac_ocp_write(tp, 0xF9A8, 0x1C30); + mac_ocp_write(tp, 0xF9AA, 0x46E5); + mac_ocp_write(tp, 0xF9AC, 0x1200); + mac_ocp_write(tp, 0xF9AE, 0xF004); + mac_ocp_write(tp, 0xF9B0, 0x7446); + mac_ocp_write(tp, 0xF9B2, 0x484F); + mac_ocp_write(tp, 0xF9B4, 0x9447); + mac_ocp_write(tp, 0xF9B6, 0xC32A); + mac_ocp_write(tp, 0xF9B8, 0x7466); + mac_ocp_write(tp, 0xF9BA, 0x49C0); + mac_ocp_write(tp, 0xF9BC, 0xF00F); + mac_ocp_write(tp, 0xF9BE, 0x48C0); + mac_ocp_write(tp, 0xF9C0, 0x9C66); + mac_ocp_write(tp, 0xF9C2, 0x7446); + mac_ocp_write(tp, 0xF9C4, 0x4840); + mac_ocp_write(tp, 0xF9C6, 0x4841); + mac_ocp_write(tp, 0xF9C8, 0x4842); + mac_ocp_write(tp, 0xF9CA, 0x9C46); + mac_ocp_write(tp, 0xF9CC, 0x744C); + mac_ocp_write(tp, 0xF9CE, 0x4840); + mac_ocp_write(tp, 0xF9D0, 0x9C4C); + mac_ocp_write(tp, 0xF9D2, 0x744A); + mac_ocp_write(tp, 0xF9D4, 0x484A); + mac_ocp_write(tp, 0xF9D6, 0x9C4A); + mac_ocp_write(tp, 0xF9D8, 0xE013); + mac_ocp_write(tp, 0xF9DA, 0x498E); + mac_ocp_write(tp, 0xF9DC, 0xF011); + mac_ocp_write(tp, 0xF9DE, 0x488E); + mac_ocp_write(tp, 0xF9E0, 0x9061); + mac_ocp_write(tp, 0xF9E2, 0x744C); + mac_ocp_write(tp, 0xF9E4, 0x49C3); + mac_ocp_write(tp, 0xF9E6, 0xF004); + mac_ocp_write(tp, 0xF9E8, 0x7446); + mac_ocp_write(tp, 0xF9EA, 0x484E); + mac_ocp_write(tp, 0xF9EC, 0x9447); + mac_ocp_write(tp, 0xF9EE, 0x7446); + mac_ocp_write(tp, 0xF9F0, 0x1D38); + mac_ocp_write(tp, 0xF9F2, 0x46EC); + mac_ocp_write(tp, 0xF9F4, 0x1500); + mac_ocp_write(tp, 0xF9F6, 0xF004); + mac_ocp_write(tp, 0xF9F8, 0x7446); + mac_ocp_write(tp, 0xF9FA, 0x484F); + mac_ocp_write(tp, 0xF9FC, 0x9447); + mac_ocp_write(tp, 0xF9FE, 0xB000); + mac_ocp_write(tp, 0xFA00, 0xC502); + mac_ocp_write(tp, 0xFA02, 0xBD00); + mac_ocp_write(tp, 0xFA04, 0x074C); + mac_ocp_write(tp, 0xFA06, 0xE000); + mac_ocp_write(tp, 0xFA08, 0xE0FC); + mac_ocp_write(tp, 0xFA0A, 0xE0C0); + mac_ocp_write(tp, 0xFA0C, 0x4830); + mac_ocp_write(tp, 0xFA0E, 0x4837); + mac_ocp_write(tp, 0xFA10, 0xC502); + mac_ocp_write(tp, 0xFA12, 0xBD00); + mac_ocp_write(tp, 0xFA14, 0x0978); + mac_ocp_write(tp, 0xFA16, 0x63E2); + mac_ocp_write(tp, 0xFA18, 0x4830); + mac_ocp_write(tp, 0xFA1A, 0x4837); + mac_ocp_write(tp, 0xFA1C, 0xC502); + mac_ocp_write(tp, 0xFA1E, 0xBD00); + mac_ocp_write(tp, 0xFA20, 0x09FE); + mac_ocp_write(tp, 0xFA22, 0x73E2); + mac_ocp_write(tp, 0xFA24, 0x4830); + mac_ocp_write(tp, 0xFA26, 0x8BE2); + mac_ocp_write(tp, 0xFA28, 0xC302); + mac_ocp_write(tp, 0xFA2A, 0xBB00); + mac_ocp_write(tp, 0xFA2C, 0x0A12); + mac_ocp_write(tp, 0xFA2E, 0x73E2); + mac_ocp_write(tp, 0xFA30, 0x48B0); + mac_ocp_write(tp, 0xFA32, 0x48B3); + mac_ocp_write(tp, 0xFA34, 0x48B4); + mac_ocp_write(tp, 0xFA36, 0x48B5); + mac_ocp_write(tp, 0xFA38, 0x48B6); + mac_ocp_write(tp, 0xFA3A, 0x48B7); + mac_ocp_write(tp, 0xFA3C, 0x8BE2); + mac_ocp_write(tp, 0xFA3E, 0xC302); + mac_ocp_write(tp, 0xFA40, 0xBB00); + mac_ocp_write(tp, 0xFA42, 0x0A5A); + mac_ocp_write(tp, 0xFA44, 0x73E2); + mac_ocp_write(tp, 0xFA46, 0x4830); + mac_ocp_write(tp, 0xFA48, 0x8BE2); + mac_ocp_write(tp, 0xFA4A, 0xC302); + mac_ocp_write(tp, 0xFA4C, 0xBB00); + mac_ocp_write(tp, 0xFA4E, 0x0A6C); + mac_ocp_write(tp, 0xFA50, 0x73E2); + mac_ocp_write(tp, 0xFA52, 0x4830); + mac_ocp_write(tp, 0xFA54, 0x4837); + mac_ocp_write(tp, 0xFA56, 0xC502); + mac_ocp_write(tp, 0xFA58, 0xBD00); + mac_ocp_write(tp, 0xFA5A, 0x0A86); + + mac_ocp_write(tp, 0xFC26, 0x8000); + + mac_ocp_write(tp, 0xFC28, 0x0890); + mac_ocp_write(tp, 0xFC2A, 0x0712); + mac_ocp_write(tp, 0xFC2C, 0x0974); + mac_ocp_write(tp, 0xFC2E, 0x09FC); + mac_ocp_write(tp, 0xFC30, 0x0A0E); + mac_ocp_write(tp, 0xFC32, 0x0A56); + mac_ocp_write(tp, 0xFC34, 0x0A68); + mac_ocp_write(tp, 0xFC36, 0x0A84); + + if (tp->HwPkgDet == 0x0) + mac_ocp_write(tp, 0xFC38, 0x00FC); + else if(tp->HwPkgDet == 0xF) + mac_ocp_write(tp, 0xFC38, 0x00FF); +} + +static void +rtl8168_set_mac_mcu_8168fp_2(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); + + rtl8168_hw_disable_mac_mcu_bps(dev); + + mac_ocp_write(tp, 0xF800, 0xE008); + mac_ocp_write(tp, 0xF802, 0xE00A); + mac_ocp_write(tp, 0xF804, 0xE031); + mac_ocp_write(tp, 0xF806, 0xE033); + mac_ocp_write(tp, 0xF808, 0xE035); + mac_ocp_write(tp, 0xF80A, 0xE144); + mac_ocp_write(tp, 0xF80C, 0xE166); + mac_ocp_write(tp, 0xF80E, 0xE168); + mac_ocp_write(tp, 0xF810, 0xC502); + mac_ocp_write(tp, 0xF812, 0xBD00); + mac_ocp_write(tp, 0xF814, 0x0000); + mac_ocp_write(tp, 0xF816, 0xC725); + mac_ocp_write(tp, 0xF818, 0x75E0); + mac_ocp_write(tp, 0xF81A, 0x48D0); + mac_ocp_write(tp, 0xF81C, 0x9DE0); + mac_ocp_write(tp, 0xF81E, 0xC722); + mac_ocp_write(tp, 0xF820, 0x75E0); + mac_ocp_write(tp, 0xF822, 0x1C78); + mac_ocp_write(tp, 0xF824, 0x416C); + mac_ocp_write(tp, 0xF826, 0x1530); + mac_ocp_write(tp, 0xF828, 0xF111); + mac_ocp_write(tp, 0xF82A, 0xC71D); + mac_ocp_write(tp, 0xF82C, 0x75F6); + mac_ocp_write(tp, 0xF82E, 0x49D1); + mac_ocp_write(tp, 0xF830, 0xF00D); + mac_ocp_write(tp, 0xF832, 0x75E0); + mac_ocp_write(tp, 0xF834, 0x1C1F); + mac_ocp_write(tp, 0xF836, 0x416C); + mac_ocp_write(tp, 0xF838, 0x1502); + mac_ocp_write(tp, 0xF83A, 0xF108); + mac_ocp_write(tp, 0xF83C, 0x75FA); + mac_ocp_write(tp, 0xF83E, 0x49D3); + mac_ocp_write(tp, 0xF840, 0xF005); + mac_ocp_write(tp, 0xF842, 0x75EC); + mac_ocp_write(tp, 0xF844, 0x9DE4); + mac_ocp_write(tp, 0xF846, 0x4853); + mac_ocp_write(tp, 0xF848, 0x9DFA); + mac_ocp_write(tp, 0xF84A, 0xC70B); + mac_ocp_write(tp, 0xF84C, 0x75E0); + mac_ocp_write(tp, 0xF84E, 0x4852); + mac_ocp_write(tp, 0xF850, 0x4850); + mac_ocp_write(tp, 0xF852, 0x9DE0); + mac_ocp_write(tp, 0xF854, 0xC602); + mac_ocp_write(tp, 0xF856, 0xBE00); + mac_ocp_write(tp, 0xF858, 0x04B8); + mac_ocp_write(tp, 0xF85A, 0xE420); + mac_ocp_write(tp, 0xF85C, 0xE000); + mac_ocp_write(tp, 0xF85E, 0xE0FC); + mac_ocp_write(tp, 0xF860, 0xE43C); + mac_ocp_write(tp, 0xF862, 0xDC00); + mac_ocp_write(tp, 0xF864, 0xEB00); + mac_ocp_write(tp, 0xF866, 0xC202); + mac_ocp_write(tp, 0xF868, 0xBA00); + mac_ocp_write(tp, 0xF86A, 0x0000); + mac_ocp_write(tp, 0xF86C, 0xC002); + mac_ocp_write(tp, 0xF86E, 0xB800); + mac_ocp_write(tp, 0xF870, 0x0000); + mac_ocp_write(tp, 0xF872, 0xB401); + mac_ocp_write(tp, 0xF874, 0xB402); + mac_ocp_write(tp, 0xF876, 0xB403); + mac_ocp_write(tp, 0xF878, 0xB404); + mac_ocp_write(tp, 0xF87A, 0xB405); + mac_ocp_write(tp, 0xF87C, 0xB406); + mac_ocp_write(tp, 0xF87E, 0xC44D); + mac_ocp_write(tp, 0xF880, 0xC54D); + mac_ocp_write(tp, 0xF882, 0x1867); + mac_ocp_write(tp, 0xF884, 0xE8A2); + mac_ocp_write(tp, 0xF886, 0x2318); + mac_ocp_write(tp, 0xF888, 0x276E); + mac_ocp_write(tp, 0xF88A, 0x1601); + mac_ocp_write(tp, 0xF88C, 0xF106); + mac_ocp_write(tp, 0xF88E, 0x1A07); + mac_ocp_write(tp, 0xF890, 0xE861); + mac_ocp_write(tp, 0xF892, 0xE86B); + mac_ocp_write(tp, 0xF894, 0xE873); + mac_ocp_write(tp, 0xF896, 0xE037); + mac_ocp_write(tp, 0xF898, 0x231E); + mac_ocp_write(tp, 0xF89A, 0x276E); + mac_ocp_write(tp, 0xF89C, 0x1602); + mac_ocp_write(tp, 0xF89E, 0xF10B); + mac_ocp_write(tp, 0xF8A0, 0x1A07); + mac_ocp_write(tp, 0xF8A2, 0xE858); + mac_ocp_write(tp, 0xF8A4, 0xE862); + mac_ocp_write(tp, 0xF8A6, 0xC247); + mac_ocp_write(tp, 0xF8A8, 0xC344); + mac_ocp_write(tp, 0xF8AA, 0xE8E3); + mac_ocp_write(tp, 0xF8AC, 0xC73B); + mac_ocp_write(tp, 0xF8AE, 0x66E0); + mac_ocp_write(tp, 0xF8B0, 0xE8B5); + mac_ocp_write(tp, 0xF8B2, 0xE029); + mac_ocp_write(tp, 0xF8B4, 0x231A); + mac_ocp_write(tp, 0xF8B6, 0x276C); + mac_ocp_write(tp, 0xF8B8, 0xC733); + mac_ocp_write(tp, 0xF8BA, 0x9EE0); + mac_ocp_write(tp, 0xF8BC, 0x1866); + mac_ocp_write(tp, 0xF8BE, 0xE885); + mac_ocp_write(tp, 0xF8C0, 0x251C); + mac_ocp_write(tp, 0xF8C2, 0x120F); + mac_ocp_write(tp, 0xF8C4, 0xF011); + mac_ocp_write(tp, 0xF8C6, 0x1209); + mac_ocp_write(tp, 0xF8C8, 0xF011); + mac_ocp_write(tp, 0xF8CA, 0x2014); + mac_ocp_write(tp, 0xF8CC, 0x240E); + mac_ocp_write(tp, 0xF8CE, 0x1000); + mac_ocp_write(tp, 0xF8D0, 0xF007); + mac_ocp_write(tp, 0xF8D2, 0x120C); + mac_ocp_write(tp, 0xF8D4, 0xF00D); + mac_ocp_write(tp, 0xF8D6, 0x1203); + mac_ocp_write(tp, 0xF8D8, 0xF00D); + mac_ocp_write(tp, 0xF8DA, 0x1200); + mac_ocp_write(tp, 0xF8DC, 0xF00D); + mac_ocp_write(tp, 0xF8DE, 0x120C); + mac_ocp_write(tp, 0xF8E0, 0xF00D); + mac_ocp_write(tp, 0xF8E2, 0x1203); + mac_ocp_write(tp, 0xF8E4, 0xF00D); + mac_ocp_write(tp, 0xF8E6, 0x1A03); + mac_ocp_write(tp, 0xF8E8, 0xE00C); + mac_ocp_write(tp, 0xF8EA, 0x1A07); + mac_ocp_write(tp, 0xF8EC, 0xE00A); + mac_ocp_write(tp, 0xF8EE, 0x1A00); + mac_ocp_write(tp, 0xF8F0, 0xE008); + mac_ocp_write(tp, 0xF8F2, 0x1A01); + mac_ocp_write(tp, 0xF8F4, 0xE006); + mac_ocp_write(tp, 0xF8F6, 0x1A02); + mac_ocp_write(tp, 0xF8F8, 0xE004); + mac_ocp_write(tp, 0xF8FA, 0x1A04); + mac_ocp_write(tp, 0xF8FC, 0xE002); + mac_ocp_write(tp, 0xF8FE, 0x1A05); + mac_ocp_write(tp, 0xF900, 0xE829); + mac_ocp_write(tp, 0xF902, 0xE833); + mac_ocp_write(tp, 0xF904, 0xB006); + mac_ocp_write(tp, 0xF906, 0xB005); + mac_ocp_write(tp, 0xF908, 0xB004); + mac_ocp_write(tp, 0xF90A, 0xB003); + mac_ocp_write(tp, 0xF90C, 0xB002); + mac_ocp_write(tp, 0xF90E, 0xB001); + mac_ocp_write(tp, 0xF910, 0x60C4); + mac_ocp_write(tp, 0xF912, 0xC702); + mac_ocp_write(tp, 0xF914, 0xBF00); + mac_ocp_write(tp, 0xF916, 0x2786); + mac_ocp_write(tp, 0xF918, 0xDD00); + mac_ocp_write(tp, 0xF91A, 0xD030); + mac_ocp_write(tp, 0xF91C, 0xE0C4); + mac_ocp_write(tp, 0xF91E, 0xE0F8); + mac_ocp_write(tp, 0xF920, 0xDC42); + mac_ocp_write(tp, 0xF922, 0xD3F0); + mac_ocp_write(tp, 0xF924, 0x0000); + mac_ocp_write(tp, 0xF926, 0x0004); + mac_ocp_write(tp, 0xF928, 0x0007); + mac_ocp_write(tp, 0xF92A, 0x0014); + mac_ocp_write(tp, 0xF92C, 0x0090); + mac_ocp_write(tp, 0xF92E, 0x1000); + mac_ocp_write(tp, 0xF930, 0x0F00); + mac_ocp_write(tp, 0xF932, 0x1004); + mac_ocp_write(tp, 0xF934, 0x1008); + mac_ocp_write(tp, 0xF936, 0x3000); + mac_ocp_write(tp, 0xF938, 0x3004); + mac_ocp_write(tp, 0xF93A, 0x3008); + mac_ocp_write(tp, 0xF93C, 0x4000); + mac_ocp_write(tp, 0xF93E, 0x7777); + mac_ocp_write(tp, 0xF940, 0x8000); + mac_ocp_write(tp, 0xF942, 0x8001); + mac_ocp_write(tp, 0xF944, 0x8008); + mac_ocp_write(tp, 0xF946, 0x8003); + mac_ocp_write(tp, 0xF948, 0x8004); + mac_ocp_write(tp, 0xF94A, 0xC000); + mac_ocp_write(tp, 0xF94C, 0xC004); + mac_ocp_write(tp, 0xF94E, 0xF004); + mac_ocp_write(tp, 0xF950, 0xFFFF); + mac_ocp_write(tp, 0xF952, 0xB406); + mac_ocp_write(tp, 0xF954, 0xB407); + mac_ocp_write(tp, 0xF956, 0xC6E5); + mac_ocp_write(tp, 0xF958, 0x77C0); + mac_ocp_write(tp, 0xF95A, 0x27F3); + mac_ocp_write(tp, 0xF95C, 0x23F3); + mac_ocp_write(tp, 0xF95E, 0x47FA); + mac_ocp_write(tp, 0xF960, 0x9FC0); + mac_ocp_write(tp, 0xF962, 0xB007); + mac_ocp_write(tp, 0xF964, 0xB006); + mac_ocp_write(tp, 0xF966, 0xFF80); + mac_ocp_write(tp, 0xF968, 0xB405); + mac_ocp_write(tp, 0xF96A, 0xB407); + mac_ocp_write(tp, 0xF96C, 0xC7D8); + mac_ocp_write(tp, 0xF96E, 0x75E0); + mac_ocp_write(tp, 0xF970, 0x48D0); + mac_ocp_write(tp, 0xF972, 0x9DE0); + mac_ocp_write(tp, 0xF974, 0xB007); + mac_ocp_write(tp, 0xF976, 0xB005); + mac_ocp_write(tp, 0xF978, 0xFF80); + mac_ocp_write(tp, 0xF97A, 0xB401); + mac_ocp_write(tp, 0xF97C, 0xC0EA); + mac_ocp_write(tp, 0xF97E, 0xC2DC); + mac_ocp_write(tp, 0xF980, 0xC3D8); + mac_ocp_write(tp, 0xF982, 0xE865); + mac_ocp_write(tp, 0xF984, 0xC0D3); + mac_ocp_write(tp, 0xF986, 0xC1E0); + mac_ocp_write(tp, 0xF988, 0xC2E3); + mac_ocp_write(tp, 0xF98A, 0xE861); + mac_ocp_write(tp, 0xF98C, 0xE817); + mac_ocp_write(tp, 0xF98E, 0xC0CD); + mac_ocp_write(tp, 0xF990, 0xC2CF); + mac_ocp_write(tp, 0xF992, 0xE85D); + mac_ocp_write(tp, 0xF994, 0xC0C9); + mac_ocp_write(tp, 0xF996, 0xC1D6); + mac_ocp_write(tp, 0xF998, 0xC2DB); + mac_ocp_write(tp, 0xF99A, 0xE859); + mac_ocp_write(tp, 0xF99C, 0xE80F); + mac_ocp_write(tp, 0xF99E, 0xC1C7); + mac_ocp_write(tp, 0xF9A0, 0xC2CE); + mac_ocp_write(tp, 0xF9A2, 0xE855); + mac_ocp_write(tp, 0xF9A4, 0xC0C0); + mac_ocp_write(tp, 0xF9A6, 0xC1D1); + mac_ocp_write(tp, 0xF9A8, 0xC2D3); + mac_ocp_write(tp, 0xF9AA, 0xE851); + mac_ocp_write(tp, 0xF9AC, 0xE807); + mac_ocp_write(tp, 0xF9AE, 0xC0BE); + mac_ocp_write(tp, 0xF9B0, 0xC2C2); + mac_ocp_write(tp, 0xF9B2, 0xE84D); + mac_ocp_write(tp, 0xF9B4, 0xE803); + mac_ocp_write(tp, 0xF9B6, 0xB001); + mac_ocp_write(tp, 0xF9B8, 0xFF80); + mac_ocp_write(tp, 0xF9BA, 0xB402); + mac_ocp_write(tp, 0xF9BC, 0xC2C6); + mac_ocp_write(tp, 0xF9BE, 0xE859); + mac_ocp_write(tp, 0xF9C0, 0x499F); + mac_ocp_write(tp, 0xF9C2, 0xF1FE); + mac_ocp_write(tp, 0xF9C4, 0xB002); + mac_ocp_write(tp, 0xF9C6, 0xFF80); + mac_ocp_write(tp, 0xF9C8, 0xB402); + mac_ocp_write(tp, 0xF9CA, 0xB403); + mac_ocp_write(tp, 0xF9CC, 0xB407); + mac_ocp_write(tp, 0xF9CE, 0xE821); + mac_ocp_write(tp, 0xF9D0, 0x8882); + mac_ocp_write(tp, 0xF9D2, 0x1980); + mac_ocp_write(tp, 0xF9D4, 0x8983); + mac_ocp_write(tp, 0xF9D6, 0xE81D); + mac_ocp_write(tp, 0xF9D8, 0x7180); + mac_ocp_write(tp, 0xF9DA, 0x218B); + mac_ocp_write(tp, 0xF9DC, 0x25BB); + mac_ocp_write(tp, 0xF9DE, 0x1310); + mac_ocp_write(tp, 0xF9E0, 0xF014); + mac_ocp_write(tp, 0xF9E2, 0x1310); + mac_ocp_write(tp, 0xF9E4, 0xFB03); + mac_ocp_write(tp, 0xF9E6, 0x1F20); + mac_ocp_write(tp, 0xF9E8, 0x38FB); + mac_ocp_write(tp, 0xF9EA, 0x3288); + mac_ocp_write(tp, 0xF9EC, 0x434B); + mac_ocp_write(tp, 0xF9EE, 0x2491); + mac_ocp_write(tp, 0xF9F0, 0x430B); + mac_ocp_write(tp, 0xF9F2, 0x1F0F); + mac_ocp_write(tp, 0xF9F4, 0x38FB); + mac_ocp_write(tp, 0xF9F6, 0x4313); + mac_ocp_write(tp, 0xF9F8, 0x2121); + mac_ocp_write(tp, 0xF9FA, 0x4353); + mac_ocp_write(tp, 0xF9FC, 0x2521); + mac_ocp_write(tp, 0xF9FE, 0x418A); + mac_ocp_write(tp, 0xFA00, 0x6282); + mac_ocp_write(tp, 0xFA02, 0x2527); + mac_ocp_write(tp, 0xFA04, 0x212F); + mac_ocp_write(tp, 0xFA06, 0x418A); + mac_ocp_write(tp, 0xFA08, 0xB007); + mac_ocp_write(tp, 0xFA0A, 0xB003); + mac_ocp_write(tp, 0xFA0C, 0xB002); + mac_ocp_write(tp, 0xFA0E, 0xFF80); + mac_ocp_write(tp, 0xFA10, 0x6183); + mac_ocp_write(tp, 0xFA12, 0x2496); + mac_ocp_write(tp, 0xFA14, 0x1100); + mac_ocp_write(tp, 0xFA16, 0xF1FD); + mac_ocp_write(tp, 0xFA18, 0xFF80); + mac_ocp_write(tp, 0xFA1A, 0x4800); + mac_ocp_write(tp, 0xFA1C, 0x4801); + mac_ocp_write(tp, 0xFA1E, 0xC213); + mac_ocp_write(tp, 0xFA20, 0xC313); + mac_ocp_write(tp, 0xFA22, 0xE815); + mac_ocp_write(tp, 0xFA24, 0x4860); + mac_ocp_write(tp, 0xFA26, 0x8EE0); + mac_ocp_write(tp, 0xFA28, 0xC210); + mac_ocp_write(tp, 0xFA2A, 0xC310); + mac_ocp_write(tp, 0xFA2C, 0xE822); + mac_ocp_write(tp, 0xFA2E, 0x481E); + mac_ocp_write(tp, 0xFA30, 0xC20C); + mac_ocp_write(tp, 0xFA32, 0xC30C); + mac_ocp_write(tp, 0xFA34, 0xE80C); + mac_ocp_write(tp, 0xFA36, 0xC206); + mac_ocp_write(tp, 0xFA38, 0x7358); + mac_ocp_write(tp, 0xFA3A, 0x483A); + mac_ocp_write(tp, 0xFA3C, 0x9B58); + mac_ocp_write(tp, 0xFA3E, 0xFF80); + mac_ocp_write(tp, 0xFA40, 0xE8E0); + mac_ocp_write(tp, 0xFA42, 0xE000); + mac_ocp_write(tp, 0xFA44, 0x1008); + mac_ocp_write(tp, 0xFA46, 0x0F00); + mac_ocp_write(tp, 0xFA48, 0x800C); + mac_ocp_write(tp, 0xFA4A, 0x0F00); + mac_ocp_write(tp, 0xFA4C, 0xB407); + mac_ocp_write(tp, 0xFA4E, 0xB406); + mac_ocp_write(tp, 0xFA50, 0xB403); + mac_ocp_write(tp, 0xFA52, 0xC7F7); + mac_ocp_write(tp, 0xFA54, 0x98E0); + mac_ocp_write(tp, 0xFA56, 0x99E2); + mac_ocp_write(tp, 0xFA58, 0x9AE4); + mac_ocp_write(tp, 0xFA5A, 0x21B2); + mac_ocp_write(tp, 0xFA5C, 0x4831); + mac_ocp_write(tp, 0xFA5E, 0x483F); + mac_ocp_write(tp, 0xFA60, 0x9BE6); + mac_ocp_write(tp, 0xFA62, 0x66E7); + mac_ocp_write(tp, 0xFA64, 0x49E6); + mac_ocp_write(tp, 0xFA66, 0xF1FE); + mac_ocp_write(tp, 0xFA68, 0xB003); + mac_ocp_write(tp, 0xFA6A, 0xB006); + mac_ocp_write(tp, 0xFA6C, 0xB007); + mac_ocp_write(tp, 0xFA6E, 0xFF80); + mac_ocp_write(tp, 0xFA70, 0xB407); + mac_ocp_write(tp, 0xFA72, 0xB406); + mac_ocp_write(tp, 0xFA74, 0xB403); + mac_ocp_write(tp, 0xFA76, 0xC7E5); + mac_ocp_write(tp, 0xFA78, 0x9AE4); + mac_ocp_write(tp, 0xFA7A, 0x21B2); + mac_ocp_write(tp, 0xFA7C, 0x4831); + mac_ocp_write(tp, 0xFA7E, 0x9BE6); + mac_ocp_write(tp, 0xFA80, 0x66E7); + mac_ocp_write(tp, 0xFA82, 0x49E6); + mac_ocp_write(tp, 0xFA84, 0xF1FE); + mac_ocp_write(tp, 0xFA86, 0x70E0); + mac_ocp_write(tp, 0xFA88, 0x71E2); + mac_ocp_write(tp, 0xFA8A, 0xB003); + mac_ocp_write(tp, 0xFA8C, 0xB006); + mac_ocp_write(tp, 0xFA8E, 0xB007); + mac_ocp_write(tp, 0xFA90, 0xFF80); + mac_ocp_write(tp, 0xFA92, 0x4882); + mac_ocp_write(tp, 0xFA94, 0xB406); + mac_ocp_write(tp, 0xFA96, 0xB405); + mac_ocp_write(tp, 0xFA98, 0xC71E); + mac_ocp_write(tp, 0xFA9A, 0x76E0); + mac_ocp_write(tp, 0xFA9C, 0x1D78); + mac_ocp_write(tp, 0xFA9E, 0x4175); + mac_ocp_write(tp, 0xFAA0, 0x1630); + mac_ocp_write(tp, 0xFAA2, 0xF10C); + mac_ocp_write(tp, 0xFAA4, 0xC715); + mac_ocp_write(tp, 0xFAA6, 0x76E0); + mac_ocp_write(tp, 0xFAA8, 0x4861); + mac_ocp_write(tp, 0xFAAA, 0x9EE0); + mac_ocp_write(tp, 0xFAAC, 0xC713); + mac_ocp_write(tp, 0xFAAE, 0x1EFF); + mac_ocp_write(tp, 0xFAB0, 0x9EE2); + mac_ocp_write(tp, 0xFAB2, 0x75E0); + mac_ocp_write(tp, 0xFAB4, 0x4850); + mac_ocp_write(tp, 0xFAB6, 0x9DE0); + mac_ocp_write(tp, 0xFAB8, 0xE005); + mac_ocp_write(tp, 0xFABA, 0xC70B); + mac_ocp_write(tp, 0xFABC, 0x76E0); + mac_ocp_write(tp, 0xFABE, 0x4865); + mac_ocp_write(tp, 0xFAC0, 0x9EE0); + mac_ocp_write(tp, 0xFAC2, 0xB005); + mac_ocp_write(tp, 0xFAC4, 0xB006); + mac_ocp_write(tp, 0xFAC6, 0xC708); + mac_ocp_write(tp, 0xFAC8, 0xC102); + mac_ocp_write(tp, 0xFACA, 0xB900); + mac_ocp_write(tp, 0xFACC, 0x279E); + mac_ocp_write(tp, 0xFACE, 0xEB16); + mac_ocp_write(tp, 0xFAD0, 0xEB00); + mac_ocp_write(tp, 0xFAD2, 0xE43C); + mac_ocp_write(tp, 0xFAD4, 0xDC00); + mac_ocp_write(tp, 0xFAD6, 0xD3EC); + mac_ocp_write(tp, 0xFAD8, 0xC602); + mac_ocp_write(tp, 0xFADA, 0xBE00); + mac_ocp_write(tp, 0xFADC, 0x0000); + mac_ocp_write(tp, 0xFADE, 0xC602); + mac_ocp_write(tp, 0xFAE0, 0xBE00); + mac_ocp_write(tp, 0xFAE2, 0x0000); + + mac_ocp_write(tp, 0xFC26, 0x8000); + + mac_ocp_write(tp, 0xFC28, 0x0000); + mac_ocp_write(tp, 0xFC2A, 0x04B4); + mac_ocp_write(tp, 0xFC2C, 0x0000); + mac_ocp_write(tp, 0xFC2E, 0x0000); + mac_ocp_write(tp, 0xFC30, 0x0000); + mac_ocp_write(tp, 0xFC32, 0x279C); + mac_ocp_write(tp, 0xFC34, 0x0000); + mac_ocp_write(tp, 0xFC36, 0x0000); - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE01B ); - mac_ocp_write( tp, 0xF804, 0xE022 ); - mac_ocp_write( tp, 0xF806, 0xE094 ); - mac_ocp_write( tp, 0xF808, 0xE097 ); - mac_ocp_write( tp, 0xF80A, 0xE09A ); - mac_ocp_write( tp, 0xF80C, 0xE0B3 ); - mac_ocp_write( tp, 0xF80E, 0xE0BA ); - mac_ocp_write( tp, 0xF810, 0x49D2 ); - mac_ocp_write( tp, 0xF812, 0xF10D ); - mac_ocp_write( tp, 0xF814, 0x766C ); - mac_ocp_write( tp, 0xF816, 0x49E2 ); - mac_ocp_write( tp, 0xF818, 0xF00A ); - mac_ocp_write( tp, 0xF81A, 0x1EC0 ); - mac_ocp_write( tp, 0xF81C, 0x8EE1 ); - mac_ocp_write( tp, 0xF81E, 0xC60A ); - mac_ocp_write( tp, 0xF820, 0x77C0 ); - mac_ocp_write( tp, 0xF822, 0x4870 ); - mac_ocp_write( tp, 0xF824, 0x9FC0 ); - mac_ocp_write( tp, 0xF826, 0x1EA0 ); - mac_ocp_write( tp, 0xF828, 0xC707 ); - mac_ocp_write( tp, 0xF82A, 0x8EE1 ); - mac_ocp_write( tp, 0xF82C, 0x9D6C ); - mac_ocp_write( tp, 0xF82E, 0xC603 ); - mac_ocp_write( tp, 0xF830, 0xBE00 ); - mac_ocp_write( tp, 0xF832, 0xB416 ); - mac_ocp_write( tp, 0xF834, 0x0076 ); - mac_ocp_write( tp, 0xF836, 0xE86C ); - mac_ocp_write( tp, 0xF838, 0xC406 ); - mac_ocp_write( tp, 0xF83A, 0x7580 ); - mac_ocp_write( tp, 0xF83C, 0x4852 ); - mac_ocp_write( tp, 0xF83E, 0x8D80 ); - mac_ocp_write( tp, 0xF840, 0xC403 ); - mac_ocp_write( tp, 0xF842, 0xBC00 ); - mac_ocp_write( tp, 0xF844, 0xD3E0 ); - mac_ocp_write( tp, 0xF846, 0x02C8 ); - mac_ocp_write( tp, 0xF848, 0x8918 ); - mac_ocp_write( tp, 0xF84A, 0xE815 ); - mac_ocp_write( tp, 0xF84C, 0x1100 ); - mac_ocp_write( tp, 0xF84E, 0xF011 ); - mac_ocp_write( tp, 0xF850, 0xE812 ); - mac_ocp_write( tp, 0xF852, 0x4990 ); - mac_ocp_write( tp, 0xF854, 0xF002 ); - mac_ocp_write( tp, 0xF856, 0xE817 ); - mac_ocp_write( tp, 0xF858, 0xE80E ); - mac_ocp_write( tp, 0xF85A, 0x4992 ); - mac_ocp_write( tp, 0xF85C, 0xF002 ); - mac_ocp_write( tp, 0xF85E, 0xE80E ); - mac_ocp_write( tp, 0xF860, 0xE80A ); - mac_ocp_write( tp, 0xF862, 0x4993 ); - mac_ocp_write( tp, 0xF864, 0xF002 ); - mac_ocp_write( tp, 0xF866, 0xE818 ); - mac_ocp_write( tp, 0xF868, 0xE806 ); - mac_ocp_write( tp, 0xF86A, 0x4991 ); - mac_ocp_write( tp, 0xF86C, 0xF002 ); - mac_ocp_write( tp, 0xF86E, 0xE838 ); - mac_ocp_write( tp, 0xF870, 0xC25E ); - mac_ocp_write( tp, 0xF872, 0xBA00 ); - mac_ocp_write( tp, 0xF874, 0xC056 ); - mac_ocp_write( tp, 0xF876, 0x7100 ); - mac_ocp_write( tp, 0xF878, 0xFF80 ); - mac_ocp_write( tp, 0xF87A, 0x7100 ); - mac_ocp_write( tp, 0xF87C, 0x4892 ); - mac_ocp_write( tp, 0xF87E, 0x4813 ); - mac_ocp_write( tp, 0xF880, 0x8900 ); - mac_ocp_write( tp, 0xF882, 0xE00A ); - mac_ocp_write( tp, 0xF884, 0x7100 ); - mac_ocp_write( tp, 0xF886, 0x4890 ); - mac_ocp_write( tp, 0xF888, 0x4813 ); - mac_ocp_write( tp, 0xF88A, 0x8900 ); - mac_ocp_write( tp, 0xF88C, 0xC74B ); - mac_ocp_write( tp, 0xF88E, 0x74F8 ); - mac_ocp_write( tp, 0xF890, 0x48C2 ); - mac_ocp_write( tp, 0xF892, 0x4841 ); - mac_ocp_write( tp, 0xF894, 0x8CF8 ); - mac_ocp_write( tp, 0xF896, 0xC746 ); - mac_ocp_write( tp, 0xF898, 0x74FC ); - mac_ocp_write( tp, 0xF89A, 0x49C0 ); - mac_ocp_write( tp, 0xF89C, 0xF120 ); - mac_ocp_write( tp, 0xF89E, 0x49C1 ); - mac_ocp_write( tp, 0xF8A0, 0xF11E ); - mac_ocp_write( tp, 0xF8A2, 0x74F8 ); - mac_ocp_write( tp, 0xF8A4, 0x49C0 ); - mac_ocp_write( tp, 0xF8A6, 0xF01B ); - mac_ocp_write( tp, 0xF8A8, 0x49C6 ); - mac_ocp_write( tp, 0xF8AA, 0xF119 ); - mac_ocp_write( tp, 0xF8AC, 0x74F8 ); - mac_ocp_write( tp, 0xF8AE, 0x49C4 ); - mac_ocp_write( tp, 0xF8B0, 0xF013 ); - mac_ocp_write( tp, 0xF8B2, 0xC536 ); - mac_ocp_write( tp, 0xF8B4, 0x74B0 ); - mac_ocp_write( tp, 0xF8B6, 0x49C1 ); - mac_ocp_write( tp, 0xF8B8, 0xF1FD ); - mac_ocp_write( tp, 0xF8BA, 0xC537 ); - mac_ocp_write( tp, 0xF8BC, 0xC434 ); - mac_ocp_write( tp, 0xF8BE, 0x9CA0 ); - mac_ocp_write( tp, 0xF8C0, 0xC435 ); - mac_ocp_write( tp, 0xF8C2, 0x1C13 ); - mac_ocp_write( tp, 0xF8C4, 0x484F ); - mac_ocp_write( tp, 0xF8C6, 0x9CA2 ); - mac_ocp_write( tp, 0xF8C8, 0xC52B ); - mac_ocp_write( tp, 0xF8CA, 0x74B0 ); - mac_ocp_write( tp, 0xF8CC, 0x49C1 ); - mac_ocp_write( tp, 0xF8CE, 0xF1FD ); - mac_ocp_write( tp, 0xF8D0, 0x74F8 ); - mac_ocp_write( tp, 0xF8D2, 0x48C4 ); - mac_ocp_write( tp, 0xF8D4, 0x8CF8 ); - mac_ocp_write( tp, 0xF8D6, 0x7100 ); - mac_ocp_write( tp, 0xF8D8, 0x4893 ); - mac_ocp_write( tp, 0xF8DA, 0x8900 ); - mac_ocp_write( tp, 0xF8DC, 0xFF80 ); - mac_ocp_write( tp, 0xF8DE, 0xC520 ); - mac_ocp_write( tp, 0xF8E0, 0x74B0 ); - mac_ocp_write( tp, 0xF8E2, 0x49C1 ); - mac_ocp_write( tp, 0xF8E4, 0xF11C ); - mac_ocp_write( tp, 0xF8E6, 0xC71E ); - mac_ocp_write( tp, 0xF8E8, 0x74FC ); - mac_ocp_write( tp, 0xF8EA, 0x49C1 ); - mac_ocp_write( tp, 0xF8EC, 0xF118 ); - mac_ocp_write( tp, 0xF8EE, 0x49C0 ); - mac_ocp_write( tp, 0xF8F0, 0xF116 ); - mac_ocp_write( tp, 0xF8F2, 0x74F8 ); - mac_ocp_write( tp, 0xF8F4, 0x49C0 ); - mac_ocp_write( tp, 0xF8F6, 0xF013 ); - mac_ocp_write( tp, 0xF8F8, 0x48C3 ); - mac_ocp_write( tp, 0xF8FA, 0x8CF8 ); - mac_ocp_write( tp, 0xF8FC, 0xC516 ); - mac_ocp_write( tp, 0xF8FE, 0x74A2 ); - mac_ocp_write( tp, 0xF900, 0x49CE ); - mac_ocp_write( tp, 0xF902, 0xF1FE ); - mac_ocp_write( tp, 0xF904, 0xC411 ); - mac_ocp_write( tp, 0xF906, 0x9CA0 ); - mac_ocp_write( tp, 0xF908, 0xC411 ); - mac_ocp_write( tp, 0xF90A, 0x1C13 ); - mac_ocp_write( tp, 0xF90C, 0x484F ); - mac_ocp_write( tp, 0xF90E, 0x9CA2 ); - mac_ocp_write( tp, 0xF910, 0x74A2 ); - mac_ocp_write( tp, 0xF912, 0x49CF ); - mac_ocp_write( tp, 0xF914, 0xF1FE ); - mac_ocp_write( tp, 0xF916, 0x7100 ); - mac_ocp_write( tp, 0xF918, 0x4891 ); - mac_ocp_write( tp, 0xF91A, 0x8900 ); - mac_ocp_write( tp, 0xF91C, 0xFF80 ); - mac_ocp_write( tp, 0xF91E, 0xE400 ); - mac_ocp_write( tp, 0xF920, 0xD3E0 ); - mac_ocp_write( tp, 0xF922, 0xE000 ); - mac_ocp_write( tp, 0xF924, 0x0481 ); - mac_ocp_write( tp, 0xF926, 0x0C81 ); - mac_ocp_write( tp, 0xF928, 0xDE20 ); - mac_ocp_write( tp, 0xF92A, 0x0000 ); - mac_ocp_write( tp, 0xF92C, 0x0992 ); - mac_ocp_write( tp, 0xF92E, 0x1B76 ); - mac_ocp_write( tp, 0xF930, 0xC602 ); - mac_ocp_write( tp, 0xF932, 0xBE00 ); - mac_ocp_write( tp, 0xF934, 0x059C ); - mac_ocp_write( tp, 0xF936, 0x1B76 ); - mac_ocp_write( tp, 0xF938, 0xC602 ); - mac_ocp_write( tp, 0xF93A, 0xBE00 ); - mac_ocp_write( tp, 0xF93C, 0x065A ); - mac_ocp_write( tp, 0xF93E, 0xB400 ); - mac_ocp_write( tp, 0xF940, 0x18DE ); - mac_ocp_write( tp, 0xF942, 0x2008 ); - mac_ocp_write( tp, 0xF944, 0x4001 ); - mac_ocp_write( tp, 0xF946, 0xF10F ); - mac_ocp_write( tp, 0xF948, 0x7342 ); - mac_ocp_write( tp, 0xF94A, 0x1880 ); - mac_ocp_write( tp, 0xF94C, 0x2008 ); - mac_ocp_write( tp, 0xF94E, 0x0009 ); - mac_ocp_write( tp, 0xF950, 0x4018 ); - mac_ocp_write( tp, 0xF952, 0xF109 ); - mac_ocp_write( tp, 0xF954, 0x7340 ); - mac_ocp_write( tp, 0xF956, 0x25BC ); - mac_ocp_write( tp, 0xF958, 0x130F ); - mac_ocp_write( tp, 0xF95A, 0xF105 ); - mac_ocp_write( tp, 0xF95C, 0xC00A ); - mac_ocp_write( tp, 0xF95E, 0x7300 ); - mac_ocp_write( tp, 0xF960, 0x4831 ); - mac_ocp_write( tp, 0xF962, 0x9B00 ); - mac_ocp_write( tp, 0xF964, 0xB000 ); - mac_ocp_write( tp, 0xF966, 0x7340 ); - mac_ocp_write( tp, 0xF968, 0x8320 ); - mac_ocp_write( tp, 0xF96A, 0xC302 ); - mac_ocp_write( tp, 0xF96C, 0xBB00 ); - mac_ocp_write( tp, 0xF96E, 0x0C12 ); - mac_ocp_write( tp, 0xF970, 0xE860 ); - mac_ocp_write( tp, 0xF972, 0xC406 ); - mac_ocp_write( tp, 0xF974, 0x7580 ); - mac_ocp_write( tp, 0xF976, 0x4851 ); - mac_ocp_write( tp, 0xF978, 0x8D80 ); - mac_ocp_write( tp, 0xF97A, 0xC403 ); - mac_ocp_write( tp, 0xF97C, 0xBC00 ); - mac_ocp_write( tp, 0xF97E, 0xD3E0 ); - mac_ocp_write( tp, 0xF980, 0x02C8 ); - mac_ocp_write( tp, 0xF982, 0xC406 ); - mac_ocp_write( tp, 0xF984, 0x7580 ); - mac_ocp_write( tp, 0xF986, 0x4850 ); - mac_ocp_write( tp, 0xF988, 0x8D80 ); - mac_ocp_write( tp, 0xF98A, 0xC403 ); - mac_ocp_write( tp, 0xF98C, 0xBC00 ); - mac_ocp_write( tp, 0xF98E, 0xD3E0 ); - mac_ocp_write( tp, 0xF990, 0x0298 ); - - mac_ocp_write( tp, 0xDE30, 0x0080 ); - - mac_ocp_write( tp, 0xFC26, 0x8000 ); - - mac_ocp_write( tp, 0xFC28, 0x0075 ); - mac_ocp_write( tp, 0xFC2A, 0x02B1 ); - mac_ocp_write( tp, 0xFC2C, 0x0991 ); - mac_ocp_write( tp, 0xFC2E, 0x059B ); - mac_ocp_write( tp, 0xFC30, 0x0659 ); - mac_ocp_write( tp, 0xFC32, 0x0000 ); - mac_ocp_write( tp, 0xFC34, 0x02C7 ); - mac_ocp_write( tp, 0xFC36, 0x0279 ); - } else if (tp->mcfg == CFG_METHOD_24) { - rtl8168_hw_disable_mac_mcu_bps(dev); - - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE011 ); - mac_ocp_write( tp, 0xF804, 0xE015 ); - mac_ocp_write( tp, 0xF806, 0xE018 ); - mac_ocp_write( tp, 0xF808, 0xE01B ); - mac_ocp_write( tp, 0xF80A, 0xE027 ); - mac_ocp_write( tp, 0xF80C, 0xE043 ); - mac_ocp_write( tp, 0xF80E, 0xE065 ); - mac_ocp_write( tp, 0xF810, 0x49E2 ); - mac_ocp_write( tp, 0xF812, 0xF005 ); - mac_ocp_write( tp, 0xF814, 0x49EA ); - mac_ocp_write( tp, 0xF816, 0xF003 ); - mac_ocp_write( tp, 0xF818, 0xC404 ); - mac_ocp_write( tp, 0xF81A, 0xBC00 ); - mac_ocp_write( tp, 0xF81C, 0xC403 ); - mac_ocp_write( tp, 0xF81E, 0xBC00 ); - mac_ocp_write( tp, 0xF820, 0x0496 ); - mac_ocp_write( tp, 0xF822, 0x051A ); - mac_ocp_write( tp, 0xF824, 0x1D01 ); - mac_ocp_write( tp, 0xF826, 0x8DE8 ); - mac_ocp_write( tp, 0xF828, 0xC602 ); - mac_ocp_write( tp, 0xF82A, 0xBE00 ); - mac_ocp_write( tp, 0xF82C, 0x0206 ); - mac_ocp_write( tp, 0xF82E, 0x1B76 ); - mac_ocp_write( tp, 0xF830, 0xC202 ); - mac_ocp_write( tp, 0xF832, 0xBA00 ); - mac_ocp_write( tp, 0xF834, 0x058A ); - mac_ocp_write( tp, 0xF836, 0x1B76 ); - mac_ocp_write( tp, 0xF838, 0xC602 ); - mac_ocp_write( tp, 0xF83A, 0xBE00 ); - mac_ocp_write( tp, 0xF83C, 0x0648 ); - mac_ocp_write( tp, 0xF83E, 0x74E6 ); - mac_ocp_write( tp, 0xF840, 0x1B78 ); - mac_ocp_write( tp, 0xF842, 0x46DC ); - mac_ocp_write( tp, 0xF844, 0x1300 ); - mac_ocp_write( tp, 0xF846, 0xF005 ); - mac_ocp_write( tp, 0xF848, 0x74F8 ); - mac_ocp_write( tp, 0xF84A, 0x48C3 ); - mac_ocp_write( tp, 0xF84C, 0x48C4 ); - mac_ocp_write( tp, 0xF84E, 0x8CF8 ); - mac_ocp_write( tp, 0xF850, 0x64E7 ); - mac_ocp_write( tp, 0xF852, 0xC302 ); - mac_ocp_write( tp, 0xF854, 0xBB00 ); - mac_ocp_write( tp, 0xF856, 0x068E ); - mac_ocp_write( tp, 0xF858, 0x74E4 ); - mac_ocp_write( tp, 0xF85A, 0x49C5 ); - mac_ocp_write( tp, 0xF85C, 0xF106 ); - mac_ocp_write( tp, 0xF85E, 0x49C6 ); - mac_ocp_write( tp, 0xF860, 0xF107 ); - mac_ocp_write( tp, 0xF862, 0x48C8 ); - mac_ocp_write( tp, 0xF864, 0x48C9 ); - mac_ocp_write( tp, 0xF866, 0xE011 ); - mac_ocp_write( tp, 0xF868, 0x48C9 ); - mac_ocp_write( tp, 0xF86A, 0x4848 ); - mac_ocp_write( tp, 0xF86C, 0xE00E ); - mac_ocp_write( tp, 0xF86E, 0x4848 ); - mac_ocp_write( tp, 0xF870, 0x49C7 ); - mac_ocp_write( tp, 0xF872, 0xF00A ); - mac_ocp_write( tp, 0xF874, 0x48C9 ); - mac_ocp_write( tp, 0xF876, 0xC60D ); - mac_ocp_write( tp, 0xF878, 0x1D1F ); - mac_ocp_write( tp, 0xF87A, 0x8DC2 ); - mac_ocp_write( tp, 0xF87C, 0x1D00 ); - mac_ocp_write( tp, 0xF87E, 0x8DC3 ); - mac_ocp_write( tp, 0xF880, 0x1D11 ); - mac_ocp_write( tp, 0xF882, 0x8DC0 ); - mac_ocp_write( tp, 0xF884, 0xE002 ); - mac_ocp_write( tp, 0xF886, 0x4849 ); - mac_ocp_write( tp, 0xF888, 0x94E5 ); - mac_ocp_write( tp, 0xF88A, 0xC602 ); - mac_ocp_write( tp, 0xF88C, 0xBE00 ); - mac_ocp_write( tp, 0xF88E, 0x0238 ); - mac_ocp_write( tp, 0xF890, 0xE434 ); - mac_ocp_write( tp, 0xF892, 0x49D9 ); - mac_ocp_write( tp, 0xF894, 0xF01B ); - mac_ocp_write( tp, 0xF896, 0xC31E ); - mac_ocp_write( tp, 0xF898, 0x7464 ); - mac_ocp_write( tp, 0xF89A, 0x49C4 ); - mac_ocp_write( tp, 0xF89C, 0xF114 ); - mac_ocp_write( tp, 0xF89E, 0xC31B ); - mac_ocp_write( tp, 0xF8A0, 0x6460 ); - mac_ocp_write( tp, 0xF8A2, 0x14FA ); - mac_ocp_write( tp, 0xF8A4, 0xFA02 ); - mac_ocp_write( tp, 0xF8A6, 0xE00F ); - mac_ocp_write( tp, 0xF8A8, 0xC317 ); - mac_ocp_write( tp, 0xF8AA, 0x7460 ); - mac_ocp_write( tp, 0xF8AC, 0x49C0 ); - mac_ocp_write( tp, 0xF8AE, 0xF10B ); - mac_ocp_write( tp, 0xF8B0, 0xC311 ); - mac_ocp_write( tp, 0xF8B2, 0x7462 ); - mac_ocp_write( tp, 0xF8B4, 0x48C1 ); - mac_ocp_write( tp, 0xF8B6, 0x9C62 ); - mac_ocp_write( tp, 0xF8B8, 0x4841 ); - mac_ocp_write( tp, 0xF8BA, 0x9C62 ); - mac_ocp_write( tp, 0xF8BC, 0xC30A ); - mac_ocp_write( tp, 0xF8BE, 0x1C04 ); - mac_ocp_write( tp, 0xF8C0, 0x8C60 ); - mac_ocp_write( tp, 0xF8C2, 0xE004 ); - mac_ocp_write( tp, 0xF8C4, 0x1C15 ); - mac_ocp_write( tp, 0xF8C6, 0xC305 ); - mac_ocp_write( tp, 0xF8C8, 0x8C60 ); - mac_ocp_write( tp, 0xF8CA, 0xC602 ); - mac_ocp_write( tp, 0xF8CC, 0xBE00 ); - mac_ocp_write( tp, 0xF8CE, 0x0374 ); - mac_ocp_write( tp, 0xF8D0, 0xE434 ); - mac_ocp_write( tp, 0xF8D2, 0xE030 ); - mac_ocp_write( tp, 0xF8D4, 0xE61C ); - mac_ocp_write( tp, 0xF8D6, 0xE906 ); - mac_ocp_write( tp, 0xF8D8, 0xC602 ); - mac_ocp_write( tp, 0xF8DA, 0xBE00 ); - mac_ocp_write( tp, 0xF8DC, 0x0000 ); - - mac_ocp_write( tp, 0xFC26, 0x8000 ); - - mac_ocp_write( tp, 0xFC28, 0x0493 ); - mac_ocp_write( tp, 0xFC2A, 0x0205 ); - mac_ocp_write( tp, 0xFC2C, 0x0589 ); - mac_ocp_write( tp, 0xFC2E, 0x0647 ); - mac_ocp_write( tp, 0xFC30, 0x0000 ); - mac_ocp_write( tp, 0xFC32, 0x0215 ); - mac_ocp_write( tp, 0xFC34, 0x0285 ); - } else if (tp->mcfg == CFG_METHOD_25) { - rtl8168_hw_disable_mac_mcu_bps(dev); - - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE00A ); - mac_ocp_write( tp, 0xF804, 0xE01B ); - mac_ocp_write( tp, 0xF806, 0xE03D ); - mac_ocp_write( tp, 0xF808, 0xE04C ); - mac_ocp_write( tp, 0xF80A, 0xE053 ); - mac_ocp_write( tp, 0xF80C, 0xE055 ); - mac_ocp_write( tp, 0xF80E, 0xE06C ); - mac_ocp_write( tp, 0xF810, 0xC202 ); - mac_ocp_write( tp, 0xF812, 0xBA00 ); - mac_ocp_write( tp, 0xF814, 0x0DFC ); - mac_ocp_write( tp, 0xF816, 0xC511 ); - mac_ocp_write( tp, 0xF818, 0x74A2 ); - mac_ocp_write( tp, 0xF81A, 0x8CA5 ); - mac_ocp_write( tp, 0xF81C, 0x74A0 ); - mac_ocp_write( tp, 0xF81E, 0xC50B ); - mac_ocp_write( tp, 0xF820, 0x9CA2 ); - mac_ocp_write( tp, 0xF822, 0x1C11 ); - mac_ocp_write( tp, 0xF824, 0x9CA0 ); - mac_ocp_write( tp, 0xF826, 0xC506 ); - mac_ocp_write( tp, 0xF828, 0xBD00 ); - mac_ocp_write( tp, 0xF82A, 0x7444 ); - mac_ocp_write( tp, 0xF82C, 0xC502 ); - mac_ocp_write( tp, 0xF82E, 0xBD00 ); - mac_ocp_write( tp, 0xF830, 0x0A30 ); - mac_ocp_write( tp, 0xF832, 0x0A46 ); - mac_ocp_write( tp, 0xF834, 0xE434 ); - mac_ocp_write( tp, 0xF836, 0xE096 ); - mac_ocp_write( tp, 0xF838, 0xD3C0 ); - mac_ocp_write( tp, 0xF83A, 0x49D9 ); - mac_ocp_write( tp, 0xF83C, 0xF019 ); - mac_ocp_write( tp, 0xF83E, 0xC520 ); - mac_ocp_write( tp, 0xF840, 0x64A5 ); - mac_ocp_write( tp, 0xF842, 0x1400 ); - mac_ocp_write( tp, 0xF844, 0xF007 ); - mac_ocp_write( tp, 0xF846, 0x0C01 ); - mac_ocp_write( tp, 0xF848, 0x8CA5 ); - mac_ocp_write( tp, 0xF84A, 0x1C15 ); - mac_ocp_write( tp, 0xF84C, 0xC515 ); - mac_ocp_write( tp, 0xF84E, 0x9CA0 ); - mac_ocp_write( tp, 0xF850, 0xE00F ); - mac_ocp_write( tp, 0xF852, 0xC513 ); - mac_ocp_write( tp, 0xF854, 0x74A0 ); - mac_ocp_write( tp, 0xF856, 0x48C8 ); - mac_ocp_write( tp, 0xF858, 0x48CA ); - mac_ocp_write( tp, 0xF85A, 0x9CA0 ); - mac_ocp_write( tp, 0xF85C, 0xC510 ); - mac_ocp_write( tp, 0xF85E, 0x1B00 ); - mac_ocp_write( tp, 0xF860, 0x9BA0 ); - mac_ocp_write( tp, 0xF862, 0x1B1C ); - mac_ocp_write( tp, 0xF864, 0x483F ); - mac_ocp_write( tp, 0xF866, 0x9BA2 ); - mac_ocp_write( tp, 0xF868, 0x1B04 ); - mac_ocp_write( tp, 0xF86A, 0xC506 ); - mac_ocp_write( tp, 0xF86C, 0x9BA0 ); - mac_ocp_write( tp, 0xF86E, 0xC603 ); - mac_ocp_write( tp, 0xF870, 0xBE00 ); - mac_ocp_write( tp, 0xF872, 0x0298 ); - mac_ocp_write( tp, 0xF874, 0x03DE ); - mac_ocp_write( tp, 0xF876, 0xE434 ); - mac_ocp_write( tp, 0xF878, 0xE096 ); - mac_ocp_write( tp, 0xF87A, 0xE860 ); - mac_ocp_write( tp, 0xF87C, 0xDE20 ); - mac_ocp_write( tp, 0xF87E, 0xD3C0 ); - mac_ocp_write( tp, 0xF880, 0xC50F ); - mac_ocp_write( tp, 0xF882, 0x76A4 ); - mac_ocp_write( tp, 0xF884, 0x49E3 ); - mac_ocp_write( tp, 0xF886, 0xF007 ); - mac_ocp_write( tp, 0xF888, 0x49C0 ); - mac_ocp_write( tp, 0xF88A, 0xF103 ); - mac_ocp_write( tp, 0xF88C, 0xC607 ); - mac_ocp_write( tp, 0xF88E, 0xBE00 ); - mac_ocp_write( tp, 0xF890, 0xC606 ); - mac_ocp_write( tp, 0xF892, 0xBE00 ); - mac_ocp_write( tp, 0xF894, 0xC602 ); - mac_ocp_write( tp, 0xF896, 0xBE00 ); - mac_ocp_write( tp, 0xF898, 0x0A88 ); - mac_ocp_write( tp, 0xF89A, 0x0A64 ); - mac_ocp_write( tp, 0xF89C, 0x0A68 ); - mac_ocp_write( tp, 0xF89E, 0xDC00 ); - mac_ocp_write( tp, 0xF8A0, 0xC707 ); - mac_ocp_write( tp, 0xF8A2, 0x1D00 ); - mac_ocp_write( tp, 0xF8A4, 0x8DE2 ); - mac_ocp_write( tp, 0xF8A6, 0x48C1 ); - mac_ocp_write( tp, 0xF8A8, 0xC502 ); - mac_ocp_write( tp, 0xF8AA, 0xBD00 ); - mac_ocp_write( tp, 0xF8AC, 0x00AA ); - mac_ocp_write( tp, 0xF8AE, 0xE0C0 ); - mac_ocp_write( tp, 0xF8B0, 0xC502 ); - mac_ocp_write( tp, 0xF8B2, 0xBD00 ); - mac_ocp_write( tp, 0xF8B4, 0x0132 ); - mac_ocp_write( tp, 0xF8B6, 0xC50C ); - mac_ocp_write( tp, 0xF8B8, 0x74A2 ); - mac_ocp_write( tp, 0xF8BA, 0x49CE ); - mac_ocp_write( tp, 0xF8BC, 0xF1FE ); - mac_ocp_write( tp, 0xF8BE, 0x1C00 ); - mac_ocp_write( tp, 0xF8C0, 0x9EA0 ); - mac_ocp_write( tp, 0xF8C2, 0x1C1C ); - mac_ocp_write( tp, 0xF8C4, 0x484F ); - mac_ocp_write( tp, 0xF8C6, 0x9CA2 ); - mac_ocp_write( tp, 0xF8C8, 0xC402 ); - mac_ocp_write( tp, 0xF8CA, 0xBC00 ); - mac_ocp_write( tp, 0xF8CC, 0x0AFA ); - mac_ocp_write( tp, 0xF8CE, 0xDE20 ); - mac_ocp_write( tp, 0xF8D0, 0xE000 ); - mac_ocp_write( tp, 0xF8D2, 0xE092 ); - mac_ocp_write( tp, 0xF8D4, 0xE430 ); - mac_ocp_write( tp, 0xF8D6, 0xDE20 ); - mac_ocp_write( tp, 0xF8D8, 0xE0C0 ); - mac_ocp_write( tp, 0xF8DA, 0xE860 ); - mac_ocp_write( tp, 0xF8DC, 0xE84C ); - mac_ocp_write( tp, 0xF8DE, 0xB400 ); - mac_ocp_write( tp, 0xF8E0, 0xB430 ); - mac_ocp_write( tp, 0xF8E2, 0xE410 ); - mac_ocp_write( tp, 0xF8E4, 0xC0AE ); - mac_ocp_write( tp, 0xF8E6, 0xB407 ); - mac_ocp_write( tp, 0xF8E8, 0xB406 ); - mac_ocp_write( tp, 0xF8EA, 0xB405 ); - mac_ocp_write( tp, 0xF8EC, 0xB404 ); - mac_ocp_write( tp, 0xF8EE, 0xB403 ); - mac_ocp_write( tp, 0xF8F0, 0xB402 ); - mac_ocp_write( tp, 0xF8F2, 0xB401 ); - mac_ocp_write( tp, 0xF8F4, 0xC7EE ); - mac_ocp_write( tp, 0xF8F6, 0x76F4 ); - mac_ocp_write( tp, 0xF8F8, 0xC2ED ); - mac_ocp_write( tp, 0xF8FA, 0xC3ED ); - mac_ocp_write( tp, 0xF8FC, 0xC1EF ); - mac_ocp_write( tp, 0xF8FE, 0xC5F3 ); - mac_ocp_write( tp, 0xF900, 0x74A0 ); - mac_ocp_write( tp, 0xF902, 0x49CD ); - mac_ocp_write( tp, 0xF904, 0xF001 ); - mac_ocp_write( tp, 0xF906, 0xC5EE ); - mac_ocp_write( tp, 0xF908, 0x74A0 ); - mac_ocp_write( tp, 0xF90A, 0x49C1 ); - mac_ocp_write( tp, 0xF90C, 0xF105 ); - mac_ocp_write( tp, 0xF90E, 0xC5E4 ); - mac_ocp_write( tp, 0xF910, 0x74A2 ); - mac_ocp_write( tp, 0xF912, 0x49CE ); - mac_ocp_write( tp, 0xF914, 0xF00B ); - mac_ocp_write( tp, 0xF916, 0x7444 ); - mac_ocp_write( tp, 0xF918, 0x484B ); - mac_ocp_write( tp, 0xF91A, 0x9C44 ); - mac_ocp_write( tp, 0xF91C, 0x1C10 ); - mac_ocp_write( tp, 0xF91E, 0x9C62 ); - mac_ocp_write( tp, 0xF920, 0x1C11 ); - mac_ocp_write( tp, 0xF922, 0x8C60 ); - mac_ocp_write( tp, 0xF924, 0x1C00 ); - mac_ocp_write( tp, 0xF926, 0x9CF6 ); - mac_ocp_write( tp, 0xF928, 0xE0E1 ); - mac_ocp_write( tp, 0xF92A, 0x49E7 ); - mac_ocp_write( tp, 0xF92C, 0xF016 ); - mac_ocp_write( tp, 0xF92E, 0x1D80 ); - mac_ocp_write( tp, 0xF930, 0x8DF4 ); - mac_ocp_write( tp, 0xF932, 0x74F8 ); - mac_ocp_write( tp, 0xF934, 0x4843 ); - mac_ocp_write( tp, 0xF936, 0x8CF8 ); - mac_ocp_write( tp, 0xF938, 0x74F8 ); - mac_ocp_write( tp, 0xF93A, 0x74F8 ); - mac_ocp_write( tp, 0xF93C, 0x7444 ); - mac_ocp_write( tp, 0xF93E, 0x48C8 ); - mac_ocp_write( tp, 0xF940, 0x48C9 ); - mac_ocp_write( tp, 0xF942, 0x48CA ); - mac_ocp_write( tp, 0xF944, 0x9C44 ); - mac_ocp_write( tp, 0xF946, 0x74F8 ); - mac_ocp_write( tp, 0xF948, 0x4844 ); - mac_ocp_write( tp, 0xF94A, 0x8CF8 ); - mac_ocp_write( tp, 0xF94C, 0x1E01 ); - mac_ocp_write( tp, 0xF94E, 0xE8D0 ); - mac_ocp_write( tp, 0xF950, 0x7420 ); - mac_ocp_write( tp, 0xF952, 0x48C1 ); - mac_ocp_write( tp, 0xF954, 0x9C20 ); - mac_ocp_write( tp, 0xF956, 0xE0CA ); - mac_ocp_write( tp, 0xF958, 0x49E6 ); - mac_ocp_write( tp, 0xF95A, 0xF029 ); - mac_ocp_write( tp, 0xF95C, 0x1D40 ); - mac_ocp_write( tp, 0xF95E, 0x8DF4 ); - mac_ocp_write( tp, 0xF960, 0x74FC ); - mac_ocp_write( tp, 0xF962, 0x49C0 ); - mac_ocp_write( tp, 0xF964, 0xF123 ); - mac_ocp_write( tp, 0xF966, 0x49C1 ); - mac_ocp_write( tp, 0xF968, 0xF121 ); - mac_ocp_write( tp, 0xF96A, 0x74F8 ); - mac_ocp_write( tp, 0xF96C, 0x49C0 ); - mac_ocp_write( tp, 0xF96E, 0xF01E ); - mac_ocp_write( tp, 0xF970, 0x48C4 ); - mac_ocp_write( tp, 0xF972, 0x8CF8 ); - mac_ocp_write( tp, 0xF974, 0x1E00 ); - mac_ocp_write( tp, 0xF976, 0xE8BC ); - mac_ocp_write( tp, 0xF978, 0xC5B2 ); - mac_ocp_write( tp, 0xF97A, 0x74A0 ); - mac_ocp_write( tp, 0xF97C, 0x49C3 ); - mac_ocp_write( tp, 0xF97E, 0xF016 ); - mac_ocp_write( tp, 0xF980, 0xC5B0 ); - mac_ocp_write( tp, 0xF982, 0x74A4 ); - mac_ocp_write( tp, 0xF984, 0x49C2 ); - mac_ocp_write( tp, 0xF986, 0xF005 ); - mac_ocp_write( tp, 0xF988, 0xC5AB ); - mac_ocp_write( tp, 0xF98A, 0x74B2 ); - mac_ocp_write( tp, 0xF98C, 0x49C9 ); - mac_ocp_write( tp, 0xF98E, 0xF10E ); - mac_ocp_write( tp, 0xF990, 0xC5A7 ); - mac_ocp_write( tp, 0xF992, 0x74A8 ); - mac_ocp_write( tp, 0xF994, 0x4845 ); - mac_ocp_write( tp, 0xF996, 0x4846 ); - mac_ocp_write( tp, 0xF998, 0x4847 ); - mac_ocp_write( tp, 0xF99A, 0x4848 ); - mac_ocp_write( tp, 0xF99C, 0x9CA8 ); - mac_ocp_write( tp, 0xF99E, 0x74B2 ); - mac_ocp_write( tp, 0xF9A0, 0x4849 ); - mac_ocp_write( tp, 0xF9A2, 0x9CB2 ); - mac_ocp_write( tp, 0xF9A4, 0x74A0 ); - mac_ocp_write( tp, 0xF9A6, 0x484F ); - mac_ocp_write( tp, 0xF9A8, 0x9CA0 ); - mac_ocp_write( tp, 0xF9AA, 0xE0A0 ); - mac_ocp_write( tp, 0xF9AC, 0x49E4 ); - mac_ocp_write( tp, 0xF9AE, 0xF018 ); - mac_ocp_write( tp, 0xF9B0, 0x1D10 ); - mac_ocp_write( tp, 0xF9B2, 0x8DF4 ); - mac_ocp_write( tp, 0xF9B4, 0x74F8 ); - mac_ocp_write( tp, 0xF9B6, 0x74F8 ); - mac_ocp_write( tp, 0xF9B8, 0x74F8 ); - mac_ocp_write( tp, 0xF9BA, 0x4843 ); - mac_ocp_write( tp, 0xF9BC, 0x8CF8 ); - mac_ocp_write( tp, 0xF9BE, 0x74F8 ); - mac_ocp_write( tp, 0xF9C0, 0x74F8 ); - mac_ocp_write( tp, 0xF9C2, 0x74F8 ); - mac_ocp_write( tp, 0xF9C4, 0x4844 ); - mac_ocp_write( tp, 0xF9C6, 0x4842 ); - mac_ocp_write( tp, 0xF9C8, 0x4841 ); - mac_ocp_write( tp, 0xF9CA, 0x8CF8 ); - mac_ocp_write( tp, 0xF9CC, 0x1E01 ); - mac_ocp_write( tp, 0xF9CE, 0xE890 ); - mac_ocp_write( tp, 0xF9D0, 0x7420 ); - mac_ocp_write( tp, 0xF9D2, 0x4841 ); - mac_ocp_write( tp, 0xF9D4, 0x9C20 ); - mac_ocp_write( tp, 0xF9D6, 0x7444 ); - mac_ocp_write( tp, 0xF9D8, 0x4848 ); - mac_ocp_write( tp, 0xF9DA, 0x9C44 ); - mac_ocp_write( tp, 0xF9DC, 0xE087 ); - mac_ocp_write( tp, 0xF9DE, 0x49E5 ); - mac_ocp_write( tp, 0xF9E0, 0xF038 ); - mac_ocp_write( tp, 0xF9E2, 0x1D20 ); - mac_ocp_write( tp, 0xF9E4, 0x8DF4 ); - mac_ocp_write( tp, 0xF9E6, 0x74F8 ); - mac_ocp_write( tp, 0xF9E8, 0x48C2 ); - mac_ocp_write( tp, 0xF9EA, 0x4841 ); - mac_ocp_write( tp, 0xF9EC, 0x8CF8 ); - mac_ocp_write( tp, 0xF9EE, 0x1E01 ); - mac_ocp_write( tp, 0xF9F0, 0x7444 ); - mac_ocp_write( tp, 0xF9F2, 0x49CA ); - mac_ocp_write( tp, 0xF9F4, 0xF103 ); - mac_ocp_write( tp, 0xF9F6, 0x49C2 ); - mac_ocp_write( tp, 0xF9F8, 0xF00C ); - mac_ocp_write( tp, 0xF9FA, 0x49C1 ); - mac_ocp_write( tp, 0xF9FC, 0xF004 ); - mac_ocp_write( tp, 0xF9FE, 0x6447 ); - mac_ocp_write( tp, 0xFA00, 0x2244 ); - mac_ocp_write( tp, 0xFA02, 0xE002 ); - mac_ocp_write( tp, 0xFA04, 0x1C01 ); - mac_ocp_write( tp, 0xFA06, 0x9C62 ); - mac_ocp_write( tp, 0xFA08, 0x1C11 ); - mac_ocp_write( tp, 0xFA0A, 0x8C60 ); - mac_ocp_write( tp, 0xFA0C, 0x1C00 ); - mac_ocp_write( tp, 0xFA0E, 0x9CF6 ); - mac_ocp_write( tp, 0xFA10, 0x7444 ); - mac_ocp_write( tp, 0xFA12, 0x49C8 ); - mac_ocp_write( tp, 0xFA14, 0xF017 ); - mac_ocp_write( tp, 0xFA16, 0x74FC ); - mac_ocp_write( tp, 0xFA18, 0x49C0 ); - mac_ocp_write( tp, 0xFA1A, 0xF114 ); - mac_ocp_write( tp, 0xFA1C, 0x49C1 ); - mac_ocp_write( tp, 0xFA1E, 0xF112 ); - mac_ocp_write( tp, 0xFA20, 0x74F8 ); - mac_ocp_write( tp, 0xFA22, 0x49C0 ); - mac_ocp_write( tp, 0xFA24, 0xF00F ); - mac_ocp_write( tp, 0xFA26, 0x49C6 ); - mac_ocp_write( tp, 0xFA28, 0xF10D ); - mac_ocp_write( tp, 0xFA2A, 0xE86B ); - mac_ocp_write( tp, 0xFA2C, 0x48C4 ); - mac_ocp_write( tp, 0xFA2E, 0x8CF8 ); - mac_ocp_write( tp, 0xFA30, 0x7420 ); - mac_ocp_write( tp, 0xFA32, 0x48C1 ); - mac_ocp_write( tp, 0xFA34, 0x9C20 ); - mac_ocp_write( tp, 0xFA36, 0x7444 ); - mac_ocp_write( tp, 0xFA38, 0x48C8 ); - mac_ocp_write( tp, 0xFA3A, 0x48CA ); - mac_ocp_write( tp, 0xFA3C, 0x9C44 ); - mac_ocp_write( tp, 0xFA3E, 0x48E0 ); - mac_ocp_write( tp, 0xFA40, 0xE006 ); - mac_ocp_write( tp, 0xFA42, 0x7444 ); - mac_ocp_write( tp, 0xFA44, 0x49CA ); - mac_ocp_write( tp, 0xFA46, 0xF004 ); - mac_ocp_write( tp, 0xFA48, 0x48CA ); - mac_ocp_write( tp, 0xFA4A, 0x9C44 ); - mac_ocp_write( tp, 0xFA4C, 0xE851 ); - mac_ocp_write( tp, 0xFA4E, 0xE04E ); - mac_ocp_write( tp, 0xFA50, 0x49E8 ); - mac_ocp_write( tp, 0xFA52, 0xF020 ); - mac_ocp_write( tp, 0xFA54, 0x1D01 ); - mac_ocp_write( tp, 0xFA56, 0x8DF5 ); - mac_ocp_write( tp, 0xFA58, 0x7440 ); - mac_ocp_write( tp, 0xFA5A, 0x49C0 ); - mac_ocp_write( tp, 0xFA5C, 0xF11A ); - mac_ocp_write( tp, 0xFA5E, 0x7444 ); - mac_ocp_write( tp, 0xFA60, 0x49C8 ); - mac_ocp_write( tp, 0xFA62, 0xF017 ); - mac_ocp_write( tp, 0xFA64, 0x49CA ); - mac_ocp_write( tp, 0xFA66, 0xF115 ); - mac_ocp_write( tp, 0xFA68, 0x49C0 ); - mac_ocp_write( tp, 0xFA6A, 0xF103 ); - mac_ocp_write( tp, 0xFA6C, 0x49C1 ); - mac_ocp_write( tp, 0xFA6E, 0xF011 ); - mac_ocp_write( tp, 0xFA70, 0x4849 ); - mac_ocp_write( tp, 0xFA72, 0x9C44 ); - mac_ocp_write( tp, 0xFA74, 0x1C00 ); - mac_ocp_write( tp, 0xFA76, 0x9CF6 ); - mac_ocp_write( tp, 0xFA78, 0x7444 ); - mac_ocp_write( tp, 0xFA7A, 0x49C1 ); - mac_ocp_write( tp, 0xFA7C, 0xF004 ); - mac_ocp_write( tp, 0xFA7E, 0x6446 ); - mac_ocp_write( tp, 0xFA80, 0x1E07 ); - mac_ocp_write( tp, 0xFA82, 0xE003 ); - mac_ocp_write( tp, 0xFA84, 0x1C01 ); - mac_ocp_write( tp, 0xFA86, 0x1E03 ); - mac_ocp_write( tp, 0xFA88, 0x9C62 ); - mac_ocp_write( tp, 0xFA8A, 0x1C11 ); - mac_ocp_write( tp, 0xFA8C, 0x8C60 ); - mac_ocp_write( tp, 0xFA8E, 0xE830 ); - mac_ocp_write( tp, 0xFA90, 0xE02D ); - mac_ocp_write( tp, 0xFA92, 0x49E9 ); - mac_ocp_write( tp, 0xFA94, 0xF004 ); - mac_ocp_write( tp, 0xFA96, 0x1D02 ); - mac_ocp_write( tp, 0xFA98, 0x8DF5 ); - mac_ocp_write( tp, 0xFA9A, 0xE7A6 ); - mac_ocp_write( tp, 0xFA9C, 0x49E3 ); - mac_ocp_write( tp, 0xFA9E, 0xF006 ); - mac_ocp_write( tp, 0xFAA0, 0x1D08 ); - mac_ocp_write( tp, 0xFAA2, 0x8DF4 ); - mac_ocp_write( tp, 0xFAA4, 0x74F8 ); - mac_ocp_write( tp, 0xFAA6, 0x74F8 ); - mac_ocp_write( tp, 0xFAA8, 0xE745 ); - mac_ocp_write( tp, 0xFAAA, 0x49E1 ); - mac_ocp_write( tp, 0xFAAC, 0xF007 ); - mac_ocp_write( tp, 0xFAAE, 0x1D02 ); - mac_ocp_write( tp, 0xFAB0, 0x8DF4 ); - mac_ocp_write( tp, 0xFAB2, 0x1E01 ); - mac_ocp_write( tp, 0xFAB4, 0xE7B1 ); - mac_ocp_write( tp, 0xFAB6, 0xDE20 ); - mac_ocp_write( tp, 0xFAB8, 0xE410 ); - mac_ocp_write( tp, 0xFABA, 0x49E0 ); - mac_ocp_write( tp, 0xFABC, 0xF017 ); - mac_ocp_write( tp, 0xFABE, 0x1D01 ); - mac_ocp_write( tp, 0xFAC0, 0x8DF4 ); - mac_ocp_write( tp, 0xFAC2, 0xC5FA ); - mac_ocp_write( tp, 0xFAC4, 0x1C00 ); - mac_ocp_write( tp, 0xFAC6, 0x8CA0 ); - mac_ocp_write( tp, 0xFAC8, 0x1C1B ); - mac_ocp_write( tp, 0xFACA, 0x9CA2 ); - mac_ocp_write( tp, 0xFACC, 0x74A2 ); - mac_ocp_write( tp, 0xFACE, 0x49CF ); - mac_ocp_write( tp, 0xFAD0, 0xF0FE ); - mac_ocp_write( tp, 0xFAD2, 0xC5F3 ); - mac_ocp_write( tp, 0xFAD4, 0x74A0 ); - mac_ocp_write( tp, 0xFAD6, 0x4849 ); - mac_ocp_write( tp, 0xFAD8, 0x9CA0 ); - mac_ocp_write( tp, 0xFADA, 0x74F8 ); - mac_ocp_write( tp, 0xFADC, 0x49C0 ); - mac_ocp_write( tp, 0xFADE, 0xF006 ); - mac_ocp_write( tp, 0xFAE0, 0x48C3 ); - mac_ocp_write( tp, 0xFAE2, 0x8CF8 ); - mac_ocp_write( tp, 0xFAE4, 0xE81C ); - mac_ocp_write( tp, 0xFAE6, 0x74F8 ); - mac_ocp_write( tp, 0xFAE8, 0x74F8 ); - mac_ocp_write( tp, 0xFAEA, 0xC42A ); - mac_ocp_write( tp, 0xFAEC, 0xBC00 ); - mac_ocp_write( tp, 0xFAEE, 0xC5E4 ); - mac_ocp_write( tp, 0xFAF0, 0x74A2 ); - mac_ocp_write( tp, 0xFAF2, 0x49CE ); - mac_ocp_write( tp, 0xFAF4, 0xF1FE ); - mac_ocp_write( tp, 0xFAF6, 0x9EA0 ); - mac_ocp_write( tp, 0xFAF8, 0x1C1C ); - mac_ocp_write( tp, 0xFAFA, 0x484F ); - mac_ocp_write( tp, 0xFAFC, 0x9CA2 ); - mac_ocp_write( tp, 0xFAFE, 0xFF80 ); - mac_ocp_write( tp, 0xFB00, 0xC5DB ); - mac_ocp_write( tp, 0xFB02, 0x74A2 ); - mac_ocp_write( tp, 0xFB04, 0x49CE ); - mac_ocp_write( tp, 0xFB06, 0xF1FE ); - mac_ocp_write( tp, 0xFB08, 0xC419 ); - mac_ocp_write( tp, 0xFB0A, 0x9CA0 ); - mac_ocp_write( tp, 0xFB0C, 0xC416 ); - mac_ocp_write( tp, 0xFB0E, 0x1C13 ); - mac_ocp_write( tp, 0xFB10, 0x484F ); - mac_ocp_write( tp, 0xFB12, 0x9CA2 ); - mac_ocp_write( tp, 0xFB14, 0x74A2 ); - mac_ocp_write( tp, 0xFB16, 0x49CF ); - mac_ocp_write( tp, 0xFB18, 0xF1FE ); - mac_ocp_write( tp, 0xFB1A, 0xFF80 ); - mac_ocp_write( tp, 0xFB1C, 0xC5CD ); - mac_ocp_write( tp, 0xFB1E, 0x74A2 ); - mac_ocp_write( tp, 0xFB20, 0x49CE ); - mac_ocp_write( tp, 0xFB22, 0xF1FE ); - mac_ocp_write( tp, 0xFB24, 0xC40C ); - mac_ocp_write( tp, 0xFB26, 0x9CA0 ); - mac_ocp_write( tp, 0xFB28, 0xC408 ); - mac_ocp_write( tp, 0xFB2A, 0x1C13 ); - mac_ocp_write( tp, 0xFB2C, 0x484F ); - mac_ocp_write( tp, 0xFB2E, 0x9CA2 ); - mac_ocp_write( tp, 0xFB30, 0x74A2 ); - mac_ocp_write( tp, 0xFB32, 0x49CF ); - mac_ocp_write( tp, 0xFB34, 0xF1FE ); - mac_ocp_write( tp, 0xFB36, 0xFF80 ); - mac_ocp_write( tp, 0xFB38, 0x0000 ); - mac_ocp_write( tp, 0xFB3A, 0x0481 ); - mac_ocp_write( tp, 0xFB3C, 0x0C81 ); - mac_ocp_write( tp, 0xFB3E, 0x0AE0 ); - - - mac_ocp_write( tp, 0xFC26, 0x8000 ); - - mac_ocp_write( tp, 0xFC28, 0x0000 ); - mac_ocp_write( tp, 0xFC2A, 0x0A2F ); - mac_ocp_write( tp, 0xFC2C, 0x0297 ); - mac_ocp_write( tp, 0xFC2E, 0x0A61 ); - mac_ocp_write( tp, 0xFC30, 0x00A9 ); - mac_ocp_write( tp, 0xFC32, 0x012D ); - mac_ocp_write( tp, 0xFC34, 0x0000 ); - mac_ocp_write( tp, 0xFC36, 0x08DF ); - } else if (tp->mcfg == CFG_METHOD_26) { - rtl8168_hw_disable_mac_mcu_bps(dev); - - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE00A ); - mac_ocp_write( tp, 0xF804, 0xE00C ); - mac_ocp_write( tp, 0xF806, 0xE00E ); - mac_ocp_write( tp, 0xF808, 0xE027 ); - mac_ocp_write( tp, 0xF80A, 0xE04F ); - mac_ocp_write( tp, 0xF80C, 0xE05E ); - mac_ocp_write( tp, 0xF80E, 0xE065 ); - mac_ocp_write( tp, 0xF810, 0xC602 ); - mac_ocp_write( tp, 0xF812, 0xBE00 ); - mac_ocp_write( tp, 0xF814, 0x0000 ); - mac_ocp_write( tp, 0xF816, 0xC502 ); - mac_ocp_write( tp, 0xF818, 0xBD00 ); - mac_ocp_write( tp, 0xF81A, 0x074C ); - mac_ocp_write( tp, 0xF81C, 0xC302 ); - mac_ocp_write( tp, 0xF81E, 0xBB00 ); - mac_ocp_write( tp, 0xF820, 0x080A ); - mac_ocp_write( tp, 0xF822, 0x6420 ); - mac_ocp_write( tp, 0xF824, 0x48C2 ); - mac_ocp_write( tp, 0xF826, 0x8C20 ); - mac_ocp_write( tp, 0xF828, 0xC516 ); - mac_ocp_write( tp, 0xF82A, 0x64A4 ); - mac_ocp_write( tp, 0xF82C, 0x49C0 ); - mac_ocp_write( tp, 0xF82E, 0xF009 ); - mac_ocp_write( tp, 0xF830, 0x74A2 ); - mac_ocp_write( tp, 0xF832, 0x8CA5 ); - mac_ocp_write( tp, 0xF834, 0x74A0 ); - mac_ocp_write( tp, 0xF836, 0xC50E ); - mac_ocp_write( tp, 0xF838, 0x9CA2 ); - mac_ocp_write( tp, 0xF83A, 0x1C11 ); - mac_ocp_write( tp, 0xF83C, 0x9CA0 ); - mac_ocp_write( tp, 0xF83E, 0xE006 ); - mac_ocp_write( tp, 0xF840, 0x74F8 ); - mac_ocp_write( tp, 0xF842, 0x48C4 ); - mac_ocp_write( tp, 0xF844, 0x8CF8 ); - mac_ocp_write( tp, 0xF846, 0xC404 ); - mac_ocp_write( tp, 0xF848, 0xBC00 ); - mac_ocp_write( tp, 0xF84A, 0xC403 ); - mac_ocp_write( tp, 0xF84C, 0xBC00 ); - mac_ocp_write( tp, 0xF84E, 0x0BF2 ); - mac_ocp_write( tp, 0xF850, 0x0C0A ); - mac_ocp_write( tp, 0xF852, 0xE434 ); - mac_ocp_write( tp, 0xF854, 0xD3C0 ); - mac_ocp_write( tp, 0xF856, 0x49D9 ); - mac_ocp_write( tp, 0xF858, 0xF01F ); - mac_ocp_write( tp, 0xF85A, 0xC526 ); - mac_ocp_write( tp, 0xF85C, 0x64A5 ); - mac_ocp_write( tp, 0xF85E, 0x1400 ); - mac_ocp_write( tp, 0xF860, 0xF007 ); - mac_ocp_write( tp, 0xF862, 0x0C01 ); - mac_ocp_write( tp, 0xF864, 0x8CA5 ); - mac_ocp_write( tp, 0xF866, 0x1C15 ); - mac_ocp_write( tp, 0xF868, 0xC51B ); - mac_ocp_write( tp, 0xF86A, 0x9CA0 ); - mac_ocp_write( tp, 0xF86C, 0xE013 ); - mac_ocp_write( tp, 0xF86E, 0xC519 ); - mac_ocp_write( tp, 0xF870, 0x74A0 ); - mac_ocp_write( tp, 0xF872, 0x48C4 ); - mac_ocp_write( tp, 0xF874, 0x8CA0 ); - mac_ocp_write( tp, 0xF876, 0xC516 ); - mac_ocp_write( tp, 0xF878, 0x74A4 ); - mac_ocp_write( tp, 0xF87A, 0x48C8 ); - mac_ocp_write( tp, 0xF87C, 0x48CA ); - mac_ocp_write( tp, 0xF87E, 0x9CA4 ); - mac_ocp_write( tp, 0xF880, 0xC512 ); - mac_ocp_write( tp, 0xF882, 0x1B00 ); - mac_ocp_write( tp, 0xF884, 0x9BA0 ); - mac_ocp_write( tp, 0xF886, 0x1B1C ); - mac_ocp_write( tp, 0xF888, 0x483F ); - mac_ocp_write( tp, 0xF88A, 0x9BA2 ); - mac_ocp_write( tp, 0xF88C, 0x1B04 ); - mac_ocp_write( tp, 0xF88E, 0xC508 ); - mac_ocp_write( tp, 0xF890, 0x9BA0 ); - mac_ocp_write( tp, 0xF892, 0xC505 ); - mac_ocp_write( tp, 0xF894, 0xBD00 ); - mac_ocp_write( tp, 0xF896, 0xC502 ); - mac_ocp_write( tp, 0xF898, 0xBD00 ); - mac_ocp_write( tp, 0xF89A, 0x0300 ); - mac_ocp_write( tp, 0xF89C, 0x051E ); - mac_ocp_write( tp, 0xF89E, 0xE434 ); - mac_ocp_write( tp, 0xF8A0, 0xE018 ); - mac_ocp_write( tp, 0xF8A2, 0xE092 ); - mac_ocp_write( tp, 0xF8A4, 0xDE20 ); - mac_ocp_write( tp, 0xF8A6, 0xD3C0 ); - mac_ocp_write( tp, 0xF8A8, 0xC50F ); - mac_ocp_write( tp, 0xF8AA, 0x76A4 ); - mac_ocp_write( tp, 0xF8AC, 0x49E3 ); - mac_ocp_write( tp, 0xF8AE, 0xF007 ); - mac_ocp_write( tp, 0xF8B0, 0x49C0 ); - mac_ocp_write( tp, 0xF8B2, 0xF103 ); - mac_ocp_write( tp, 0xF8B4, 0xC607 ); - mac_ocp_write( tp, 0xF8B6, 0xBE00 ); - mac_ocp_write( tp, 0xF8B8, 0xC606 ); - mac_ocp_write( tp, 0xF8BA, 0xBE00 ); - mac_ocp_write( tp, 0xF8BC, 0xC602 ); - mac_ocp_write( tp, 0xF8BE, 0xBE00 ); - mac_ocp_write( tp, 0xF8C0, 0x0C4C ); - mac_ocp_write( tp, 0xF8C2, 0x0C28 ); - mac_ocp_write( tp, 0xF8C4, 0x0C2C ); - mac_ocp_write( tp, 0xF8C6, 0xDC00 ); - mac_ocp_write( tp, 0xF8C8, 0xC707 ); - mac_ocp_write( tp, 0xF8CA, 0x1D00 ); - mac_ocp_write( tp, 0xF8CC, 0x8DE2 ); - mac_ocp_write( tp, 0xF8CE, 0x48C1 ); - mac_ocp_write( tp, 0xF8D0, 0xC502 ); - mac_ocp_write( tp, 0xF8D2, 0xBD00 ); - mac_ocp_write( tp, 0xF8D4, 0x00AA ); - mac_ocp_write( tp, 0xF8D6, 0xE0C0 ); - mac_ocp_write( tp, 0xF8D8, 0xC502 ); - mac_ocp_write( tp, 0xF8DA, 0xBD00 ); - mac_ocp_write( tp, 0xF8DC, 0x0132 ); - - mac_ocp_write( tp, 0xFC26, 0x8000 ); - - mac_ocp_write( tp, 0xFC2A, 0x0743 ); - mac_ocp_write( tp, 0xFC2C, 0x0801 ); - mac_ocp_write( tp, 0xFC2E, 0x0BE9 ); - mac_ocp_write( tp, 0xFC30, 0x02FD ); - mac_ocp_write( tp, 0xFC32, 0x0C25 ); - mac_ocp_write( tp, 0xFC34, 0x00A9 ); - mac_ocp_write( tp, 0xFC36, 0x012D ); - } else if (tp->mcfg == CFG_METHOD_27) { - rtl8168_hw_disable_mac_mcu_bps(dev); - - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE0D3 ); - mac_ocp_write( tp, 0xF804, 0xE0D6 ); - mac_ocp_write( tp, 0xF806, 0xE0D9 ); - mac_ocp_write( tp, 0xF808, 0xE0DB ); - mac_ocp_write( tp, 0xF80A, 0xE0DD ); - mac_ocp_write( tp, 0xF80C, 0xE0DF ); - mac_ocp_write( tp, 0xF80E, 0xE0E1 ); - mac_ocp_write( tp, 0xF810, 0xC251 ); - mac_ocp_write( tp, 0xF812, 0x7340 ); - mac_ocp_write( tp, 0xF814, 0x49B1 ); - mac_ocp_write( tp, 0xF816, 0xF010 ); - mac_ocp_write( tp, 0xF818, 0x1D02 ); - mac_ocp_write( tp, 0xF81A, 0x8D40 ); - mac_ocp_write( tp, 0xF81C, 0xC202 ); - mac_ocp_write( tp, 0xF81E, 0xBA00 ); - mac_ocp_write( tp, 0xF820, 0x2C3A ); - mac_ocp_write( tp, 0xF822, 0xC0F0 ); - mac_ocp_write( tp, 0xF824, 0xE8DE ); - mac_ocp_write( tp, 0xF826, 0x2000 ); - mac_ocp_write( tp, 0xF828, 0x8000 ); - mac_ocp_write( tp, 0xF82A, 0xC0B6 ); - mac_ocp_write( tp, 0xF82C, 0x268C ); - mac_ocp_write( tp, 0xF82E, 0x752C ); - mac_ocp_write( tp, 0xF830, 0x49D4 ); - mac_ocp_write( tp, 0xF832, 0xF112 ); - mac_ocp_write( tp, 0xF834, 0xE025 ); - mac_ocp_write( tp, 0xF836, 0xC2F6 ); - mac_ocp_write( tp, 0xF838, 0x7146 ); - mac_ocp_write( tp, 0xF83A, 0xC2F5 ); - mac_ocp_write( tp, 0xF83C, 0x7340 ); - mac_ocp_write( tp, 0xF83E, 0x49BE ); - mac_ocp_write( tp, 0xF840, 0xF103 ); - mac_ocp_write( tp, 0xF842, 0xC7F2 ); - mac_ocp_write( tp, 0xF844, 0xE002 ); - mac_ocp_write( tp, 0xF846, 0xC7F1 ); - mac_ocp_write( tp, 0xF848, 0x304F ); - mac_ocp_write( tp, 0xF84A, 0x6226 ); - mac_ocp_write( tp, 0xF84C, 0x49A1 ); - mac_ocp_write( tp, 0xF84E, 0xF1F0 ); - mac_ocp_write( tp, 0xF850, 0x7222 ); - mac_ocp_write( tp, 0xF852, 0x49A0 ); - mac_ocp_write( tp, 0xF854, 0xF1ED ); - mac_ocp_write( tp, 0xF856, 0x2525 ); - mac_ocp_write( tp, 0xF858, 0x1F28 ); - mac_ocp_write( tp, 0xF85A, 0x3097 ); - mac_ocp_write( tp, 0xF85C, 0x3091 ); - mac_ocp_write( tp, 0xF85E, 0x9A36 ); - mac_ocp_write( tp, 0xF860, 0x752C ); - mac_ocp_write( tp, 0xF862, 0x21DC ); - mac_ocp_write( tp, 0xF864, 0x25BC ); - mac_ocp_write( tp, 0xF866, 0xC6E2 ); - mac_ocp_write( tp, 0xF868, 0x77C0 ); - mac_ocp_write( tp, 0xF86A, 0x1304 ); - mac_ocp_write( tp, 0xF86C, 0xF014 ); - mac_ocp_write( tp, 0xF86E, 0x1303 ); - mac_ocp_write( tp, 0xF870, 0xF014 ); - mac_ocp_write( tp, 0xF872, 0x1302 ); - mac_ocp_write( tp, 0xF874, 0xF014 ); - mac_ocp_write( tp, 0xF876, 0x1301 ); - mac_ocp_write( tp, 0xF878, 0xF014 ); - mac_ocp_write( tp, 0xF87A, 0x49D4 ); - mac_ocp_write( tp, 0xF87C, 0xF103 ); - mac_ocp_write( tp, 0xF87E, 0xC3D7 ); - mac_ocp_write( tp, 0xF880, 0xBB00 ); - mac_ocp_write( tp, 0xF882, 0xC618 ); - mac_ocp_write( tp, 0xF884, 0x67C6 ); - mac_ocp_write( tp, 0xF886, 0x752E ); - mac_ocp_write( tp, 0xF888, 0x22D7 ); - mac_ocp_write( tp, 0xF88A, 0x26DD ); - mac_ocp_write( tp, 0xF88C, 0x1505 ); - mac_ocp_write( tp, 0xF88E, 0xF013 ); - mac_ocp_write( tp, 0xF890, 0xC60A ); - mac_ocp_write( tp, 0xF892, 0xBE00 ); - mac_ocp_write( tp, 0xF894, 0xC309 ); - mac_ocp_write( tp, 0xF896, 0xBB00 ); - mac_ocp_write( tp, 0xF898, 0xC308 ); - mac_ocp_write( tp, 0xF89A, 0xBB00 ); - mac_ocp_write( tp, 0xF89C, 0xC307 ); - mac_ocp_write( tp, 0xF89E, 0xBB00 ); - mac_ocp_write( tp, 0xF8A0, 0xC306 ); - mac_ocp_write( tp, 0xF8A2, 0xBB00 ); - mac_ocp_write( tp, 0xF8A4, 0x25C8 ); - mac_ocp_write( tp, 0xF8A6, 0x25A6 ); - mac_ocp_write( tp, 0xF8A8, 0x25AC ); - mac_ocp_write( tp, 0xF8AA, 0x25B2 ); - mac_ocp_write( tp, 0xF8AC, 0x25B8 ); - mac_ocp_write( tp, 0xF8AE, 0xCD08 ); - mac_ocp_write( tp, 0xF8B0, 0x0000 ); - mac_ocp_write( tp, 0xF8B2, 0xC0BC ); - mac_ocp_write( tp, 0xF8B4, 0xC2FF ); - mac_ocp_write( tp, 0xF8B6, 0x7340 ); - mac_ocp_write( tp, 0xF8B8, 0x49B0 ); - mac_ocp_write( tp, 0xF8BA, 0xF04E ); - mac_ocp_write( tp, 0xF8BC, 0x1F46 ); - mac_ocp_write( tp, 0xF8BE, 0x308F ); - mac_ocp_write( tp, 0xF8C0, 0xC3F7 ); - mac_ocp_write( tp, 0xF8C2, 0x1C04 ); - mac_ocp_write( tp, 0xF8C4, 0xE84D ); - mac_ocp_write( tp, 0xF8C6, 0x1401 ); - mac_ocp_write( tp, 0xF8C8, 0xF147 ); - mac_ocp_write( tp, 0xF8CA, 0x7226 ); - mac_ocp_write( tp, 0xF8CC, 0x49A7 ); - mac_ocp_write( tp, 0xF8CE, 0xF044 ); - mac_ocp_write( tp, 0xF8D0, 0x7222 ); - mac_ocp_write( tp, 0xF8D2, 0x2525 ); - mac_ocp_write( tp, 0xF8D4, 0x1F30 ); - mac_ocp_write( tp, 0xF8D6, 0x3097 ); - mac_ocp_write( tp, 0xF8D8, 0x3091 ); - mac_ocp_write( tp, 0xF8DA, 0x7340 ); - mac_ocp_write( tp, 0xF8DC, 0xC4EA ); - mac_ocp_write( tp, 0xF8DE, 0x401C ); - mac_ocp_write( tp, 0xF8E0, 0xF006 ); - mac_ocp_write( tp, 0xF8E2, 0xC6E8 ); - mac_ocp_write( tp, 0xF8E4, 0x75C0 ); - mac_ocp_write( tp, 0xF8E6, 0x49D7 ); - mac_ocp_write( tp, 0xF8E8, 0xF105 ); - mac_ocp_write( tp, 0xF8EA, 0xE036 ); - mac_ocp_write( tp, 0xF8EC, 0x1D08 ); - mac_ocp_write( tp, 0xF8EE, 0x8DC1 ); - mac_ocp_write( tp, 0xF8F0, 0x0208 ); - mac_ocp_write( tp, 0xF8F2, 0x6640 ); - mac_ocp_write( tp, 0xF8F4, 0x2764 ); - mac_ocp_write( tp, 0xF8F6, 0x1606 ); - mac_ocp_write( tp, 0xF8F8, 0xF12F ); - mac_ocp_write( tp, 0xF8FA, 0x6346 ); - mac_ocp_write( tp, 0xF8FC, 0x133B ); - mac_ocp_write( tp, 0xF8FE, 0xF12C ); - mac_ocp_write( tp, 0xF900, 0x9B34 ); - mac_ocp_write( tp, 0xF902, 0x1B18 ); - mac_ocp_write( tp, 0xF904, 0x3093 ); - mac_ocp_write( tp, 0xF906, 0xC32A ); - mac_ocp_write( tp, 0xF908, 0x1C10 ); - mac_ocp_write( tp, 0xF90A, 0xE82A ); - mac_ocp_write( tp, 0xF90C, 0x1401 ); - mac_ocp_write( tp, 0xF90E, 0xF124 ); - mac_ocp_write( tp, 0xF910, 0x1A36 ); - mac_ocp_write( tp, 0xF912, 0x308A ); - mac_ocp_write( tp, 0xF914, 0x7322 ); - mac_ocp_write( tp, 0xF916, 0x25B5 ); - mac_ocp_write( tp, 0xF918, 0x0B0E ); - mac_ocp_write( tp, 0xF91A, 0x1C00 ); - mac_ocp_write( tp, 0xF91C, 0xE82C ); - mac_ocp_write( tp, 0xF91E, 0xC71F ); - mac_ocp_write( tp, 0xF920, 0x4027 ); - mac_ocp_write( tp, 0xF922, 0xF11A ); - mac_ocp_write( tp, 0xF924, 0xE838 ); - mac_ocp_write( tp, 0xF926, 0x1F42 ); - mac_ocp_write( tp, 0xF928, 0x308F ); - mac_ocp_write( tp, 0xF92A, 0x1B08 ); - mac_ocp_write( tp, 0xF92C, 0xE824 ); - mac_ocp_write( tp, 0xF92E, 0x7236 ); - mac_ocp_write( tp, 0xF930, 0x7746 ); - mac_ocp_write( tp, 0xF932, 0x1700 ); - mac_ocp_write( tp, 0xF934, 0xF00D ); - mac_ocp_write( tp, 0xF936, 0xC313 ); - mac_ocp_write( tp, 0xF938, 0x401F ); - mac_ocp_write( tp, 0xF93A, 0xF103 ); - mac_ocp_write( tp, 0xF93C, 0x1F00 ); - mac_ocp_write( tp, 0xF93E, 0x9F46 ); - mac_ocp_write( tp, 0xF940, 0x7744 ); - mac_ocp_write( tp, 0xF942, 0x449F ); - mac_ocp_write( tp, 0xF944, 0x445F ); - mac_ocp_write( tp, 0xF946, 0xE817 ); - mac_ocp_write( tp, 0xF948, 0xC70A ); - mac_ocp_write( tp, 0xF94A, 0x4027 ); - mac_ocp_write( tp, 0xF94C, 0xF105 ); - mac_ocp_write( tp, 0xF94E, 0xC302 ); - mac_ocp_write( tp, 0xF950, 0xBB00 ); - mac_ocp_write( tp, 0xF952, 0x2E08 ); - mac_ocp_write( tp, 0xF954, 0x2DC2 ); - mac_ocp_write( tp, 0xF956, 0xC7FF ); - mac_ocp_write( tp, 0xF958, 0xBF00 ); - mac_ocp_write( tp, 0xF95A, 0xCDB8 ); - mac_ocp_write( tp, 0xF95C, 0xFFFF ); - mac_ocp_write( tp, 0xF95E, 0x0C02 ); - mac_ocp_write( tp, 0xF960, 0xA554 ); - mac_ocp_write( tp, 0xF962, 0xA5DC ); - mac_ocp_write( tp, 0xF964, 0x402F ); - mac_ocp_write( tp, 0xF966, 0xF105 ); - mac_ocp_write( tp, 0xF968, 0x1400 ); - mac_ocp_write( tp, 0xF96A, 0xF1FA ); - mac_ocp_write( tp, 0xF96C, 0x1C01 ); - mac_ocp_write( tp, 0xF96E, 0xE002 ); - mac_ocp_write( tp, 0xF970, 0x1C00 ); - mac_ocp_write( tp, 0xF972, 0xFF80 ); - mac_ocp_write( tp, 0xF974, 0x49B0 ); - mac_ocp_write( tp, 0xF976, 0xF004 ); - mac_ocp_write( tp, 0xF978, 0x0B01 ); - mac_ocp_write( tp, 0xF97A, 0xA1D3 ); - mac_ocp_write( tp, 0xF97C, 0xE003 ); - mac_ocp_write( tp, 0xF97E, 0x0B02 ); - mac_ocp_write( tp, 0xF980, 0xA5D3 ); - mac_ocp_write( tp, 0xF982, 0x3127 ); - mac_ocp_write( tp, 0xF984, 0x3720 ); - mac_ocp_write( tp, 0xF986, 0x0B02 ); - mac_ocp_write( tp, 0xF988, 0xA5D3 ); - mac_ocp_write( tp, 0xF98A, 0x3127 ); - mac_ocp_write( tp, 0xF98C, 0x3720 ); - mac_ocp_write( tp, 0xF98E, 0x1300 ); - mac_ocp_write( tp, 0xF990, 0xF1FB ); - mac_ocp_write( tp, 0xF992, 0xFF80 ); - mac_ocp_write( tp, 0xF994, 0x7322 ); - mac_ocp_write( tp, 0xF996, 0x25B5 ); - mac_ocp_write( tp, 0xF998, 0x1E28 ); - mac_ocp_write( tp, 0xF99A, 0x30DE ); - mac_ocp_write( tp, 0xF99C, 0x30D9 ); - mac_ocp_write( tp, 0xF99E, 0x7264 ); - mac_ocp_write( tp, 0xF9A0, 0x1E11 ); - mac_ocp_write( tp, 0xF9A2, 0x2368 ); - mac_ocp_write( tp, 0xF9A4, 0x3116 ); - mac_ocp_write( tp, 0xF9A6, 0xFF80 ); - mac_ocp_write( tp, 0xF9A8, 0x1B7E ); - mac_ocp_write( tp, 0xF9AA, 0xC602 ); - mac_ocp_write( tp, 0xF9AC, 0xBE00 ); - mac_ocp_write( tp, 0xF9AE, 0x06A6 ); - mac_ocp_write( tp, 0xF9B0, 0x1B7E ); - mac_ocp_write( tp, 0xF9B2, 0xC602 ); - mac_ocp_write( tp, 0xF9B4, 0xBE00 ); - mac_ocp_write( tp, 0xF9B6, 0x0764 ); - mac_ocp_write( tp, 0xF9B8, 0xC602 ); - mac_ocp_write( tp, 0xF9BA, 0xBE00 ); - mac_ocp_write( tp, 0xF9BC, 0x0000 ); - mac_ocp_write( tp, 0xF9BE, 0xC602 ); - mac_ocp_write( tp, 0xF9C0, 0xBE00 ); - mac_ocp_write( tp, 0xF9C2, 0x0000 ); - mac_ocp_write( tp, 0xF9C4, 0xC602 ); - mac_ocp_write( tp, 0xF9C6, 0xBE00 ); - mac_ocp_write( tp, 0xF9C8, 0x0000 ); - mac_ocp_write( tp, 0xF9CA, 0xC602 ); - mac_ocp_write( tp, 0xF9CC, 0xBE00 ); - mac_ocp_write( tp, 0xF9CE, 0x0000 ); - mac_ocp_write( tp, 0xF9D0, 0xC602 ); - mac_ocp_write( tp, 0xF9D2, 0xBE00 ); - mac_ocp_write( tp, 0xF9D4, 0x0000 ); - - mac_ocp_write( tp, 0xFC26, 0x8000 ); - - mac_ocp_write( tp, 0xFC28, 0x2549 ); - mac_ocp_write( tp, 0xFC2A, 0x06A5 ); - mac_ocp_write( tp, 0xFC2C, 0x0763 ); - } else if (tp->mcfg == CFG_METHOD_28) { - rtl8168_hw_disable_mac_mcu_bps(dev); + mac_ocp_write(tp, 0xFC38, 0x0022); +} - mac_ocp_write( tp, 0xF800, 0xE008 ); - mac_ocp_write( tp, 0xF802, 0xE017 ); - mac_ocp_write( tp, 0xF804, 0xE019 ); - mac_ocp_write( tp, 0xF806, 0xE01B ); - mac_ocp_write( tp, 0xF808, 0xE01D ); - mac_ocp_write( tp, 0xF80A, 0xE01F ); - mac_ocp_write( tp, 0xF80C, 0xE021 ); - mac_ocp_write( tp, 0xF80E, 0xE023 ); - mac_ocp_write( tp, 0xF810, 0xC50F ); - mac_ocp_write( tp, 0xF812, 0x76A4 ); - mac_ocp_write( tp, 0xF814, 0x49E3 ); - mac_ocp_write( tp, 0xF816, 0xF007 ); - mac_ocp_write( tp, 0xF818, 0x49C0 ); - mac_ocp_write( tp, 0xF81A, 0xF103 ); - mac_ocp_write( tp, 0xF81C, 0xC607 ); - mac_ocp_write( tp, 0xF81E, 0xBE00 ); - mac_ocp_write( tp, 0xF820, 0xC606 ); - mac_ocp_write( tp, 0xF822, 0xBE00 ); - mac_ocp_write( tp, 0xF824, 0xC602 ); - mac_ocp_write( tp, 0xF826, 0xBE00 ); - mac_ocp_write( tp, 0xF828, 0x0BDA ); - mac_ocp_write( tp, 0xF82A, 0x0BB0 ); - mac_ocp_write( tp, 0xF82C, 0x0BBA ); - mac_ocp_write( tp, 0xF82E, 0xDC00 ); - mac_ocp_write( tp, 0xF830, 0xC602 ); - mac_ocp_write( tp, 0xF832, 0xBE00 ); - mac_ocp_write( tp, 0xF834, 0x0000 ); - mac_ocp_write( tp, 0xF836, 0xC602 ); - mac_ocp_write( tp, 0xF838, 0xBE00 ); - mac_ocp_write( tp, 0xF83A, 0x0000 ); - mac_ocp_write( tp, 0xF83C, 0xC602 ); - mac_ocp_write( tp, 0xF83E, 0xBE00 ); - mac_ocp_write( tp, 0xF840, 0x0000 ); - mac_ocp_write( tp, 0xF842, 0xC602 ); - mac_ocp_write( tp, 0xF844, 0xBE00 ); - mac_ocp_write( tp, 0xF846, 0x0000 ); - mac_ocp_write( tp, 0xF848, 0xC602 ); - mac_ocp_write( tp, 0xF84A, 0xBE00 ); - mac_ocp_write( tp, 0xF84C, 0x0000 ); - mac_ocp_write( tp, 0xF84E, 0xC602 ); - mac_ocp_write( tp, 0xF850, 0xBE00 ); - mac_ocp_write( tp, 0xF852, 0x0000 ); - mac_ocp_write( tp, 0xF854, 0xC602 ); - mac_ocp_write( tp, 0xF856, 0xBE00 ); - mac_ocp_write( tp, 0xF858, 0x0000 ); +static void +rtl8168_hw_mac_mcu_config(struct net_device *dev) +{ + struct rtl8168_private *tp = netdev_priv(dev); - mac_ocp_write( tp, 0xFC26, 0x8000 ); + if (tp->NotWrMcuPatchCode == TRUE) return; - mac_ocp_write( tp, 0xFC28, 0x0BB3 ); - } else if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + switch (tp->mcfg) { + case CFG_METHOD_21: + rtl8168_set_mac_mcu_8168g_1(dev); + break; + case CFG_METHOD_24: + rtl8168_set_mac_mcu_8168gu_1(dev); + break; + case CFG_METHOD_25: + rtl8168_set_mac_mcu_8168gu_2(dev); + break; + case CFG_METHOD_26: + rtl8168_set_mac_mcu_8411b_1(dev); + break; + case CFG_METHOD_27: + rtl8168_set_mac_mcu_8168ep_1(dev); + break; + case CFG_METHOD_28: + rtl8168_set_mac_mcu_8168ep_2(dev); + break; + case CFG_METHOD_29: + case CFG_METHOD_30: + rtl8168_set_mac_mcu_8168h_1(dev); + break; + case CFG_METHOD_31: + if (tp->HwPkgDet == 0x00 || tp->HwPkgDet == 0x0F) + rtl8168_set_mac_mcu_8168fp_1(dev); + else if (tp->HwPkgDet == 0x06) + rtl8168_set_mac_mcu_8168fp_2(dev); + break; + case CFG_METHOD_32: rtl8168_hw_disable_mac_mcu_bps(dev); - - mac_ocp_write(tp, 0xF800, 0xE008); - mac_ocp_write(tp, 0xF802, 0xE00F); - mac_ocp_write(tp, 0xF804, 0xE011); - mac_ocp_write(tp, 0xF806, 0xE047); - mac_ocp_write(tp, 0xF808, 0xE049); - mac_ocp_write(tp, 0xF80A, 0xE073); - mac_ocp_write(tp, 0xF80C, 0xE075); - mac_ocp_write(tp, 0xF80E, 0xE077); - mac_ocp_write(tp, 0xF810, 0xC707); - mac_ocp_write(tp, 0xF812, 0x1D00); - mac_ocp_write(tp, 0xF814, 0x8DE2); - mac_ocp_write(tp, 0xF816, 0x48C1); - mac_ocp_write(tp, 0xF818, 0xC502); - mac_ocp_write(tp, 0xF81A, 0xBD00); - mac_ocp_write(tp, 0xF81C, 0x00E4); - mac_ocp_write(tp, 0xF81E, 0xE0C0); - mac_ocp_write(tp, 0xF820, 0xC502); - mac_ocp_write(tp, 0xF822, 0xBD00); - mac_ocp_write(tp, 0xF824, 0x0216); - mac_ocp_write(tp, 0xF826, 0xC634); - mac_ocp_write(tp, 0xF828, 0x75C0); - mac_ocp_write(tp, 0xF82A, 0x49D3); - mac_ocp_write(tp, 0xF82C, 0xF027); - mac_ocp_write(tp, 0xF82E, 0xC631); - mac_ocp_write(tp, 0xF830, 0x75C0); - mac_ocp_write(tp, 0xF832, 0x49D3); - mac_ocp_write(tp, 0xF834, 0xF123); - mac_ocp_write(tp, 0xF836, 0xC627); - mac_ocp_write(tp, 0xF838, 0x75C0); - mac_ocp_write(tp, 0xF83A, 0xB405); - mac_ocp_write(tp, 0xF83C, 0xC525); - mac_ocp_write(tp, 0xF83E, 0x9DC0); - mac_ocp_write(tp, 0xF840, 0xC621); - mac_ocp_write(tp, 0xF842, 0x75C8); - mac_ocp_write(tp, 0xF844, 0x49D5); - mac_ocp_write(tp, 0xF846, 0xF00A); - mac_ocp_write(tp, 0xF848, 0x49D6); - mac_ocp_write(tp, 0xF84A, 0xF008); - mac_ocp_write(tp, 0xF84C, 0x49D7); - mac_ocp_write(tp, 0xF84E, 0xF006); - mac_ocp_write(tp, 0xF850, 0x49D8); - mac_ocp_write(tp, 0xF852, 0xF004); - mac_ocp_write(tp, 0xF854, 0x75D2); - mac_ocp_write(tp, 0xF856, 0x49D9); - mac_ocp_write(tp, 0xF858, 0xF111); - mac_ocp_write(tp, 0xF85A, 0xC517); - mac_ocp_write(tp, 0xF85C, 0x9DC8); - mac_ocp_write(tp, 0xF85E, 0xC516); - mac_ocp_write(tp, 0xF860, 0x9DD2); - mac_ocp_write(tp, 0xF862, 0xC618); - mac_ocp_write(tp, 0xF864, 0x75C0); - mac_ocp_write(tp, 0xF866, 0x49D4); - mac_ocp_write(tp, 0xF868, 0xF003); - mac_ocp_write(tp, 0xF86A, 0x49D0); - mac_ocp_write(tp, 0xF86C, 0xF104); - mac_ocp_write(tp, 0xF86E, 0xC60A); - mac_ocp_write(tp, 0xF870, 0xC50E); - mac_ocp_write(tp, 0xF872, 0x9DC0); - mac_ocp_write(tp, 0xF874, 0xB005); - mac_ocp_write(tp, 0xF876, 0xC607); - mac_ocp_write(tp, 0xF878, 0x9DC0); - mac_ocp_write(tp, 0xF87A, 0xB007); - mac_ocp_write(tp, 0xF87C, 0xC602); - mac_ocp_write(tp, 0xF87E, 0xBE00); - mac_ocp_write(tp, 0xF880, 0x1A06); - mac_ocp_write(tp, 0xF882, 0xB400); - mac_ocp_write(tp, 0xF884, 0xE86C); - mac_ocp_write(tp, 0xF886, 0xA000); - mac_ocp_write(tp, 0xF888, 0x01E1); - mac_ocp_write(tp, 0xF88A, 0x0200); - mac_ocp_write(tp, 0xF88C, 0x9200); - mac_ocp_write(tp, 0xF88E, 0xE84C); - mac_ocp_write(tp, 0xF890, 0xE004); - mac_ocp_write(tp, 0xF892, 0xE908); - mac_ocp_write(tp, 0xF894, 0xC502); - mac_ocp_write(tp, 0xF896, 0xBD00); - mac_ocp_write(tp, 0xF898, 0x0B58); - mac_ocp_write(tp, 0xF89A, 0xB407); - mac_ocp_write(tp, 0xF89C, 0xB404); - mac_ocp_write(tp, 0xF89E, 0x2195); - mac_ocp_write(tp, 0xF8A0, 0x25BD); - mac_ocp_write(tp, 0xF8A2, 0x9BE0); - mac_ocp_write(tp, 0xF8A4, 0x1C1C); - mac_ocp_write(tp, 0xF8A6, 0x484F); - mac_ocp_write(tp, 0xF8A8, 0x9CE2); - mac_ocp_write(tp, 0xF8AA, 0x72E2); - mac_ocp_write(tp, 0xF8AC, 0x49AE); - mac_ocp_write(tp, 0xF8AE, 0xF1FE); - mac_ocp_write(tp, 0xF8B0, 0x0B00); - mac_ocp_write(tp, 0xF8B2, 0xF116); - mac_ocp_write(tp, 0xF8B4, 0xC71C); - mac_ocp_write(tp, 0xF8B6, 0xC419); - mac_ocp_write(tp, 0xF8B8, 0x9CE0); - mac_ocp_write(tp, 0xF8BA, 0x1C13); - mac_ocp_write(tp, 0xF8BC, 0x484F); - mac_ocp_write(tp, 0xF8BE, 0x9CE2); - mac_ocp_write(tp, 0xF8C0, 0x74E2); - mac_ocp_write(tp, 0xF8C2, 0x49CE); - mac_ocp_write(tp, 0xF8C4, 0xF1FE); - mac_ocp_write(tp, 0xF8C6, 0xC412); - mac_ocp_write(tp, 0xF8C8, 0x9CE0); - mac_ocp_write(tp, 0xF8CA, 0x1C13); - mac_ocp_write(tp, 0xF8CC, 0x484F); - mac_ocp_write(tp, 0xF8CE, 0x9CE2); - mac_ocp_write(tp, 0xF8D0, 0x74E2); - mac_ocp_write(tp, 0xF8D2, 0x49CE); - mac_ocp_write(tp, 0xF8D4, 0xF1FE); - mac_ocp_write(tp, 0xF8D6, 0xC70C); - mac_ocp_write(tp, 0xF8D8, 0x74F8); - mac_ocp_write(tp, 0xF8DA, 0x48C3); - mac_ocp_write(tp, 0xF8DC, 0x8CF8); - mac_ocp_write(tp, 0xF8DE, 0xB004); - mac_ocp_write(tp, 0xF8E0, 0xB007); - mac_ocp_write(tp, 0xF8E2, 0xC502); - mac_ocp_write(tp, 0xF8E4, 0xBD00); - mac_ocp_write(tp, 0xF8E6, 0x0F24); - mac_ocp_write(tp, 0xF8E8, 0x0481); - mac_ocp_write(tp, 0xF8EA, 0x0C81); - mac_ocp_write(tp, 0xF8EC, 0xDE24); - mac_ocp_write(tp, 0xF8EE, 0xE000); - mac_ocp_write(tp, 0xF8F0, 0xC602); - mac_ocp_write(tp, 0xF8F2, 0xBE00); - mac_ocp_write(tp, 0xF8F4, 0x0CA4); - mac_ocp_write(tp, 0xF8F6, 0xC502); - mac_ocp_write(tp, 0xF8F8, 0xBD00); - mac_ocp_write(tp, 0xF8FA, 0x0000); - mac_ocp_write(tp, 0xF8FC, 0xC602); - mac_ocp_write(tp, 0xF8FE, 0xBE00); - mac_ocp_write(tp, 0xF900, 0x0000); - - mac_ocp_write(tp, 0xFC26, 0x8000); - - mac_ocp_write(tp, 0xFC28, 0x00E2); - mac_ocp_write(tp, 0xFC2A, 0x0210); - mac_ocp_write(tp, 0xFC2C, 0x1A04); - mac_ocp_write(tp, 0xFC2E, 0x0B26); - mac_ocp_write(tp, 0xFC30, 0x0F02); - mac_ocp_write(tp, 0xFC32, 0x0CA0); - - mac_ocp_write(tp, 0xFC38, 0x003F); + break; } } @@ -7468,6 +8894,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_enable_cfg9346_write(tp); RTL_W8(Config5, RTL_R8(Config5) & ~BIT_0); RTL_W8(Config2, RTL_R8(Config2) & ~BIT_7); @@ -7480,6 +8908,8 @@ switch (tp->mcfg) { case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: mac_ocp_write(tp, 0xD400, mac_ocp_read( tp, 0xD400) & ~(BIT_0)); break; } @@ -7488,6 +8918,8 @@ switch (tp->mcfg) { case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: mac_ocp_write(tp, 0xE63E, mac_ocp_read( tp, 0xE63E) & ~(BIT_3 | BIT_2 | BIT_1)); mac_ocp_write(tp, 0xE63E, mac_ocp_read( tp, 0xE63E) | (BIT_0)); mac_ocp_write(tp, 0xE63E, mac_ocp_read( tp, 0xE63E) & ~(BIT_0)); @@ -7546,7 +8978,8 @@ /*disable ocp phy power saving*/ if (tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { spin_lock_irqsave(&tp->phy_lock, flags); mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0000); mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0500); @@ -7558,6 +8991,17 @@ csi_tmp |= BIT_20; rtl8168_csi_write(tp, 0x108, csi_tmp); + switch (tp->mcfg) { + case CFG_METHOD_21: + case CFG_METHOD_22: + case CFG_METHOD_23: + case CFG_METHOD_24: + csi_tmp = rtl8168_eri_read(ioaddr, 0x1AB, 1, ERIAR_ExGMAC); + csi_tmp |= ( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); + rtl8168_eri_write(ioaddr, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); + break; + } + if (s0_magic_packet == 1) rtl8168_enable_magic_packet(dev); } @@ -7601,7 +9045,7 @@ /* set EPHY registers */ rtl8168_ephy_write(ioaddr, 0x01, 0x7C7F); rtl8168_ephy_write(ioaddr, 0x02, 0x011F); - if(tp->eeprom_type != EEPROM_TYPE_NONE) { + if (tp->eeprom_type != EEPROM_TYPE_NONE) { ClearAndSetPCIePhyBit(tp, 0x03, 0xFFB0, @@ -7794,6 +9238,9 @@ rtl8168_ephy_write(ioaddr, 0x0D, 0x1666); rtl8168_ephy_write(ioaddr, 0x00, 0x10A3); rtl8168_ephy_write(ioaddr, 0x06, 0xF050); + + SetPCIePhyBit(tp, 0x04, BIT_4); + ClearPCIePhyBit(tp, 0x1D, BIT_14); } else if (tp->mcfg == CFG_METHOD_26) { ClearPCIePhyBit(tp, 0x00, BIT_3); ClearAndSetPCIePhyBit( tp, @@ -7812,6 +9259,9 @@ SetPCIePhyBit(tp, 0x00, BIT_7); SetPCIePhyBit(tp, 0x06, BIT_4); + + SetPCIePhyBit(tp, 0x04, BIT_4); + SetPCIePhyBit(tp, 0x1D, BIT_14); } else if (tp->mcfg == CFG_METHOD_23) { rtl8168_ephy_write(ioaddr, 0x00, 0x10AB); rtl8168_ephy_write(ioaddr, 0x06, 0xf030); @@ -7844,7 +9294,7 @@ rtl8168_ephy_write(ioaddr, 0x05, 0x2089); rtl8168_ephy_write(ioaddr, 0x06, 0x5881); - rtl8168_ephy_write(ioaddr, 0x04, 0x154A); + rtl8168_ephy_write(ioaddr, 0x04, 0x854A); rtl8168_ephy_write(ioaddr, 0x01, 0x068B); } } @@ -7883,6 +9333,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: mdio_write(tp, 0x1F, 0x0A43); mdio_write(tp, 0x13, 0x801E); tp->hw_ram_code_ver = mdio_read(tp, 0x14); @@ -7893,7 +9345,7 @@ break; } - 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; } @@ -7936,6 +9388,8 @@ case CFG_METHOD_26: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: mdio_write(tp, 0x1F, 0x0A43); mdio_write(tp, 0x13, 0x801E); mdio_write(tp, 0x14, tp->sw_ram_code_ver); @@ -7985,8 +9439,8 @@ WaitCnt++; } while(PhyRegValue != 0x0040 && WaitCnt <1000); - if(WaitCnt == 1000) { - retval = FALSE ; + if (WaitCnt == 1000) { + retval = FALSE; } mdio_write(tp, 0x1f, 0x0A40); @@ -8022,7 +9476,7 @@ WaitCnt++; } while(PhyRegValue != 0x0010 && WaitCnt <1000); - if(WaitCnt == 1000) { + if (WaitCnt == 1000) { retval = FALSE; } @@ -8064,14 +9518,14 @@ WaitCnt++; } while(PhyRegValue != 0x0040 && WaitCnt <1000); - if( WaitCnt == 1000) { + if ( WaitCnt == 1000) { retval = FALSE; } mdio_write(tp, 0x1f, 0x0A20); PhyRegValue = mdio_read(tp, 0x13); - if(PhyRegValue & BIT_11) { - if(PhyRegValue & BIT_10) { + if (PhyRegValue & BIT_11) { + if (PhyRegValue & BIT_10) { retval = FALSE; } } @@ -18959,6 +20413,7 @@ rtl8168_init_hw_phy_mcu(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); + u8 require_disable_phy_disable_mode = FALSE; if (tp->NotWrRamCodeToMicroP == TRUE) return; if (rtl8168_check_hw_phy_mcu_code_ver(dev)) return; @@ -18968,6 +20423,12 @@ return; } + if (HW_SUPPORT_CHECK_PHY_DISABLE_MODE(tp) && rtl8168_is_in_phy_disable_mode(dev)) + require_disable_phy_disable_mode = TRUE; + + if (require_disable_phy_disable_mode) + rtl8168_disable_phy_disable_mode(dev); + switch (tp->mcfg) { case CFG_METHOD_14: rtl8168_set_phy_mcu_8168e_1(dev); @@ -19007,6 +20468,9 @@ break; } + if (require_disable_phy_disable_mode) + rtl8168_enable_phy_disable_mode(dev); + rtl8168_write_hw_phy_mcu_code_ver(dev); mdio_write(tp,0x1F, 0x0000); @@ -19025,6 +20489,8 @@ tp->phy_reset_enable(dev); + if (HW_DASH_SUPPORT_TYPE_3(tp) && tp->HwPkgDet == 0x06) return; + spin_lock_irqsave(&tp->phy_lock, flags); rtl8168_init_hw_phy_mcu(dev); @@ -21253,7 +22719,7 @@ SetEthPhyBit( tp, 0x11, BIT_11 ); mdio_write(tp, 0x1F, 0x0000); - if(tp->RequireAdcBiasPatch) { + if (tp->RequireAdcBiasPatch) { mdio_write(tp, 0x1F, 0x0BCF); mdio_write(tp, 0x16, tp->AdcBiasPatchIoffset); mdio_write(tp, 0x1F, 0x0000); @@ -21266,7 +22732,7 @@ gphy_val = mdio_read( tp, 0x16 ); gphy_val &= 0x000F; - if( gphy_val > 3 ) { + if ( gphy_val > 3 ) { rlen = gphy_val - 3; } else { rlen = 0; @@ -21286,6 +22752,156 @@ mdio_write(tp, 0x1F, 0x0000); } } + } else if (tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { + mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x808E); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x4000 + ); + mdio_write(tp, 0x13, 0x8090); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0xCC00 + ); + mdio_write(tp, 0x13, 0x8092); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0xB000 + ); + mdio_write(tp, 0x13, 0x8088); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x8000 + ); + mdio_write(tp, 0x13, 0x808B); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x3F00 , + 0x0B00 + ); + mdio_write(tp, 0x13, 0x808D); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x1F00 , + 0x0600 + ); + mdio_write(tp, 0x13, 0x808C); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0xB000 + ); + + mdio_write(tp, 0x13, 0x80A0); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x2000 + ); + mdio_write(tp, 0x13, 0x80A2); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x5000 + ); + mdio_write(tp, 0x13, 0x809B); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xF800 , + 0xB000 + ); + mdio_write(tp, 0x13, 0x809A); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x4B00 + ); + mdio_write(tp, 0x13, 0x809D); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x3F00 , + 0x0800 + ); + mdio_write(tp, 0x13, 0x80A1); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x7000 + ); + mdio_write(tp, 0x13, 0x809F); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x1F00 , + 0x0300 + ); + mdio_write(tp, 0x13, 0x809E); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x8800 + ); + + mdio_write(tp, 0x13, 0x80B2); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x2200 + ); + mdio_write(tp, 0x13, 0x80AD); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xF800 , + 0x9800 + ); + mdio_write(tp, 0x13, 0x80AF); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x3F00 , + 0x0800 + ); + mdio_write(tp, 0x13, 0x80B3); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x6F00 + ); + mdio_write(tp, 0x13, 0x80B1); + ClearAndSetEthPhyBit( tp, + 0x14, + 0x1F00 , + 0x0300 + ); + mdio_write(tp, 0x13, 0x80B0); + ClearAndSetEthPhyBit( tp, + 0x14, + 0xFF00 , + 0x9300 + ); + mdio_write(tp, 0x1F, 0x0000); + + if (tp->HwHasWrRamCodeToMicroP) { + mdio_write(tp, 0x1F, 0x0A43); + mdio_write(tp, 0x13, 0x8011); + SetEthPhyBit(tp, 0x14, BIT_11); + mdio_write(tp, 0x1F, 0x0A42); + SetEthPhyBit(tp, 0x16, BIT_1); + } + + mdio_write(tp, 0x1F, 0x0A44); + SetEthPhyBit( tp, 0x11, BIT_11 ); + mdio_write(tp, 0x1F, 0x0000); + + if (aspm) { + if (tp->HwHasWrRamCodeToMicroP == TRUE) { + mdio_write(tp, 0x1F, 0x0A43); + SetEthPhyBit( tp, 0x10, BIT_2 ); + } + } } #ifdef ENABLE_FIBER_SUPPORT @@ -21318,7 +22934,8 @@ /*ocp phy power saving*/ if (tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || - tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { + tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { if (aspm) { mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0000); mdio_write_phy_ocp(tp, 0x0C41, 0x13, 0x0050); @@ -21347,11 +22964,8 @@ struct rtl8168_private *tp = netdev_priv(dev); struct timer_list *timer = &tp->esd_timer; - init_timer(timer); - timer->expires = jiffies + RTL8168_ESD_TIMEOUT; - timer->data = (unsigned long)(dev); - timer->function = rtl8168_esd_timer; - add_timer(timer); + setup_timer(timer, rtl8168_esd_timer, (unsigned long)dev); + mod_timer(timer, jiffies + RTL8168_ESD_TIMEOUT); } static inline void rtl8168_delete_link_timer(struct net_device *dev, struct timer_list *timer) @@ -21364,11 +22978,8 @@ struct rtl8168_private *tp = netdev_priv(dev); struct timer_list *timer = &tp->link_timer; - init_timer(timer); - timer->expires = jiffies + RTL8168_LINK_TIMEOUT; - timer->data = (unsigned long)(dev); - timer->function = rtl8168_link_timer; - add_timer(timer); + setup_timer(timer, rtl8168_link_timer, (unsigned long)dev); + mod_timer(timer, jiffies + RTL8168_LINK_TIMEOUT); } #ifdef CONFIG_NET_POLL_CONTROLLER @@ -21422,6 +23033,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: tp->bios_setting = RTL_R32(0x8c); break; } @@ -21456,6 +23069,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W32(0x8C, tp->bios_setting); break; } @@ -21480,12 +23095,27 @@ case CFG_METHOD_28: tp->HwSuppDashVer = 2; break; + case CFG_METHOD_31: + case CFG_METHOD_32: + tp->HwSuppDashVer = 3; + break; default: tp->HwSuppDashVer = 0; break; } switch (tp->mcfg) { + case CFG_METHOD_31: + case CFG_METHOD_32: + tp->HwPkgDet = mac_ocp_read(tp, 0xDC00); + tp->HwPkgDet = (tp->HwPkgDet >> 3) & 0x0F; + break; + } + + if (HW_DASH_SUPPORT_TYPE_3(tp) && tp->HwPkgDet == 0x06) + eee_enable = 0; + + switch (tp->mcfg) { case CFG_METHOD_21: case CFG_METHOD_22: case CFG_METHOD_23: @@ -21496,6 +23126,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: tp->HwSuppNowIsOobVer = 1; break; } @@ -21509,6 +23141,53 @@ else tp->DASH = 0; + if (tp->DASH) { + if (HW_DASH_SUPPORT_TYPE_3(tp)) { + u64 CmacMemPhysAddress; + void __iomem *cmac_ioaddr = NULL; + + //map CMAC IO space + CmacMemPhysAddress = rtl8168_csi_other_fun_read(tp, 0, 0x18); + if (!(CmacMemPhysAddress & BIT_0)) { + if (CmacMemPhysAddress & BIT_2) + CmacMemPhysAddress |= rtl8168_csi_other_fun_read(tp, 0, 0x1C) << 16; + + CmacMemPhysAddress &= 0xFFFFFFF0; + /* ioremap MMIO region */ + cmac_ioaddr = ioremap(CmacMemPhysAddress, R8168_REGS_SIZE); + } + + if (cmac_ioaddr == NULL) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + if (netif_msg_probe(tp)) + dev_err(&pdev->dev, "cannot remap CMAC MMIO, aborting\n"); +#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + } + + if (cmac_ioaddr == NULL) { + tp->DASH = 0; + } else { + tp->mapped_cmac_ioaddr = cmac_ioaddr; + } + } + } + +#ifdef ENABLE_DASH_SUPPORT +#ifdef ENABLE_DASH_PRINTER_SUPPORT + if (tp->DASH) { + if (HW_DASH_SUPPORT_TYPE_3(tp) && tp->HwPkgDet == 0x0F) + tp->dash_printer_enabled = 1; + else if (HW_DASH_SUPPORT_TYPE_2(tp)) + tp->dash_printer_enabled = 1; + } +#endif //ENABLE_DASH_PRINTER_SUPPORT +#endif //ENABLE_DASH_SUPPORT + + if (HW_DASH_SUPPORT_TYPE_2(tp)) + tp->cmac_ioaddr = tp->mmio_addr; + else if (HW_DASH_SUPPORT_TYPE_3(tp)) + tp->cmac_ioaddr = tp->mapped_cmac_ioaddr; + switch (tp->mcfg) { case CFG_METHOD_1: tp->intr_mask = RxDescUnavail | RxFIFOOver | TxDescUnavail | TxOK | RxOK | SWInt; @@ -21527,8 +23206,8 @@ } #ifdef ENABLE_DASH_SUPPORT - if(tp->DASH) { - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { + 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); } else { @@ -21537,9 +23216,6 @@ } } #endif - - tp->max_jumbo_frame_size = rtl_chip_info[tp->chipset].jumbo_frame_sz; - if (aspm) { switch (tp->mcfg) { case CFG_METHOD_21: @@ -21552,6 +23228,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: tp->org_pci_offset_99 = rtl8168_csi_fun0_read_byte(tp, 0x99); tp->org_pci_offset_99 &= ~(BIT_5|BIT_6); break; @@ -21566,6 +23244,10 @@ case CFG_METHOD_30: tp->org_pci_offset_180 = rtl8168_csi_fun0_read_byte(tp, 0x180); break; + case CFG_METHOD_31: + case CFG_METHOD_32: + tp->org_pci_offset_180 = rtl8168_csi_fun0_read_byte(tp, 0x214); + break; } } @@ -21631,7 +23313,7 @@ ioffset_p0 <<= 3; ioffset_p0 |= (TmpUshort & (BIT_2| BIT_1 | BIT_0)); - if((ioffset_p3 == 0x0F) && (ioffset_p2 == 0x0F) && (ioffset_p1 == 0x0F) && (ioffset_p0 == 0x0F)) { + if ((ioffset_p3 == 0x0F) && (ioffset_p2 == 0x0F) && (ioffset_p1 == 0x0F) && (ioffset_p0 == 0x0F)) { tp->RequireAdcBiasPatch = FALSE; } else { tp->RequireAdcBiasPatch = TRUE; @@ -21643,7 +23325,9 @@ switch (tp->mcfg) { case CFG_METHOD_29: - case CFG_METHOD_30: { + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: { u16 rg_saw_cnt; mdio_write(tp, 0x1F, 0x0C42); @@ -21662,16 +23346,20 @@ } #ifdef ENABLE_FIBER_SUPPORT - if(pdev->subsystem_vendor == 0x1170) { - if(pdev->subsystem_device == 0x0612) { - switch(tp->mcfg) { - case CFG_METHOD_29: - case CFG_METHOD_30: - tp->HwFiberModeVer = FIBER_MODE_RTL8168H_RTL8211FS; - break; - } - } + switch(tp->mcfg) { + case CFG_METHOD_29: + case CFG_METHOD_30: + if ((pdev->subsystem_vendor == 0x1170 && pdev->subsystem_device == 0x0612) || + (pdev->subsystem_vendor == 0x1028 && pdev->subsystem_device == 0x080C)) + tp->HwFiberModeVer = FIBER_MODE_RTL8168H_RTL8211FS; + break; } + + if (HW_FIBER_MODE_ENABLED(tp)) + tp->HwFiberStat = rtl8168_hw_fiber_get_connect_status(dev); + + if (tp->HwFiberStat != FIBER_STAT_CONNECT) + tp->HwFiberModeVer = FIBER_MODE_NIC_ONLY; #endif //ENABLE_FIBER_SUPPORT if (pdev->subsystem_vendor == 0x144d) { @@ -21696,9 +23384,8 @@ } } #ifdef ENABLE_FIBER_SUPPORT - if (tp->HwFiberModeVer == FIBER_MODE_RTL8168H_RTL8211FS) { + if (tp->HwFiberModeVer == FIBER_MODE_RTL8168H_RTL8211FS) tp->RequiredSecLanDonglePatch = TRUE; - } #endif //ENABLE_FIBER_SUPPORT switch (tp->mcfg) { @@ -21716,6 +23403,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: tp->HwSuppMagicPktVer = WAKEUP_MAGIC_PACKET_V2; break; case CFG_METHOD_DEFAULT: @@ -21727,6 +23416,31 @@ } switch (tp->mcfg) { + case CFG_METHOD_16: + case CFG_METHOD_17: + tp->HwSuppCheckPhyDisableModeVer = 1; + break; + case CFG_METHOD_18: + case CFG_METHOD_19: + case CFG_METHOD_21: + case CFG_METHOD_22: + case CFG_METHOD_24: + case CFG_METHOD_25: + case CFG_METHOD_26: + case CFG_METHOD_29: + case CFG_METHOD_30: + tp->HwSuppCheckPhyDisableModeVer = 2; + break; + case CFG_METHOD_23: + case CFG_METHOD_27: + case CFG_METHOD_28: + case CFG_METHOD_31: + case CFG_METHOD_32: + tp->HwSuppCheckPhyDisableModeVer = 3; + break; + } + + switch (tp->mcfg) { case CFG_METHOD_14: case CFG_METHOD_15: tp->sw_ram_code_ver = NIC_RAMCODE_VERSION_CFG_METHOD_14; @@ -21764,6 +23478,10 @@ case CFG_METHOD_30: tp->sw_ram_code_ver = NIC_RAMCODE_VERSION_CFG_METHOD_29; break; + case CFG_METHOD_31: + case CFG_METHOD_32: + tp->sw_ram_code_ver = NIC_RAMCODE_VERSION_CFG_METHOD_31; + break; } if (tp->HwIcVerUnknown) { @@ -21773,11 +23491,18 @@ rtl8168_get_hw_wol(dev); - rtl8168_link_option((u8*)&autoneg, (u16*)&speed, (u8*)&duplex); + rtl8168_link_option((u8*)&autoneg_mode, (u16*)&speed_mode, (u8*)&duplex_mode); - tp->autoneg = autoneg; - tp->speed = speed; - tp->duplex = duplex; + tp->autoneg = autoneg_mode; + tp->speed = speed_mode; + tp->duplex = duplex_mode; + + tp->max_jumbo_frame_size = rtl_chip_info[tp->chipset].jumbo_frame_sz; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) + /* MTU range: 60 - hw-specific max */ + dev->min_mtu = ETH_ZLEN; + dev->max_mtu = tp->max_jumbo_frame_size; +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) } static void @@ -21791,14 +23516,17 @@ rtl8168_rar_set(tp, tp->org_mac_addr); tp->wol_enabled = WOL_DISABLED; - if(!tp->DASH) + if (!tp->DASH) rtl8168_phy_power_down(dev); #ifdef ENABLE_DASH_SUPPORT - if(tp->DASH) + if (tp->DASH) FreeAllocatedDashShareMemory(dev); #endif + if (tp->mapped_cmac_ioaddr != NULL) + iounmap(tp->mapped_cmac_ioaddr); + iounmap(ioaddr); pci_release_regions(pdev); pci_disable_device(pdev); @@ -21811,7 +23539,10 @@ struct rtl8168_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; int i; + u8 mac_addr[MAC_ADDR_LEN]; + for (i = 0; i < MAC_ADDR_LEN; i++) + mac_addr[i] = RTL_R8(MAC0 + i); if (tp->mcfg == CFG_METHOD_18 || tp->mcfg == CFG_METHOD_19 || @@ -21825,18 +23556,14 @@ tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || tp->mcfg == CFG_METHOD_29 || - tp->mcfg == CFG_METHOD_30) { - u16 mac_addr[3]; - + tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || + tp->mcfg == CFG_METHOD_32) { *(u32*)&mac_addr[0] = rtl8168_eri_read(ioaddr, 0xE0, 4, ERIAR_ExGMAC); - *(u16*)&mac_addr[2] = rtl8168_eri_read(ioaddr, 0xE4, 2, ERIAR_ExGMAC); - - if (is_valid_ether_addr((u8*)mac_addr)) - rtl8168_rar_set(tp, (uint8_t*)mac_addr); + *(u16*)&mac_addr[4] = rtl8168_eri_read(ioaddr, 0xE4, 2, ERIAR_ExGMAC); } else { if (tp->eeprom_type != EEPROM_TYPE_NONE) { - u16 mac_addr[3]; - + u16 *pUshort = (u16*)mac_addr; /* Get MAC address from EEPROM */ if (tp->mcfg == CFG_METHOD_16 || tp->mcfg == CFG_METHOD_17 || @@ -21852,21 +23579,32 @@ tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28 || tp->mcfg == CFG_METHOD_29 || - tp->mcfg == CFG_METHOD_30) { - mac_addr[0] = rtl_eeprom_read_sc(tp, 1); - mac_addr[1] = rtl_eeprom_read_sc(tp, 2); - mac_addr[2] = rtl_eeprom_read_sc(tp, 3); + tp->mcfg == CFG_METHOD_30 || + tp->mcfg == CFG_METHOD_31 || + tp->mcfg == CFG_METHOD_32) { + *pUshort++ = rtl_eeprom_read_sc(tp, 1); + *pUshort++ = rtl_eeprom_read_sc(tp, 2); + *pUshort = rtl_eeprom_read_sc(tp, 3); } else { - mac_addr[0] = rtl_eeprom_read_sc(tp, 7); - mac_addr[1] = rtl_eeprom_read_sc(tp, 8); - mac_addr[2] = rtl_eeprom_read_sc(tp, 9); + *pUshort++ = rtl_eeprom_read_sc(tp, 7); + *pUshort++ = rtl_eeprom_read_sc(tp, 8); + *pUshort = rtl_eeprom_read_sc(tp, 9); } - - if (is_valid_ether_addr((u8*)mac_addr)) - rtl8168_rar_set(tp, (uint8_t*)mac_addr); } } + if (!is_valid_ether_addr(mac_addr)) { + netif_err(tp, probe, dev, "Invalid ether addr %pM\n", + mac_addr); + eth_hw_addr_random(dev); + ether_addr_copy(mac_addr, dev->dev_addr); + netif_info(tp, probe, dev, "Random ether addr %pM\n", + mac_addr); + tp->random_mac = 1; + } + + rtl8168_rar_set(tp, mac_addr); + for (i = 0; i < MAC_ADDR_LEN; i++) { dev->dev_addr[i] = RTL_R8(MAC0 + i); tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */ @@ -22662,6 +24400,10 @@ ret = -ENODEV; break; } + if (!capable(CAP_NET_ADMIN)) { + ret = -EPERM; + break; + } ret = rtl8168_dash_ioctl(dev, ifr); break; @@ -22694,11 +24436,15 @@ rtl8168_phy_power_up(struct net_device *dev) { struct rtl8168_private *tp = netdev_priv(dev); - void __iomem *ioaddr = tp->mmio_addr; - u32 csi_tmp; unsigned long flags; spin_lock_irqsave(&tp->phy_lock, flags); + + if (rtl8168_is_in_phy_disable_mode(dev)) { + spin_unlock_irqrestore(&tp->phy_lock, flags); + return; + } + mdio_write(tp, 0x1F, 0x0000); switch (tp->mcfg) { case CFG_METHOD_1: @@ -22716,16 +24462,6 @@ case CFG_METHOD_13: mdio_write(tp, 0x0E, 0x0000); break; - case CFG_METHOD_21: - case CFG_METHOD_22: - case CFG_METHOD_23: - case CFG_METHOD_24: - csi_tmp = rtl8168_eri_read(ioaddr, 0x1AB, 1, ERIAR_ExGMAC); - csi_tmp |= ( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); - rtl8168_eri_write(ioaddr, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); - break; - default: - break; } mdio_write(tp, MII_BMCR, BMCR_ANENABLE); @@ -22742,6 +24478,8 @@ switch (tp->mcfg) { case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: rtl8168_wait_phy_ups_resume(dev, 3); break; }; @@ -22757,6 +24495,18 @@ unsigned long flags; spin_lock_irqsave(&tp->phy_lock, flags); + + switch (tp->mcfg) { + case CFG_METHOD_21: + case CFG_METHOD_22: + case CFG_METHOD_23: + case CFG_METHOD_24: + csi_tmp = rtl8168_eri_read(ioaddr, 0x1AB, 1, ERIAR_ExGMAC); + csi_tmp &= ~( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); + rtl8168_eri_write(ioaddr, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); + break; + } + mdio_write(tp, 0x1F, 0x0000); switch (tp->mcfg) { case CFG_METHOD_1: @@ -22784,20 +24534,11 @@ case CFG_METHOD_21: case CFG_METHOD_22: mdio_write(tp, MII_BMCR, BMCR_ANENABLE | BMCR_PDOWN); - - csi_tmp = rtl8168_eri_read(ioaddr, 0x1AB, 1, ERIAR_ExGMAC); - csi_tmp &= ~( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); - rtl8168_eri_write(ioaddr, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); - RTL_W8(0xD0, RTL_R8(0xD0) & ~BIT_6); break; case CFG_METHOD_23: case CFG_METHOD_24: mdio_write(tp, MII_BMCR, BMCR_ANENABLE | BMCR_PDOWN); - - csi_tmp = rtl8168_eri_read(ioaddr, 0x1AB, 1, ERIAR_ExGMAC); - csi_tmp &= ~( BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7 ); - rtl8168_eri_write(ioaddr, 0x1AB, 1, csi_tmp, ERIAR_ExGMAC); break; default: mdio_write(tp, MII_BMCR, BMCR_PDOWN); @@ -23304,7 +25045,7 @@ rtl8168_init_software_variable(dev); #ifdef ENABLE_DASH_SUPPORT - if(tp->DASH) + if (tp->DASH) AllocateDashShareMemory(dev); #endif @@ -23328,6 +25069,12 @@ rtl8168_get_mac_address(dev); +#if defined(ENABLE_DASH_PRINTER_SUPPORT) + init_completion(&tp->fw_host_ok); + init_completion(&tp->fw_ack); + init_completion(&tp->fw_req); +#endif + tp->tally_vaddr = pci_alloc_consistent(pdev, sizeof(*tp->tally_vaddr), &tp->tally_paddr); if (!tp->tally_vaddr) { rc = -ENOMEM; @@ -23344,6 +25091,8 @@ printk(KERN_INFO "%s: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.\n", MODULENAME); + device_set_wakeup_enable(&pdev->dev, tp->wol_enabled); + netif_carrier_off(dev); printk("%s", GPL_CLAIM); @@ -23379,18 +25128,8 @@ #ifdef CONFIG_R8168_NAPI RTL_NAPI_DEL(tp); #endif - - switch (tp->mcfg) { - case CFG_METHOD_11: - case CFG_METHOD_12: - case CFG_METHOD_13: - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - if (tp->DASH) - rtl8168_driver_stop(tp); - break; - } + if (tp->DASH) + rtl8168_driver_stop(tp); unregister_netdev(dev); rtl8168_disable_msi(pdev, tp); @@ -23728,6 +25467,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(0xF1, RTL_R8(0xF1) & ~BIT_7); RTL_W8(Config2, RTL_R8(Config2) & ~BIT_7); RTL_W8(Config5, RTL_R8(Config5) & ~BIT_0); @@ -23747,6 +25488,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: RTL_W8(Config3, RTL_R8(Config3) & ~BIT_1); break; } @@ -23951,7 +25694,7 @@ /* disable clock request. */ pci_write_config_byte(pdev, 0x81, 0x00); } else if (tp->mcfg == CFG_METHOD_11 || tp->mcfg == CFG_METHOD_13) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); if (dev->mtu > ETH_DATA_LEN) @@ -23964,7 +25707,7 @@ RTL_W8(Config1, RTL_R8(Config1) | 0x10); } else if (tp->mcfg == CFG_METHOD_12) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); if (dev->mtu > ETH_DATA_LEN) @@ -24010,15 +25753,16 @@ RTL_W8(Config1, RTL_R8(Config1) & ~0x10); } else if (tp->mcfg == CFG_METHOD_16 || tp->mcfg == CFG_METHOD_17) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); - csi_tmp = rtl8168_eri_read(ioaddr, 0xD5, 1, ERIAR_ExGMAC) | BIT_3 | BIT_2; - rtl8168_eri_write(ioaddr, 0xD5, 1, csi_tmp, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xC0, 2, 0x0000, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xB8, 4, 0x00000000, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xC8, 4, 0x00100002, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xE8, 4, 0x00100006, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0xD4, 4, ERIAR_ExGMAC); + csi_tmp |= (BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12); + rtl8168_eri_write(ioaddr, 0xD4, 4, csi_tmp, ERIAR_ExGMAC); csi_tmp = rtl8168_eri_read(ioaddr, 0x1D0, 4, ERIAR_ExGMAC); csi_tmp |= BIT_1; rtl8168_eri_write(ioaddr, 0x1D0, 1, csi_tmp, ERIAR_ExGMAC); @@ -24059,7 +25803,7 @@ pci_write_config_byte(pdev, 0x81, 0x00); } else if (tp->mcfg == CFG_METHOD_18 || tp->mcfg == CFG_METHOD_19) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); rtl8168_eri_write(ioaddr, 0xC8, 4, 0x00100002, ERIAR_ExGMAC); @@ -24085,9 +25829,9 @@ rtl8168_eri_write(ioaddr, 0xC0, 2, 0x0000, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xB8, 4, 0x00000000, ERIAR_ExGMAC); - csi_tmp = rtl8168_eri_read(ioaddr, 0xD5, 1, ERIAR_ExGMAC); - csi_tmp |= BIT_3 | BIT_2; - rtl8168_eri_write(ioaddr, 0xD5, 1, csi_tmp, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0xD4, 4, ERIAR_ExGMAC); + csi_tmp |= (BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12); + rtl8168_eri_write(ioaddr, 0xD4, 4, csi_tmp, ERIAR_ExGMAC); RTL_W8(0x1B,RTL_R8(0x1B) & ~0x07); csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 1, ERIAR_ExGMAC); @@ -24099,7 +25843,7 @@ rtl8168_eri_write(ioaddr, 0xCC, 4, 0x00000050, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xd0, 4, 0x00000060, ERIAR_ExGMAC); } else if (tp->mcfg == CFG_METHOD_20) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); rtl8168_eri_write(ioaddr, 0xC8, 4, 0x00100002, ERIAR_ExGMAC); @@ -24124,9 +25868,9 @@ RTL_W8(0xF2, RTL_R8(0xF2) | BIT_6); rtl8168_eri_write(ioaddr, 0xC0, 2, 0x0000, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xB8, 4, 0x00000000, ERIAR_ExGMAC); - csi_tmp = rtl8168_eri_read(ioaddr, 0xD5, 1, ERIAR_ExGMAC); - csi_tmp |= BIT_3 | BIT_2; - rtl8168_eri_write(ioaddr, 0xD5, 1, csi_tmp, ERIAR_ExGMAC); + csi_tmp = rtl8168_eri_read(ioaddr, 0xD4, 4, ERIAR_ExGMAC); + csi_tmp |= BIT_10 | BIT_11; + rtl8168_eri_write(ioaddr, 0xD4, 4, csi_tmp, ERIAR_ExGMAC); csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 1, ERIAR_ExGMAC); csi_tmp |= BIT_4; @@ -24140,7 +25884,7 @@ tp->mcfg == CFG_METHOD_24 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_26 || tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); if (tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22) set_offset711(tp, 0x04); @@ -24171,10 +25915,10 @@ mac_ocp_write(tp, 0xD3C4, mac_ocp_data); } else if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { - if(tp->RequireAdjustUpsTxLinkPulseTiming) { + if (tp->RequireAdjustUpsTxLinkPulseTiming) { mac_ocp_data = mac_ocp_read(tp, 0xD412); mac_ocp_data &= ~(0x0FFF); - mac_ocp_data |= tp->SwrCnt1msIni ; + mac_ocp_data |= tp->SwrCnt1msIni; mac_ocp_write(tp, 0xD412, mac_ocp_data); } @@ -24222,6 +25966,9 @@ rtl8168_eri_write(ioaddr, 0xC0, 2, 0x0000, ERIAR_ExGMAC); rtl8168_eri_write(ioaddr, 0xB8, 4, 0x00000000, ERIAR_ExGMAC); + if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) + mac_ocp_write(tp, 0xE054, 0xFC01); + rtl8168_eri_write(ioaddr, 0x5F0, 2, 0x4F87, ERIAR_ExGMAC); if (tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_30) { @@ -24266,7 +26013,7 @@ rtl8168_eri_write(ioaddr, 0x1D0, 1, csi_tmp, ERIAR_ExGMAC); } else if (tp->mcfg == CFG_METHOD_23 || tp->mcfg == CFG_METHOD_27 || tp->mcfg == CFG_METHOD_28) { - set_offset70F(tp, 0x17); + set_offset70F(tp, 0x27); set_offset79(tp, 0x50); rtl8168_eri_write(ioaddr, 0xC8, 4, 0x00080002, ERIAR_ExGMAC); @@ -24341,6 +26088,119 @@ mac_ocp_data |= BIT_7; mac_ocp_write(tp, 0xE860, mac_ocp_data); } + + rtl8168_csi_set_dash_other_fun(tp, 0x04, 0x00, (BIT_0 | BIT_1 | BIT_2), FALSE); + rtl8168_csi_set_dash_other_fun(tp, 0x80, 0x00, (BIT_0 | BIT_1 | BIT_8), FALSE); + rtl8168_csi_set_dash_other_fun(tp, 0x44, 0x00, (BIT_0 | BIT_1), FALSE); + } else if (tp->mcfg == CFG_METHOD_31 || tp->mcfg == CFG_METHOD_32) { + set_offset70F(tp, 0x27); + set_offset79(tp, 0x50); + + rtl8168_eri_write(ioaddr, 0xC8, 4, 0x00080002, ERIAR_ExGMAC); + rtl8168_eri_write(ioaddr, 0xCC, 1, 0x2F, ERIAR_ExGMAC); + rtl8168_eri_write(ioaddr, 0xD0, 1, 0x5F, ERIAR_ExGMAC); + rtl8168_eri_write(ioaddr, 0xE8, 4, 0x00100006, ERIAR_ExGMAC); + + RTL_W32(TxConfig, RTL_R32(TxConfig) | BIT_7); + + csi_tmp = rtl8168_eri_read(ioaddr, 0xDC, 1, ERIAR_ExGMAC); + csi_tmp &= ~BIT_0; + rtl8168_eri_write(ioaddr, 0xDC, 1, csi_tmp, ERIAR_ExGMAC); + csi_tmp |= BIT_0; + rtl8168_eri_write(ioaddr, 0xDC, 1, csi_tmp, ERIAR_ExGMAC); + + if (tp->RequireAdjustUpsTxLinkPulseTiming) { + mac_ocp_data = mac_ocp_read(tp, 0xD412); + mac_ocp_data &= ~(0x0FFF); + mac_ocp_data |= tp->SwrCnt1msIni; + mac_ocp_write(tp, 0xD412, mac_ocp_data); + } + + mac_ocp_data = mac_ocp_read(tp, 0xE056); + mac_ocp_data &= ~(BIT_7 | BIT_6 | BIT_5 | BIT_4); + mac_ocp_data |= (BIT_6 | BIT_5 | BIT_4); + mac_ocp_write(tp, 0xE056, mac_ocp_data); + mac_ocp_write(tp, 0xEA80, 0x0003); + + OOB_mutex_lock(tp); + mac_ocp_data = mac_ocp_read(tp, 0xE052); + if (tp->mcfg == CFG_METHOD_32) + mac_ocp_data |= BIT_3; + else + mac_ocp_data &= ~BIT_3; + mac_ocp_write(tp, 0xE052, mac_ocp_data); + OOB_mutex_unlock(tp); + + mac_ocp_data = mac_ocp_read(tp, 0xD420); + mac_ocp_data &= ~(BIT_11 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0); + mac_ocp_data |= 0x47F; + mac_ocp_write(tp, 0xD420, mac_ocp_data); + + RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); + + RTL_W8(0x1B, RTL_R8(0x1B) & ~0x07); + + RTL_W8(TDFNR, 0x4); + + RTL_W8(Config2, RTL_R8(Config2) & ~PMSTS_En); + + if (aspm) + RTL_W8(0xF1, RTL_R8(0xF1) | BIT_7); + + if (dev->mtu > ETH_DATA_LEN) + RTL_W8(MTPS, 0x27); + + RTL_W8(0xD0, RTL_R8(0xD0) | BIT_6); + RTL_W8(0xF2, RTL_R8(0xF2) | BIT_6); + + RTL_W8(0xD0, RTL_R8(0xD0) | BIT_7); + + rtl8168_eri_write(ioaddr, 0xC0, 2, 0x0000, ERIAR_ExGMAC); + rtl8168_eri_write(ioaddr, 0xB8, 4, 0x00000000, ERIAR_ExGMAC); + + mac_ocp_write(tp, 0xE054, 0xFC01); + + OOB_mutex_lock(tp); + csi_tmp = rtl8168_eri_read(ioaddr, 0x5F0, 4, ERIAR_ExGMAC); + csi_tmp |= (BIT_8 | BIT_9 | BIT_10 | BIT_11); + rtl8168_eri_write(ioaddr, 0x5F0, 4, csi_tmp, ERIAR_ExGMAC); + OOB_mutex_unlock(tp); + + csi_tmp = rtl8168_eri_read(ioaddr, 0xD4, 4, ERIAR_ExGMAC); + csi_tmp |= (BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12); + rtl8168_eri_write(ioaddr, 0xD4, 4, csi_tmp, ERIAR_ExGMAC); + + mac_ocp_write(tp, 0xC140, 0xFFFF); + mac_ocp_write(tp, 0xC142, 0xFFFF); + + csi_tmp = rtl8168_eri_read(ioaddr, 0x1B0, 4, ERIAR_ExGMAC); + csi_tmp &= ~BIT_12; + rtl8168_eri_write(ioaddr, 0x1B0, 4, csi_tmp, ERIAR_ExGMAC); + + csi_tmp = rtl8168_eri_read(ioaddr, 0x2FC, 1, ERIAR_ExGMAC); + csi_tmp &= ~(BIT_0 | BIT_1 | BIT_2); + csi_tmp |= BIT_0; + rtl8168_eri_write(ioaddr, 0x2FC, 1, csi_tmp, ERIAR_ExGMAC); + + csi_tmp = rtl8168_eri_read(ioaddr, 0x1D0, 1, ERIAR_ExGMAC); + csi_tmp &= ~BIT_1; + rtl8168_eri_write(ioaddr, 0x1D0, 1, csi_tmp, ERIAR_ExGMAC); + + mac_ocp_data = mac_ocp_read(tp, 0xD3E2); + mac_ocp_data &= 0xF000; + mac_ocp_data |= 0x3A9; + mac_ocp_write(tp, 0xD3E2, mac_ocp_data); + + mac_ocp_data = mac_ocp_read(tp, 0xD3E4); + mac_ocp_data &= 0xFF00; + mac_ocp_write(tp, 0xD3E4, mac_ocp_data); + + mac_ocp_data = mac_ocp_read(tp, 0xE860); + mac_ocp_data |= BIT_7; + mac_ocp_write(tp, 0xE860, mac_ocp_data); + + rtl8168_csi_set_dash_other_fun(tp, 0x80, 0x00, (BIT_0 | BIT_1 | BIT_8), FALSE); + rtl8168_csi_set_dash_other_fun(tp, 0x44, 0x00, (BIT_0 | BIT_1), FALSE); } else if (tp->mcfg == CFG_METHOD_1) { RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); @@ -24447,6 +26307,10 @@ case CFG_METHOD_30: mac_ocp_write(tp, 0xE098, 0x0AA2); break; + case CFG_METHOD_31: + case CFG_METHOD_32: + mac_ocp_write(tp, 0xE098, mac_ocp_read(tp, 0xE098) | (0x64 << 4)); + break; } switch (tp->mcfg) { @@ -24460,6 +26324,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: if (aspm) { rtl8168_init_pci_offset_99(tp); } @@ -24473,6 +26339,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: if (aspm) { rtl8168_init_pci_offset_180(tp); } @@ -24504,7 +26372,9 @@ case CFG_METHOD_27: case CFG_METHOD_28: case CFG_METHOD_29: - case CFG_METHOD_30: { + case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: { int timeout; for (timeout = 0; timeout < 10; timeout++) { if ((rtl8168_eri_read(ioaddr, 0x1AE, 2, ERIAR_ExGMAC) & BIT_13)==0) @@ -24549,7 +26419,7 @@ rtl8168_hw_set_rx_packet_filter(dev); #ifdef ENABLE_DASH_SUPPORT - if (tp->DASH) + if (tp->DASH && !tp->dash_printer_enabled) NICChkTypeEnableDashInterrupt(tp); #endif @@ -24571,6 +26441,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: if (aspm) { RTL_W8(Config5, RTL_R8(Config5) | BIT_0); RTL_W8(Config2, RTL_R8(Config2) | BIT_7); @@ -24592,8 +26464,6 @@ struct rtl8168_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; - rtl8168_hw_config(dev); - RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); rtl8168_enable_hw_interrupt(tp, ioaddr); @@ -24605,19 +26475,19 @@ int new_mtu) { struct rtl8168_private *tp = netdev_priv(dev); - int max_mtu; int ret = 0; unsigned long flags; - if (tp->mcfg == CFG_METHOD_DEFAULT) - max_mtu = ETH_DATA_LEN; - else - max_mtu = tp->max_jumbo_frame_size - ETH_HLEN - 8; - +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) if (new_mtu < ETH_ZLEN) return -EINVAL; - else if (new_mtu > max_mtu) - new_mtu = max_mtu; + else if (new_mtu > tp->max_jumbo_frame_size) + new_mtu = tp->max_jumbo_frame_size; +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) + + spin_lock_irqsave(&tp->lock, flags); + dev->mtu = new_mtu; + spin_unlock_irqrestore(&tp->lock, flags); if (!netif_running(dev)) goto out; @@ -24626,15 +26496,13 @@ spin_lock_irqsave(&tp->lock, flags); - dev->mtu = new_mtu; - rtl8168_set_rxbufsize(tp, dev); ret = rtl8168_init_ring(dev); if (ret < 0) { spin_unlock_irqrestore(&tp->lock, flags); - goto out; + goto err_out; } #ifdef CONFIG_R8168_NAPI @@ -24647,14 +26515,17 @@ netif_carrier_off(dev); rtl8168_hw_config(dev); spin_unlock_irqrestore(&tp->lock, flags); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) - netdev_update_features(dev); -#endif + rtl8168_set_speed(dev, tp->autoneg, tp->speed, tp->duplex); mod_timer(&tp->esd_timer, jiffies + RTL8168_ESD_TIMEOUT); mod_timer(&tp->link_timer, jiffies + RTL8168_LINK_TIMEOUT); out: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) + netdev_update_features(dev); +#endif + +err_out: return ret; } @@ -25477,6 +27348,7 @@ out: return ret; err_dma_1: + tp->tx_skb[entry].skb = NULL; rtl8168_tx_clear_range(tp, tp->cur_tx + 1, frags); err_dma_0: RTLDEV->stats.tx_dropped++; @@ -25527,7 +27399,11 @@ tp->TxDescArray + entry); if (tx_skb->skb!=NULL) { - dev_kfree_skb_irq(tx_skb->skb); +#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 tx_skb->skb = NULL; } dirty_tx++; @@ -25731,8 +27607,9 @@ if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) rtl8168_rx_skb(tp, skb); - +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) dev->last_rx = jiffies; +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) RTLDEV->stats.rx_bytes += pkt_size; RTLDEV->stats.rx_packets++; } @@ -25786,7 +27663,7 @@ do { status = RTL_R16(IntrStatus); - if(!(tp->features & RTL_FEATURE_MSI)) { + if (!(tp->features & RTL_FEATURE_MSI)) { /* hotplug/major error/no more work/shared irq */ if ((status == 0xFFFF) || !status) break; @@ -25822,6 +27699,8 @@ case CFG_METHOD_28: case CFG_METHOD_29: case CFG_METHOD_30: + case CFG_METHOD_31: + case CFG_METHOD_32: /* RX_OVERFLOW RE-START mechanism now HW handles it automatically*/ RTL_W16(IntrStatus, status&~RxFIFOOver); break; @@ -25839,6 +27718,7 @@ rtl8168_tx_clear(tp); rtl8168_rx_clear(tp); rtl8168_init_ring(dev); + rtl8168_hw_config(dev); rtl8168_hw_start(dev); netif_wake_queue(dev); } @@ -25846,21 +27726,24 @@ #ifdef ENABLE_DASH_SUPPORT if ( tp->DASH ) { - if( HW_DASH_SUPPORT_TYPE_2( tp ) ) { + if (HW_DASH_SUPPORT_TYPE_2(tp) || HW_DASH_SUPPORT_TYPE_3(tp)) { u8 DashIntType2Status; - DashIntType2Status = RTL_R8(IBISR0); + if (status & ISRIMR_DASH_INTR_CMAC_RESET) + tp->CmacResetIntr = TRUE; + + DashIntType2Status = RTL_CMAC_R8(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) { + if (DashIntType2Status & ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE) { tp->DashFwDisableRx = TRUE; } - RTL_W8(IBISR0, DashIntType2Status); + RTL_CMAC_W8(CMAC_IBISR0, DashIntType2Status); } else { if (IntrStatus & ISRIMR_DP_REQSYS_OK) { tp->RcvFwReqSysOkEvt = TRUE; @@ -25876,8 +27759,9 @@ #endif #ifdef CONFIG_R8168_NAPI - if (status & tp->intr_mask || tp->keep_intr_cnt > 0) { - if (tp->keep_intr_cnt > 0) tp->keep_intr_cnt--; + if (status & tp->intr_mask || tp->keep_intr_cnt-- > 0) { + if (status & tp->intr_mask) + tp->keep_intr_cnt = RTK_KEEP_INTERRUPT_COUNT; if (likely(RTL_NETIF_RX_SCHEDULE_PREP(dev, &tp->napi))) __RTL_NETIF_RX_SCHEDULE(dev, &tp->napi); @@ -25889,10 +27773,11 @@ rtl8168_switch_to_hw_interrupt(tp, ioaddr); } #else - if (status & tp->intr_mask || tp->keep_intr_cnt > 0) { + if (status & tp->intr_mask || tp->keep_intr_cnt-- > 0) { u32 budget = ~(u32)0; - if (tp->keep_intr_cnt > 0) tp->keep_intr_cnt--; + if (status & tp->intr_mask) + tp->keep_intr_cnt = RTK_KEEP_INTERRUPT_COUNT; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) rtl8168_rx_interrupt(dev, tp, tp->mmio_addr, &budget); #else @@ -25949,7 +27834,11 @@ } #endif - RTL_NETIF_RX_COMPLETE(dev, napi); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) + if (RTL_NETIF_RX_COMPLETE(dev, napi, work_done) == FALSE) return RTL_NAPI_RETURN_VALUE; +#else + RTL_NETIF_RX_COMPLETE(dev, napi, work_done); +#endif /* * 20040426: the barrier is not strictly required but the * behavior of the irq handler could be less predictable @@ -25990,13 +27879,10 @@ rtl8168_delete_link_timer(dev, &tp->link_timer); #ifdef CONFIG_R8168_NAPI -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23) - napi_disable(&tp->napi); -#endif -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)) - netif_poll_disable(dev); -#endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + RTL_NAPI_DISABLE(dev, &tp->napi); #endif +#endif//CONFIG_R8168_NAPI netif_stop_queue(dev); @@ -26067,20 +27953,12 @@ struct net_device *dev = pci_get_drvdata(pdev); struct rtl8168_private *tp = netdev_priv(dev); - switch (tp->mcfg) { - case CFG_METHOD_11: - case CFG_METHOD_12: - case CFG_METHOD_13: - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - if (tp->DASH) - rtl8168_driver_stop(tp); - break; - } + if (tp->DASH) + rtl8168_driver_stop(tp); rtl8168_set_bios_setting(dev); - rtl8168_rar_set(tp, tp->org_mac_addr); + if (s5_keep_curr_mac == 0 && tp->random_mac == 0) + rtl8168_rar_set(tp, tp->org_mac_addr); #ifdef ENABLE_REALWOW_SUPPORT set_realwow_d3_para(dev); @@ -26164,18 +28042,8 @@ spin_unlock_irqrestore(&tp->lock, flags); - switch (tp->mcfg) { - case CFG_METHOD_11: - case CFG_METHOD_12: - case CFG_METHOD_13: - case CFG_METHOD_23: - case CFG_METHOD_27: - case CFG_METHOD_28: - if (tp->DASH) - rtl8168_driver_stop(tp); - break; - } - + if (tp->DASH) + rtl8168_driver_stop(tp); out: #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
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
.