From d367f1d4b748ecb58d12411215211527465f4d76 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Mon, 4 Nov 2024 11:48:48 +0100 Subject: [PATCH] Import version 2.19.2 --- compatibility.h | 3 + r8152.c | 2295 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 1870 insertions(+), 428 deletions(-) diff --git a/compatibility.h b/compatibility.h index b33c894..370cb34 100644 --- a/compatibility.h +++ b/compatibility.h @@ -21,6 +21,8 @@ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,9,0) + #define ethtool_keee ethtool_eee #if LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0) #define TSO_LEGACY_MAX_SIZE 65536 #define netif_napi_add_weight netif_napi_add @@ -637,6 +639,7 @@ } #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0) */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0) */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6,9,0) */ #ifndef FALSE #define TRUE 1 diff --git a/r8152.c b/r8152.c index ad96dd0..b0811f9 100644 --- a/r8152.c +++ b/r8152.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,7 @@ /* Version Information */ #define DRIVER_SUFFIX -#define DRIVER_VERSION "v2.18.1"DRIVER_SUFFIX" (2024/05/20)" +#define DRIVER_VERSION "v2.19.2"DRIVER_SUFFIX" (2024/10/21)" #define DRIVER_AUTHOR "Realtek nic sw " #define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" #define MODULENAME "r8152" @@ -234,8 +235,10 @@ #define OCP_SRAM_DATA 0xa438 #define OCP_DOWN_SPEED 0xa442 #define OCP_EEE_ABLE 0xa5c4 +#define OCP_EEE_ABLE2 0xa6ec #define OCP_EEE_ADV 0xa5d0 #define OCP_EEE_LPABLE 0xa5d2 +#define OCP_EEE_LPABLE2 0xa6d0 #define OCP_10GBT_CTRL 0xa5d4 #define OCP_10GBT_STAT 0xa5d6 #define OCP_EEE_ADV2 0xa6d4 @@ -825,6 +828,7 @@ enum rtl8152_flags { GREEN_ETHERNET, RX_EPROTO, RECOVER_SPEED, + DISABLE_EEE_BOTTOM, }; /* Define these values to match your device */ @@ -999,12 +1003,9 @@ struct r8152 { int (*up)(struct r8152 *tp); int (*down)(struct r8152 *tp); void (*unload)(struct r8152 *tp); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) int (*eee_get)(struct r8152 *tp, struct ethtool_keee *eee); int (*eee_set)(struct r8152 *tp, struct ethtool_keee *eee); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) - int (*eee_get)(struct r8152 *tp, struct ethtool_eee *eee); - int (*eee_set)(struct r8152 *tp, struct ethtool_eee *eee); #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ bool (*in_nway)(struct r8152 *tp); void (*hw_phy_cfg)(struct r8152 *tp); @@ -1072,6 +1073,7 @@ struct r8152 { u16 ocp_base; u16 speed; u16 eee_adv; + u16 eee_adv2; u8 *intr_buff; u8 version; u8 rtk_enable_diag; @@ -1885,7 +1887,6 @@ ocp_adv_access(struct r8152 *tp, int type, u16 addr, u32 *data, bool write) return ret; } -/* static int rtl_bmu_read(struct r8152 *tp, u16 addr, u32 *data) { return ocp_adv_access(tp, ADV_TYPE_BMU, addr, data, false); @@ -1921,7 +1922,6 @@ static int rtl_bmu_set_bits(struct r8152 *tp, u16 addr, u32 set) { return rtl_bmu_w0w1(tp, addr, 0, set); } -*/ static int rtl_ip_read(struct r8152 *tp, u16 addr, u32 *data) { @@ -3934,9 +3934,9 @@ static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,4) */ skb_tx_timestamp(skb); + netdev_sent_queue(netdev, skb->len); skb_queue_tail(&tp->tx_queue, skb); - netdev_sent_queue(netdev, skb->len); if (!list_empty(&tp->tx_free)) { if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { @@ -4148,15 +4148,8 @@ static int rtl_stop_rx(struct r8152 *tp) list_splice_init(&tp->rx_info, &tmp_list); spin_unlock_irqrestore(&tp->rx_lock, flags); - list_for_each_entry_safe(agg, agg_next, &tmp_list, info_list) { - /* At least RTL8152_MAX_RX rx_agg have the page_count being - * equal to 1, so the other ones could be freed safely. - */ - if (page_count(agg->page) > 1) - free_rx_agg(tp, agg); - else - usb_kill_urb(agg->urb); - } + list_for_each_entry_safe(agg, agg_next, &tmp_list, info_list) + usb_kill_urb(agg->urb); /* Move back the list of temp to the rx_info */ spin_lock_irqsave(&tp->rx_lock, flags); @@ -5255,9 +5248,6 @@ static int r8157_power_cut_en(struct r8152 *tp, bool enable) ret = ocp_byte_set_bits(tp, MCU_TYPE_USB, USB_MISC_2, BIT(1)); if (ret < 0) goto out; - - ret = ocp_word_clr_bits(tp, MCU_TYPE_USB, USB_UPHY_XTAL, - OOBS_POLLING); } else { ret = ocp_word_clr_bits(tp, MCU_TYPE_USB, USB_POWER_CUT, PWR_EN); @@ -5636,12 +5626,51 @@ static int rtl_reset_bmu(struct r8152 *tp) { int ret; - ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, USB_BMU_RESET, - BMU_RESET_EP_IN | BMU_RESET_EP_OUT); - if (ret < 0) - goto out; - ret = ocp_byte_set_bits(tp, MCU_TYPE_USB, USB_BMU_RESET, - BMU_RESET_EP_IN | BMU_RESET_EP_OUT); + switch (tp->version) { + case RTL_VER_03: + case RTL_VER_04: + case RTL_VER_05: + case RTL_VER_06: + case RTL_VER_08: + case RTL_VER_09: + case RTL_TEST_01: + case RTL_VER_10: + case RTL_VER_11: + case RTL_VER_12: + case RTL_VER_13: + case RTL_VER_14: + case RTL_VER_15: + ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, USB_BMU_RESET, + BMU_RESET_EP_IN | BMU_RESET_EP_OUT); + if (ret < 0) + goto out; + ret = ocp_byte_set_bits(tp, MCU_TYPE_USB, USB_BMU_RESET, + BMU_RESET_EP_IN | BMU_RESET_EP_OUT); + break; + case RTL_VER_17: + ret = rtl_bmu_set_bits(tp, 0x2350, BIT(1)); + if (ret < 0) + goto out; + ret = rtl_bmu_set_bits(tp, 0x2360, BIT(0)); + if (ret < 0) + goto out; + ret = rtl_bmu_set_bits(tp, 0x2350, BIT(0)); + if (ret < 0) + goto out; + ret = rtl_bmu_set_bits(tp, 0x2450, BIT(1)); + if (ret < 0) + goto out; + ret = rtl_bmu_set_bits(tp, 0x2460, BIT(0)); + if (ret < 0) + goto out; + ret = rtl_bmu_set_bits(tp, 0x2450, BIT(0)); + if (ret < 0) + goto out; + break; + default: + return -EINVAL; + break; + } out: return ret; @@ -6637,12 +6666,14 @@ static int r8153_eee_en(struct r8152 *tp, bool enable) if (ret < 0) goto out; ret = ocp_reg_set_bits(tp, OCP_EEE_CFG, EEE10_EN); + ret = ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); } else { ret = ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_EEE_CR, EEE_RX_EN | EEE_TX_EN); if (ret < 0) goto out; ret = ocp_reg_clr_bits(tp, OCP_EEE_CFG, EEE10_EN); + ret = ocp_reg_write(tp, OCP_EEE_ADV, 0); } tp->ups_info.eee = enable; @@ -6655,14 +6686,25 @@ static int r8156_eee_en(struct r8152 *tp, bool enable) { int ret; - ret = r8153_eee_en(tp, enable); - if (ret < 0) - goto out; + if (enable) { + ret = r8153_eee_en(tp, true); + if (ret < 0) + goto out; + ret = ocp_reg_write(tp, OCP_EEE_ADV2, tp->eee_adv2); - if (enable) - ret = ocp_reg_set_bits(tp, OCP_EEE_ADV2, MDIO_EEE_2_5GT); - else - ret = ocp_reg_clr_bits(tp, OCP_EEE_ADV2, MDIO_EEE_2_5GT); + clear_bit(DISABLE_EEE_BOTTOM, &tp->flags); + } else { + ret = ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_EEE_CR, + EEE_TX_EN); + if (ret < 0) + goto out; + ret = ocp_reg_write(tp, OCP_EEE_ADV, 0); + ret = ocp_reg_write(tp, OCP_EEE_ADV2, 0); + + set_bit(DISABLE_EEE_BOTTOM, &tp->flags); + + tp->ups_info.eee = false; + } out: return ret; @@ -6677,11 +6719,9 @@ static int r8157_eee_en(struct r8152 *tp, bool enable) goto out; if (enable) - ret = ocp_reg_set_bits(tp, OCP_EEE_ADV2, - MDIO_EEE_2_5GT | MDIO_EEE_5GT); + ret = ocp_reg_write(tp, OCP_EEE_ADV2, tp->eee_adv2); else - ret = ocp_reg_clr_bits(tp, OCP_EEE_ADV2, - MDIO_EEE_2_5GT | MDIO_EEE_5GT); + ret = ocp_reg_write(tp, OCP_EEE_ADV2, 0); out: return ret; @@ -6716,48 +6756,18 @@ static int rtl_eee_enable(struct r8152 *tp, bool enable) case RTL_VER_08: case RTL_VER_09: case RTL_VER_14: - if (enable) { - ret = r8153_eee_en(tp, true); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); - } else { - ret = r8153_eee_en(tp, false); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, 0); - } + ret = r8153_eee_en(tp, enable); break; case RTL_VER_10: case RTL_VER_11: case RTL_VER_12: case RTL_VER_13: case RTL_VER_15: - if (enable) { - ret = r8156_eee_en(tp, true); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); - } else { - ret = r8156_eee_en(tp, false); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, 0); - } + ret = r8156_eee_en(tp, enable); break; case RTL_VER_16: case RTL_VER_17: - if (enable) { - ret = r8157_eee_en(tp, true); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); - } else { - ret = r8157_eee_en(tp, false); - if (ret < 0) - goto out; - ret = ocp_reg_write(tp, OCP_EEE_ADV, 0); - } + ret = r8157_eee_en(tp, enable); break; default: ret = 0; @@ -6769,6 +6779,22 @@ static int rtl_eee_enable(struct r8152 *tp, bool enable) return (ret < 0) ? ret : 0; } +static int rtl_disable_eee_bottom(struct r8152 *tp) +{ + int i, ret = -EINVAL; + + for (i = 0; i < 50; i++) { + if (!(rtl8152_get_speed(tp) & LINK_STATUS)) { + ret = ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_EEE_CR, + EEE_RX_EN); + break; + } + msleep(20); + } + + return (ret < 0) ? ret : 0; +} + static int r8152b_enable_fc(struct r8152 *tp) { int ret; @@ -11199,6 +11225,12 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u32 speed, u8 duplex, } } + if (test_and_clear_bit(DISABLE_EEE_BOTTOM, &tp->flags)) { + ret = rtl_disable_eee_bottom(tp); + if (ret < 0) + goto out; + } + out: return (ret < 0) ? ret : 0; } @@ -11795,6 +11827,11 @@ static int rtl8156_up(struct r8152 *tp) if (ret < 0) goto out; + /* Enable Clear_SDR */ + ret = ocp_word_set_bits(tp, MCU_TYPE_USB, 0xd3ca, BIT(15)); + if (ret < 0) + goto out; + if (tp->udev->speed >= USB_SPEED_SUPER) ret = r8153b_u1u2en(tp, true); @@ -12005,6 +12042,15 @@ static int rtl8157_up(struct r8152 *tp) ret = r8153_aldps_en(tp, true); if (ret < 0) goto out; + + /* Clear_SDR */ + ret = ocp_byte_set_bits(tp, MCU_TYPE_USB, 0xd378, BIT(7)); + if (ret < 0) + goto out; + ret = ocp_word_clr_bits(tp, MCU_TYPE_USB, 0xcd06, BIT(15)); + if (ret < 0) + goto out; + // ret = r8153_u2p3en(tp, true); // if (ret < 0) // goto out; @@ -13028,7 +13074,7 @@ static int r8153c_init(struct r8152 *tp) if (test_bit(RTL8152_UNPLUG, &tp->flags)) return -ENODEV; - rtl_set_dbg_info_init(tp, 0xa); + rtl_set_dbg_info_init(tp, 0xc); ret = r8153b_u1u2en(tp, false); if (ret < 0) @@ -13094,7 +13140,10 @@ static int r8153c_init(struct r8152 *tp) if (ret < 0) goto out; - ret = r8153b_u1u2en(tp, true); + if (tp->udev->speed < USB_SPEED_SUPER) + ret = r8153b_u1u2en(tp, false); + else + ret = r8153b_u1u2en(tp, true); if (ret < 0) goto out; @@ -13985,9 +14034,9 @@ static void r8156_patch_code(struct r8152 *tp) 0x52, 0xe0, 0xff, 0xe0, 0x02, 0xe1, 0x06, 0xe1, 0x16, 0xe1, 0x18, 0xe1, - 0x39, 0xe1, 0x52, 0xe1, - 0x54, 0xe1, 0x56, 0xe1, - 0x58, 0xe1, 0x5a, 0xe1, + 0x48, 0xe1, 0x72, 0xe1, + 0x80, 0xe1, 0x8f, 0xe1, + 0x96, 0xe1, 0x98, 0xe1, 0x13, 0xc3, 0x60, 0x70, 0x8b, 0x49, 0x0d, 0xf1, 0x10, 0xc3, 0x60, 0x60, @@ -14001,9 +14050,9 @@ static void r8156_patch_code(struct r8152 *tp) 0x00, 0xd8, 0x1e, 0xb4, 0x04, 0xc3, 0x02, 0xc0, 0x00, 0xb8, 0x62, 0x36, - 0xc8, 0xd3, 0x04, 0xc3, + 0xce, 0xd3, 0x04, 0xc3, 0x02, 0xc0, 0x00, 0xb8, - 0x7a, 0x14, 0xc8, 0xd3, + 0x7a, 0x14, 0xce, 0xd3, 0x00, 0xb4, 0x01, 0xb4, 0x02, 0xb4, 0x03, 0xb4, 0x1f, 0xc1, 0x02, 0x1b, @@ -14124,49 +14173,84 @@ static void r8156_patch_code(struct r8152 *tp) 0xf4, 0xe7, 0x02, 0xc0, 0x00, 0xb8, 0x0e, 0x28, 0x02, 0xc7, 0x00, 0xbf, - 0x48, 0x31, 0x1c, 0xc6, - 0xc0, 0x61, 0x04, 0x11, - 0x15, 0xf1, 0x19, 0xc6, - 0xc0, 0x61, 0x9c, 0x20, - 0x9c, 0x24, 0x09, 0x11, - 0x0f, 0xf1, 0x14, 0xc6, - 0x01, 0x19, 0xc0, 0x89, - 0x13, 0xc1, 0x13, 0xc6, - 0x24, 0x9e, 0x00, 0x1e, + 0x48, 0x31, 0x57, 0xc6, + 0xc0, 0x71, 0x9f, 0x49, + 0x08, 0xf0, 0x52, 0xc6, + 0x00, 0x19, 0x98, 0x20, + 0xc0, 0x99, 0xc2, 0x99, + 0xc4, 0x99, 0xc6, 0x99, + 0x20, 0xc6, 0xc0, 0x61, + 0x04, 0x11, 0x05, 0xf0, + 0x1e, 0xc6, 0x02, 0x19, + 0xc0, 0x89, 0x15, 0xe0, + 0x19, 0xc6, 0xc0, 0x61, + 0x9c, 0x20, 0x9c, 0x24, + 0x09, 0x11, 0xf7, 0xf1, + 0x14, 0xc6, 0x01, 0x19, + 0xc0, 0x89, 0x13, 0xc1, + 0x13, 0xc6, 0x24, 0x9e, + 0x00, 0x1e, 0x26, 0x8e, + 0x26, 0x76, 0xef, 0x49, + 0xfe, 0xf1, 0x22, 0x76, + 0x08, 0xc1, 0x22, 0x9e, + 0x07, 0xc6, 0x02, 0xc1, + 0x00, 0xb9, 0xae, 0x09, + 0x18, 0xb4, 0x4a, 0xb4, + 0xe0, 0xcc, 0x80, 0xd4, + 0x08, 0xdc, 0x10, 0xe8, + 0xfc, 0xc6, 0xc0, 0x67, + 0xf0, 0x49, 0x1e, 0xf0, + 0xf0, 0x48, 0xc0, 0x8f, + 0xc2, 0x77, 0xf7, 0xc1, + 0xf7, 0xc6, 0x24, 0x9e, + 0x22, 0x9f, 0x8c, 0x1e, 0x26, 0x8e, 0x26, 0x76, 0xef, 0x49, 0xfe, 0xf1, - 0x22, 0x76, 0x08, 0xc1, - 0x22, 0x9e, 0x07, 0xc6, - 0x02, 0xc1, 0x00, 0xb9, - 0xae, 0x09, 0x18, 0xb4, - 0x4a, 0xb4, 0xe0, 0xcc, - 0x80, 0xd4, 0x08, 0xdc, - 0x10, 0xe8, 0xfc, 0xc6, - 0xc0, 0x67, 0xf0, 0x49, - 0x13, 0xf0, 0xf0, 0x48, - 0xc0, 0x8f, 0xc2, 0x77, - 0xf7, 0xc1, 0xf7, 0xc6, - 0x24, 0x9e, 0x22, 0x9f, - 0x8c, 0x1e, 0x26, 0x8e, - 0x26, 0x76, 0xef, 0x49, - 0xfe, 0xf1, 0xfb, 0x49, - 0x05, 0xf0, 0x07, 0xc6, - 0xc0, 0x61, 0x10, 0x48, - 0xc0, 0x89, 0x02, 0xc6, + 0xfb, 0x49, 0x10, 0xf0, + 0x12, 0xc6, 0xc0, 0x61, + 0x10, 0x48, 0xc0, 0x89, + 0x11, 0xc6, 0x11, 0xc1, + 0xc0, 0x99, 0x10, 0xc6, + 0xc0, 0x71, 0x18, 0x48, + 0xc0, 0x99, 0x0d, 0xc6, + 0xc0, 0x71, 0x11, 0x48, + 0xc0, 0x99, 0x02, 0xc6, 0x00, 0xbe, 0x06, 0x5f, - 0x6c, 0xb4, 0x02, 0xc0, - 0x00, 0xb8, 0x00, 0x00, - 0x02, 0xc0, 0x00, 0xb8, - 0x00, 0x00, 0x02, 0xc0, - 0x00, 0xb8, 0x00, 0x00, + 0x6c, 0xb4, 0xf8, 0xc6, + 0xca, 0xd3, 0x40, 0xd3, + 0x4b, 0x80, 0x34, 0xd3, + 0xe8, 0xd4, 0xfb, 0xc2, + 0x40, 0x71, 0x9f, 0x49, + 0x08, 0xf0, 0xf6, 0xc2, + 0x00, 0x19, 0x98, 0x20, + 0x40, 0x99, 0x42, 0x99, + 0x44, 0x99, 0x46, 0x99, + 0x13, 0xc2, 0x02, 0xc1, + 0x00, 0xb9, 0x04, 0x5a, + 0xec, 0xc1, 0x20, 0x72, + 0xaf, 0x49, 0x08, 0xf0, + 0xe7, 0xc1, 0x00, 0x1a, + 0x28, 0x21, 0x20, 0x9a, + 0x22, 0x9a, 0x24, 0x9a, + 0x26, 0x9a, 0x04, 0xc1, + 0x02, 0xc2, 0x00, 0xba, + 0xc2, 0x5b, 0xca, 0xcf, + 0x40, 0x71, 0x90, 0x48, + 0x91, 0x48, 0x92, 0x48, + 0x40, 0x99, 0x02, 0xc0, + 0x00, 0xb8, 0x8e, 0x20, 0x02, 0xc0, 0x00, 0xb8, 0x00, 0x00, 0x02, 0xc0, 0x00, 0xb8, 0x00, 0x00}; static u8 pla_patch_13[] = { - 0x08, 0xe0, 0x14, 0xe0, - 0x18, 0xe0, 0x32, 0xe0, - 0xc8, 0xe0, 0xd4, 0xe0, - 0x0e, 0xe1, 0x10, 0xe1, + 0x10, 0xe0, 0x1c, 0xe0, + 0x20, 0xe0, 0x3a, 0xe0, + 0xd0, 0xe0, 0xdc, 0xe0, + 0x58, 0xe1, 0x09, 0xe0, + 0x08, 0xe0, 0x07, 0xe0, + 0x06, 0xe0, 0x05, 0xe0, + 0x04, 0xe0, 0x03, 0xe0, + 0x02, 0xe0, 0x01, 0xe0, 0x0c, 0xc4, 0x04, 0x40, 0x05, 0xf0, 0x8c, 0x26, 0x0b, 0x15, 0x02, 0xf0, @@ -14272,43 +14356,75 @@ static void r8156_patch_code(struct r8152 *tp) 0x36, 0x70, 0x80, 0x48, 0x36, 0x98, 0x80, 0xff, 0xd4, 0xb5, 0x04, 0x10, - 0x07, 0xf1, 0x27, 0xc1, + 0x07, 0xf1, 0x64, 0xc1, 0x32, 0x70, 0x89, 0x48, 0x32, 0x98, 0xf1, 0xef, 0x18, 0xe0, 0x05, 0x10, - 0x07, 0xf1, 0x1f, 0xc1, + 0x07, 0xf1, 0x5c, 0xc1, 0x32, 0x70, 0x89, 0x48, - 0x32, 0x98, 0x1d, 0xe8, + 0x32, 0x98, 0x5f, 0xe8, 0x10, 0xe0, 0x06, 0x10, - 0x07, 0xf1, 0x17, 0xc1, + 0x07, 0xf1, 0x54, 0xc1, 0x32, 0x70, 0x09, 0x48, - 0x32, 0x98, 0x15, 0xe8, + 0x32, 0x98, 0x57, 0xe8, 0x08, 0xe0, 0x07, 0x10, - 0x0d, 0xf1, 0x0f, 0xc1, + 0x0d, 0xf1, 0x4c, 0xc1, 0x32, 0x70, 0x09, 0x48, - 0x32, 0x98, 0x15, 0xe8, - 0x0b, 0xc1, 0x28, 0x70, - 0x09, 0x48, 0x28, 0x98, + 0x32, 0x98, 0x57, 0xe8, + 0x47, 0xc1, 0x28, 0x70, + 0x05, 0x48, 0x06, 0x48, + 0x07, 0x48, 0x08, 0x48, + 0x28, 0x98, 0xa4, 0x49, + 0x07, 0xf0, 0x40, 0xc1, + 0x20, 0x70, 0x00, 0x48, + 0x01, 0x48, 0x20, 0x98, + 0x05, 0xe0, 0x3a, 0xc1, + 0x20, 0x70, 0x81, 0x48, + 0x20, 0x98, 0xa5, 0x49, + 0x07, 0xf0, 0x34, 0xc1, + 0x40, 0x01, 0x20, 0x60, + 0x01, 0x48, 0x20, 0x88, + 0x06, 0xe0, 0x2e, 0xc1, + 0x40, 0x01, 0x20, 0x60, + 0x81, 0x48, 0x20, 0x88, + 0xa6, 0x49, 0x06, 0xf0, + 0x26, 0xc1, 0x30, 0x70, + 0x02, 0x48, 0x30, 0x98, + 0x05, 0xe0, 0x21, 0xc1, + 0x30, 0x70, 0x82, 0x48, + 0x30, 0x98, 0xa7, 0x49, + 0x07, 0xf0, 0x1a, 0xc1, + 0x28, 0x70, 0x0a, 0x48, + 0x0b, 0x48, 0x28, 0x98, + 0x06, 0xe0, 0x14, 0xc1, + 0x28, 0x70, 0x8a, 0x48, + 0x8b, 0x48, 0x28, 0x98, + 0x12, 0xc1, 0x12, 0xc2, + 0x24, 0x9a, 0x0c, 0xc1, + 0x10, 0xc2, 0x20, 0x9a, + 0x0c, 0xc1, 0x24, 0x9b, + 0x0d, 0xc2, 0x40, 0x73, + 0x3f, 0x48, 0x40, 0x9b, 0x02, 0xc1, 0x00, 0xb9, - 0x44, 0x36, 0x02, 0xc1, - 0x00, 0xb9, 0x52, 0x36, - 0x00, 0xb4, 0x20, 0xb4, - 0xd4, 0xc1, 0x20, 0x70, + 0xc6, 0x36, 0x00, 0xb4, + 0x20, 0xb4, 0x40, 0xe0, + 0x68, 0xe8, 0x00, 0xa0, + 0x00, 0x12, 0x58, 0xe8, + 0x92, 0xc1, 0x20, 0x70, 0x87, 0x48, 0x20, 0x98, 0x36, 0x70, 0x00, 0x48, 0x36, 0x98, 0x80, 0xff, - 0xcc, 0xc1, 0x20, 0x70, + 0x8a, 0xc1, 0x20, 0x70, 0x07, 0x48, 0x20, 0x98, 0x36, 0x70, 0x00, 0x48, 0x36, 0x98, 0x80, 0xff, - 0x02, 0xc0, 0x00, 0xb8, - 0x3a, 0x4e, 0x02, 0xc0, - 0x00, 0xb8, 0x3a, 0x4e}; + 0xa9, 0xe7, 0x02, 0xc1, + 0x00, 0xb9, 0xc6, 0x36}; u8 new_ver; rtl_fw_ver_erase(tp); - new_ver = 4; + new_ver = 6; if (rtl_check_fw_ver_ok(tp, USB_FW_USB_VER, new_ver)) { rtl_clear_bp(tp, MCU_TYPE_USB); @@ -14328,17 +14444,17 @@ static void r8156_patch_code(struct r8152 *tp) ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0x3140); ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0x09ac); ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0x5e2a); - ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0x0000); - ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0x0000); - ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0x5a02); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0x5bc0); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0x208a); ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0x0000); ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0x0000); - ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0x07ff); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0x3fff); ocp_write_byte(tp, MCU_TYPE_USB, USB_FW_USB_VER, new_ver); } - new_ver = 6; + new_ver = 8; if (rtl_check_fw_ver_ok(tp, USB_FW_PLA_VER, new_ver)) { rtl_clear_bp(tp, MCU_TYPE_PLA); @@ -14353,9 +14469,9 @@ static void r8156_patch_code(struct r8152 *tp) ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_3, 0x09d0); ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_4, 0x359e); ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_5, 0x35b6); - ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_6, 0x0000); + ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_6, 0x35b4); ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_7, 0x0000); - ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_EN, 0x003f); + ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_EN, 0x007f); ocp_write_byte(tp, MCU_TYPE_USB, USB_FW_PLA_VER, new_ver); } @@ -14364,6 +14480,262 @@ static void r8156_patch_code(struct r8152 *tp) rtl_reset_ocp_base(tp); } +static void r8157_patch_code(struct r8152 *tp) +{ + if (tp->version == RTL_VER_17) { + static u8 usb_patch_17[] = { + 0x10, 0xe0, 0x20, 0xe0, + 0x22, 0xe0, 0x71, 0xe0, + 0x75, 0xe0, 0x9b, 0xe0, + 0xbf, 0xe0, 0xd8, 0xe0, + 0xfb, 0xe0, 0xff, 0xe0, + 0x08, 0xe1, 0x1c, 0xe1, + 0x1e, 0xe1, 0x29, 0xe1, + 0x4c, 0xe1, 0x52, 0xe1, + 0x0d, 0xc6, 0xc0, 0x71, + 0x91, 0x48, 0xc0, 0x99, + 0x11, 0x48, 0xc0, 0x99, + 0x09, 0xc6, 0x09, 0xc1, + 0xc0, 0x99, 0x05, 0xc6, + 0x02, 0xc1, 0x00, 0xb9, + 0x80, 0x33, 0x86, 0xd4, + 0x6c, 0xe4, 0x00, 0xb9, + 0x47, 0x68, 0x02, 0xc6, + 0x00, 0xbe, 0x32, 0x19, + 0x27, 0xc2, 0x40, 0x71, + 0x92, 0x49, 0x0e, 0xf1, + 0x91, 0x49, 0x0c, 0xf1, + 0x27, 0xc2, 0x01, 0x02, + 0xc0, 0x9a, 0x00, 0x19, + 0x18, 0x48, 0xc2, 0x99, + 0x1a, 0xc1, 0xc4, 0x99, + 0xc6, 0x9b, 0x16, 0xff, + 0x3d, 0xe0, 0x17, 0xc2, + 0x40, 0x73, 0xb0, 0x49, + 0x28, 0xf0, 0x14, 0xc2, + 0x40, 0x73, 0xbf, 0x49, + 0x19, 0xf1, 0x11, 0xc2, + 0x50, 0x73, 0xb0, 0x49, + 0x15, 0xf1, 0x0e, 0xc3, + 0x0e, 0xc2, 0x60, 0x9a, + 0x40, 0x1a, 0x28, 0x21, + 0x28, 0x25, 0x62, 0x9a, + 0x17, 0xff, 0x28, 0xe0, + 0xe0, 0x01, 0x44, 0xd8, + 0x0c, 0xd2, 0x74, 0xd3, + 0x00, 0xd4, 0x70, 0xd3, + 0xe8, 0xd4, 0x04, 0xc7, + 0xff, 0xff, 0xf2, 0xb8, + 0x28, 0xe4, 0xfc, 0xc2, + 0x03, 0x02, 0xc0, 0x9a, + 0x00, 0x19, 0xc2, 0x99, + 0x13, 0x48, 0xc4, 0x99, + 0xf6, 0xc3, 0xc6, 0x9b, + 0x16, 0xff, 0x12, 0xe0, + 0xf3, 0xc2, 0x40, 0x71, + 0x1f, 0x48, 0x40, 0x99, + 0xf0, 0xc2, 0x01, 0x19, + 0x42, 0x99, 0x01, 0x19, + 0x40, 0x89, 0xe6, 0xc3, + 0xe6, 0xc2, 0x60, 0x9a, + 0x40, 0x1a, 0x28, 0x21, + 0x28, 0x25, 0x62, 0x9a, + 0x17, 0xff, 0x02, 0xc2, + 0x00, 0xba, 0x1c, 0x2d, + 0x00, 0x75, 0xd8, 0x49, + 0x02, 0xc4, 0x00, 0xbc, + 0x36, 0xc6, 0x04, 0xf0, + 0x02, 0xc0, 0x00, 0xb8, + 0xb2, 0xa0, 0x1e, 0xc7, + 0xf3, 0x66, 0xb1, 0x3b, + 0xf3, 0x8e, 0x00, 0x16, + 0x03, 0xf1, 0x08, 0xe8, + 0x04, 0xe0, 0x02, 0xc6, + 0x00, 0xbe, 0xaa, 0xa1, + 0x02, 0xc7, 0x00, 0xbf, + 0x82, 0xa1, 0x11, 0xc5, + 0xa2, 0x76, 0x6a, 0x27, + 0x6a, 0x23, 0x0e, 0xc7, + 0x37, 0x40, 0x09, 0xf1, + 0x0c, 0xc5, 0x0c, 0xc6, + 0xc0, 0x9d, 0x08, 0x1d, + 0xd8, 0x22, 0xd8, 0x26, + 0xc2, 0x9d, 0x17, 0xff, + 0x80, 0xff, 0x80, 0xcb, + 0x80, 0xc3, 0x00, 0xc4, + 0xe8, 0xd4, 0x70, 0xd3, + 0x24, 0xc3, 0x60, 0x74, + 0xcf, 0x49, 0x0e, 0xf1, + 0x1c, 0xc3, 0x60, 0x74, + 0xcf, 0x49, 0x16, 0xf0, + 0x44, 0x22, 0x4c, 0x26, + 0x17, 0xc3, 0x60, 0x65, + 0xd5, 0x22, 0xd5, 0x26, + 0x25, 0x40, 0x0e, 0xf1, + 0x0d, 0xe0, 0xcf, 0x48, + 0x60, 0x9c, 0x0f, 0xc3, + 0x62, 0x74, 0x11, 0x1d, + 0x62, 0x9d, 0x0c, 0xc3, + 0x62, 0x75, 0xd3, 0x48, + 0x62, 0x9d, 0x07, 0xc3, + 0x62, 0x9c, 0x02, 0xc3, + 0x00, 0xbb, 0x14, 0x09, + 0x44, 0xd6, 0xf4, 0xcb, + 0x3c, 0xd5, 0x04, 0xb7, + 0xf2, 0xb8, 0x3a, 0xc2, + 0x40, 0x71, 0x9f, 0x49, + 0x06, 0xf1, 0x85, 0xc2, + 0x50, 0x71, 0x90, 0x49, + 0x02, 0xf1, 0x0f, 0xe0, + 0x31, 0xc2, 0x40, 0x71, + 0x9f, 0x48, 0x40, 0x99, + 0x82, 0xc2, 0x00, 0x1b, + 0x40, 0x8b, 0xef, 0xc2, + 0x40, 0x73, 0xbf, 0x48, + 0x40, 0x9b, 0x02, 0xc2, + 0x00, 0xba, 0xfc, 0x5b, + 0x02, 0xc6, 0x00, 0xbe, + 0x0e, 0x5c, 0x21, 0xc6, + 0x21, 0xc1, 0xc0, 0x99, + 0x20, 0xc0, 0xc6, 0x98, + 0x16, 0xff, 0xc2, 0x70, + 0x0d, 0x20, 0x0d, 0x24, + 0x82, 0x49, 0x07, 0xf0, + 0x13, 0xc6, 0xc0, 0x71, + 0x9c, 0x20, 0x9c, 0x24, + 0x03, 0x11, 0x0a, 0xf1, + 0x0d, 0xc6, 0xc0, 0x71, + 0x9c, 0x24, 0x06, 0x11, + 0x05, 0xf1, 0x0a, 0xc0, + 0x00, 0x71, 0x1f, 0x48, + 0x00, 0x99, 0x05, 0xc0, + 0x02, 0xc1, 0x00, 0xb9, + 0xb4, 0x50, 0xba, 0xd4, + 0x20, 0xd4, 0x74, 0xd3, + 0x80, 0xcf, 0x0c, 0xc7, + 0xff, 0xff, 0x04, 0xc6, + 0x02, 0xc5, 0x00, 0xbd, + 0xa4, 0x58, 0x80, 0x90, + 0x08, 0xc5, 0x08, 0xc6, + 0xa0, 0x77, 0xc0, 0x9f, + 0x07, 0xb0, 0x02, 0xc6, + 0x00, 0xbe, 0xae, 0x5a, + 0xd8, 0xc7, 0x18, 0x90, + 0x11, 0xc2, 0x16, 0x40, + 0x0c, 0xf0, 0x0f, 0xc2, + 0x16, 0x40, 0x09, 0xf0, + 0x0d, 0xc2, 0x16, 0x40, + 0x06, 0xf0, 0x0b, 0xc2, + 0x16, 0x40, 0x02, 0xc2, + 0x00, 0xba, 0x42, 0x45, + 0x02, 0xc2, 0x00, 0xba, + 0x46, 0x45, 0x18, 0xc0, + 0x1a, 0xc0, 0x1c, 0xc0, + 0x14, 0xc0, 0x02, 0xc1, + 0x00, 0xb9, 0x1c, 0x64, + 0x0a, 0xc0, 0x00, 0x72, + 0xa2, 0x49, 0x03, 0xf0, + 0x25, 0x48, 0x00, 0x9a, + 0x05, 0xc0, 0x02, 0xc2, + 0x00, 0xba, 0x94, 0xd0, + 0x26, 0xd4, 0x06, 0xd4, + 0x20, 0xc6, 0xc6, 0x75, + 0xd5, 0x49, 0x16, 0xf0, + 0xd5, 0x48, 0xc6, 0x9d, + 0x1b, 0xc5, 0xa0, 0x76, + 0x11, 0x1c, 0xa0, 0x9c, + 0x18, 0xc4, 0x82, 0x63, + 0xb4, 0x48, 0xb5, 0x48, + 0xb6, 0x48, 0xb7, 0x48, + 0x82, 0x8b, 0xa0, 0x9e, + 0x11, 0xc4, 0x80, 0x73, + 0xb0, 0x49, 0x04, 0xf0, + 0xb2, 0x49, 0x02, 0xf0, + 0x05, 0xe0, 0xf6, 0x65, + 0x02, 0xc6, 0x00, 0xbe, + 0xe6, 0x04, 0x02, 0xc6, + 0x00, 0xbe, 0x5a, 0x05, + 0x20, 0xd4, 0x3e, 0xd5, + 0x04, 0xb7, 0x26, 0xd4, + 0x06, 0xc1, 0x40, 0x1a, + 0x20, 0x9a, 0x02, 0xc2, + 0x00, 0xba, 0xb2, 0xab, + 0x18, 0x90, 0x0e, 0xc7, + 0xe0, 0x75, 0xd6, 0x48, + 0xe0, 0x9d, 0x0b, 0xc7, + 0x00, 0x1d, 0xe0, 0x8d, + 0x09, 0xc7, 0xe0, 0x75, + 0xdf, 0x48, 0xe0, 0x9d, + 0x02, 0xc1, 0x00, 0xb9, + 0xe4, 0x4f, 0xe8, 0xd4, + 0x28, 0xe4, 0xf2, 0xb8}; + static u8 pla_patch_17[] = { + 0x10, 0xe0, 0x0f, 0xe0, + 0x0e, 0xe0, 0x0d, 0xe0, + 0x0c, 0xe0, 0x0b, 0xe0, + 0x0a, 0xe0, 0x09, 0xe0, + 0x08, 0xe0, 0x07, 0xe0, + 0x06, 0xe0, 0x05, 0xe0, + 0x04, 0xe0, 0x03, 0xe0, + 0x02, 0xe0, 0x01, 0xe0, + 0x08, 0xc6, 0xc0, 0x71, + 0x90, 0x49, 0x07, 0xf0, + 0x05, 0xc6, 0x02, 0xc1, + 0x00, 0xb9, 0x80, 0x1e, + 0xc8, 0xe0, 0x10, 0xd4, + 0x02, 0xc6, 0x00, 0xbe, + 0x86, 0x1e, 0x00, 0x00}; + u8 new_ver; + + rtl_fw_ver_erase(tp); + + new_ver = 3; + if (rtl_check_fw_ver_ok(tp, USB_FW_USB_VER, new_ver)) { + rtl_clear_bp(tp, MCU_TYPE_USB); + + generic_ocp_write(tp, 0xe600, 0xff, + sizeof(usb_patch_17), usb_patch_17, + MCU_TYPE_USB); + + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_BA, 0xf000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_0, 0x337e); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_1, 0x192a); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_2, 0x269a); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_3, 0xc632); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_4, 0xa108); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_5, 0x08f4); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_6, 0x5be6); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_7, 0x50b2); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0x453e); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0x0000); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0xd092); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0x04e4); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0xa93e); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0x5074); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0x74ff); + ocp_write_byte(tp, MCU_TYPE_USB, USB_FW_USB_VER, + new_ver); + } + + new_ver = 1; + if (rtl_check_fw_ver_ok(tp, USB_FW_PLA_VER, new_ver)) { + rtl_clear_bp(tp, MCU_TYPE_PLA); + + generic_ocp_write(tp, 0xf800, 0xff, + sizeof(pla_patch_17), pla_patch_17, + MCU_TYPE_PLA); + + ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_BA, 0x8000); + ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_0, 0x1e7e); + ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_EN, 0x0001); + ocp_write_byte(tp, MCU_TYPE_USB, USB_FW_PLA_VER, + new_ver); + } + } +} + static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) { u16 fw_version, code_ver; @@ -15465,9 +15837,9 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x3e, 0x80, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x3e, 0x80, + 0x38, 0xb4, 0x44, 0x80, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x3e, 0x80, + 0x38, 0xb4, 0x4b, 0x80, 0x38, 0xb4, 0x04, 0xd5, 0x38, 0xb4, 0xb5, 0xc9, 0x38, 0xb4, 0x00, 0xd5, @@ -15514,63 +15886,258 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0xd5, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x4d, 0x14, - 0x36, 0xb4, 0x26, 0xa0, - 0x38, 0xb4, 0xff, 0xff, - 0x36, 0xb4, 0x24, 0xa0, - 0x38, 0xb4, 0xff, 0xff, - 0x36, 0xb4, 0x22, 0xa0, - 0x38, 0xb4, 0xff, 0xff, - 0x36, 0xb4, 0x20, 0xa0, - 0x38, 0xb4, 0x4c, 0x14, - 0x36, 0xb4, 0x06, 0xa0, - 0x38, 0xb4, 0x98, 0x1b, - 0x36, 0xb4, 0x04, 0xa0, - 0x38, 0xb4, 0x8b, 0x13, - 0x36, 0xb4, 0x02, 0xa0, - 0x38, 0xb4, 0xc4, 0x10, - 0x36, 0xb4, 0x00, 0xa0, - 0x38, 0xb4, 0x79, 0x10, - 0x36, 0xb4, 0x08, 0xa0, - 0x38, 0xb4, 0x00, 0x1f, - 0x6c, 0xe8, 0x00, 0xa0, - 0x36, 0xb4, 0x16, 0xa0, - 0x38, 0xb4, 0x20, 0x00, - 0x36, 0xb4, 0x12, 0xa0, - 0x38, 0xb4, 0x00, 0x00, - 0x36, 0xb4, 0x14, 0xa0, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x10, 0x80, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x1a, 0x80, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x1a, 0x80, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x0a, 0x81, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x11, 0x81, - 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x41, 0x83, + 0x38, 0xb4, 0x7f, 0x90, + 0x38, 0xb4, 0xa3, 0x91, + 0x38, 0xb4, 0x06, 0x93, + 0x38, 0xb4, 0x18, 0xb1, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x49, 0x83, + 0x38, 0xb4, 0x47, 0x21, + 0x38, 0xb4, 0x7f, 0x90, + 0x38, 0xb4, 0x09, 0x92, + 0x38, 0xb4, 0xa3, 0x91, + 0x38, 0xb4, 0x06, 0x93, + 0x38, 0xb4, 0x18, 0xb1, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0xdf, 0x83, + 0x38, 0xb4, 0x3c, 0x20, + 0x38, 0xb4, 0x07, 0xd7, + 0x38, 0xb4, 0x21, 0x41, 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0xa9, 0x60, - 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xa1, 0x60, + 0x38, 0xb4, 0xfc, 0x40, + 0x38, 0xb4, 0x0a, 0xd7, + 0x38, 0xb4, 0xb5, 0x40, + 0x38, 0xb4, 0x28, 0xd0, + 0x38, 0xb4, 0xc1, 0xd1, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x57, 0x80, + 0x38, 0xb4, 0x7b, 0xd0, + 0x38, 0xb4, 0xc5, 0xd1, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x08, 0xa1, + 0x38, 0xb4, 0x05, 0xd5, + 0x38, 0xb4, 0x03, 0x81, + 0x38, 0xb4, 0x04, 0xd5, + 0x38, 0xb4, 0x02, 0xa0, + 0x38, 0xb4, 0x02, 0xa3, + 0x38, 0xb4, 0x07, 0xd7, + 0x38, 0xb4, 0x61, 0x40, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x01, 0x8b, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x8a, 0xc4, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x09, 0xcc, + 0x38, 0xb4, 0x58, 0xcd, + 0x38, 0xb4, 0x01, 0xaf, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x10, 0xbe, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x39, 0x17, + 0x38, 0xb4, 0x19, 0xd7, + 0x38, 0xb4, 0x6c, 0x60, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x5c, 0x64, + 0x38, 0xb4, 0x5e, 0xd7, + 0x38, 0xb4, 0x4d, 0x60, + 0x38, 0xb4, 0xf8, 0xff, + 0x38, 0xb4, 0x10, 0x9e, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x39, 0x17, + 0x38, 0xb4, 0x19, 0xd7, + 0x38, 0xb4, 0x6c, 0x60, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x1c, 0x63, + 0x38, 0xb4, 0x5e, 0xd7, + 0x38, 0xb4, 0x4d, 0x40, + 0x38, 0xb4, 0xf8, 0xff, + 0x38, 0xb4, 0x04, 0xd5, + 0x38, 0xb4, 0x18, 0xaa, + 0x38, 0xb4, 0x01, 0xa0, + 0x38, 0xb4, 0xe0, 0xa1, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x39, 0x17, + 0x38, 0xb4, 0x19, 0xd7, + 0x38, 0xb4, 0xac, 0x7f, + 0x38, 0xb4, 0x04, 0xd5, + 0x38, 0xb4, 0x01, 0xa0, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x39, 0x17, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x5c, 0x5f, + 0x38, 0xb4, 0x19, 0xd7, + 0x38, 0xb4, 0xaf, 0x3a, + 0x38, 0xb4, 0x91, 0x80, + 0x38, 0xb4, 0x16, 0xf0, + 0x38, 0xb4, 0x07, 0xd7, + 0x38, 0xb4, 0x21, 0x61, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xd8, 0x16, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x59, 0xcd, + 0x38, 0xb4, 0x01, 0xaf, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xdc, 0x0d, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x40, 0x80, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xd8, 0x16, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x5a, 0xcd, + 0x38, 0xb4, 0x01, 0xaf, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xbf, 0x0d, + 0x38, 0xb4, 0x04, 0xd5, + 0x38, 0xb4, 0x08, 0xa0, + 0x38, 0xb4, 0x04, 0xa2, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x39, 0x17, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0xa0, 0x5f, + 0x38, 0xb4, 0x03, 0xd5, + 0x38, 0xb4, 0x82, 0xa0, + 0x38, 0xb4, 0x00, 0xd5, + 0x38, 0xb4, 0x1e, 0xd7, + 0x38, 0xb4, 0x97, 0x40, + 0x38, 0xb4, 0x78, 0xd0, + 0x38, 0xb4, 0xaa, 0xd1, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x78, 0xd0, + 0x38, 0xb4, 0xaa, 0xd1, + 0x38, 0xb4, 0x07, 0xd7, + 0x38, 0xb4, 0xc1, 0x40, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x9c, 0x40, + 0x38, 0xb4, 0x0a, 0xd7, + 0x38, 0xb4, 0x55, 0x40, + 0x38, 0xb4, 0x10, 0xf0, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x65, 0x60, + 0x38, 0xb4, 0x89, 0xcc, + 0x38, 0xb4, 0x02, 0xf0, + 0x38, 0xb4, 0x8b, 0xcc, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x7b, 0x0b, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0xd0, 0x2a, + 0x38, 0xb4, 0xca, 0x80, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x81, 0x0b, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x87, 0x0b, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x53, 0x0c, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xd7, 0x12, + 0x36, 0xb4, 0x26, 0xa0, + 0x38, 0xb4, 0x5d, 0x12, + 0x36, 0xb4, 0x24, 0xa0, + 0x38, 0xb4, 0x33, 0x20, + 0x36, 0xb4, 0x22, 0xa0, + 0x38, 0xb4, 0x3f, 0x21, + 0x36, 0xb4, 0x20, 0xa0, + 0x38, 0xb4, 0x4c, 0x14, + 0x36, 0xb4, 0x06, 0xa0, + 0x38, 0xb4, 0x98, 0x1b, + 0x36, 0xb4, 0x04, 0xa0, + 0x38, 0xb4, 0x8b, 0x13, + 0x36, 0xb4, 0x02, 0xa0, + 0x38, 0xb4, 0xc4, 0x10, + 0x36, 0xb4, 0x00, 0xa0, + 0x38, 0xb4, 0x79, 0x10, + 0x36, 0xb4, 0x08, 0xa0, + 0x38, 0xb4, 0x00, 0xff, + 0x6c, 0xe8, 0x00, 0xa0, + 0x36, 0xb4, 0x16, 0xa0, + 0x38, 0xb4, 0x00, 0x00, + 0x36, 0xb4, 0x12, 0xa0, + 0x38, 0xb4, 0xf8, 0x0f, + 0x36, 0xb4, 0x14, 0xa0, + 0x38, 0xb4, 0x4d, 0xd0, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x00, 0x00, + 0x36, 0xb4, 0x52, 0xa1, + 0x38, 0xb4, 0xdc, 0x12, + 0x36, 0xb4, 0x54, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x56, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x58, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x5a, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x5c, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x5e, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x60, 0xa1, + 0x38, 0xb4, 0xff, 0x3f, + 0x36, 0xb4, 0x50, 0xa1, + 0x38, 0xb4, 0x01, 0x00, + 0x6c, 0xe8, 0x00, 0xa0, + 0x36, 0xb4, 0x16, 0xa0, + 0x38, 0xb4, 0x20, 0x00, + 0x36, 0xb4, 0x12, 0xa0, + 0x38, 0xb4, 0x00, 0x00, + 0x36, 0xb4, 0x14, 0xa0, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x10, 0x80, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x1a, 0x80, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x22, 0x80, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x23, 0x82, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x22, 0x83, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x4f, 0x85, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x09, 0x86, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x9f, 0x86, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xa9, 0x60, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xa1, 0x60, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x62, 0x09, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x62, 0x09, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x82, 0x09, - 0x38, 0xb4, 0x0d, 0xd7, - 0x38, 0xb4, 0xfd, 0x40, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x00, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x99, 0x0f, 0x38, 0xb4, 0x02, 0xd7, - 0x38, 0xb4, 0xa0, 0x40, - 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x66, 0x40, + 0x38, 0xb4, 0xc1, 0x61, + 0x38, 0xb4, 0x02, 0xd7, + 0x38, 0xb4, 0x60, 0x40, + 0x38, 0xb4, 0x0d, 0xd7, + 0x38, 0xb4, 0x5d, 0x41, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0x1a, 0x61, 0x38, 0xb4, 0x10, 0x87, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x80, 0x82, + 0x38, 0xb4, 0x80, 0x87, + 0x38, 0xb4, 0x03, 0x95, 0x38, 0xb4, 0x02, 0xf0, 0x38, 0xb4, 0x10, 0xa7, 0x38, 0xb4, 0x80, 0x95, @@ -15585,11 +16152,11 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xb5, 0x12, 0x38, 0xb4, 0x81, 0xcb, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x82, 0x48, + 0x38, 0xb4, 0xe2, 0x48, 0x38, 0xb4, 0x06, 0xd7, 0x38, 0xb4, 0x7a, 0x40, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x07, 0x48, + 0x38, 0xb4, 0x67, 0x48, 0x38, 0xb4, 0x06, 0xd7, 0x38, 0xb4, 0x5a, 0x40, 0x38, 0xb4, 0x10, 0x89, @@ -15611,7 +16178,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x40, 0x03, 0x38, 0xb4, 0x52, 0xcc, 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0xba, 0x42, + 0x38, 0xb4, 0xda, 0x42, 0x38, 0xb4, 0x03, 0x0c, 0x38, 0xb4, 0x02, 0x15, 0x38, 0xb4, 0x1f, 0x0c, @@ -15631,7 +16198,8 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x33, 0x7f, 0x38, 0xb4, 0x90, 0x81, 0x38, 0xb4, 0x04, 0x82, - 0x38, 0xb4, 0x16, 0xf0, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x85, 0x80, 0x38, 0xb4, 0x03, 0x0c, 0x38, 0xb4, 0x02, 0x15, 0x38, 0xb4, 0x1f, 0x0c, @@ -15650,18 +16218,20 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x33, 0x7f, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x47, 0x60, - 0x38, 0xb4, 0x02, 0xf0, - 0x38, 0xb4, 0x0c, 0xf0, + 0x38, 0xb4, 0x67, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x85, 0x80, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x90, 0x80, 0x38, 0xb4, 0x03, 0xd4, - 0x38, 0xb4, 0x82, 0xcb, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x03, 0x12, + 0x38, 0xb4, 0x82, 0xcb, 0x38, 0xb4, 0x0a, 0xd4, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x03, 0x12, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x47, 0x42, + 0x38, 0xb4, 0x67, 0x42, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x1d, 0x13, 0x38, 0xb4, 0x40, 0x8a, @@ -15678,7 +16248,258 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x04, 0xa7, 0x38, 0xb4, 0x03, 0x95, 0x38, 0xb4, 0x88, 0xcb, - 0x38, 0xb4, 0x12, 0xf0, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xa9, 0x81, + 0x38, 0xb4, 0x02, 0xd7, + 0x38, 0xb4, 0x21, 0x61, + 0x38, 0xb4, 0x02, 0xd7, + 0x38, 0xb4, 0x60, 0x40, + 0x38, 0xb4, 0x0d, 0xd7, + 0x38, 0xb4, 0xbd, 0x40, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0x7a, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xac, 0x80, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x98, 0x81, + 0x38, 0xb4, 0x10, 0xa2, + 0x38, 0xb4, 0x10, 0x8a, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x3e, 0x64, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x04, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x40, 0x00, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x01, + 0x38, 0xb4, 0xe0, 0x0c, + 0x38, 0xb4, 0xe0, 0x03, + 0x38, 0xb4, 0xce, 0xcc, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x10, 0xd1, + 0x38, 0xb4, 0x4c, 0xd0, + 0x38, 0xb4, 0xa0, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x10, 0x87, + 0x38, 0xb4, 0x0f, 0xaa, + 0x38, 0xb4, 0x30, 0xa1, + 0x38, 0xb4, 0x2f, 0xaa, + 0x38, 0xb4, 0xd5, 0xa2, + 0x38, 0xb4, 0x05, 0xa4, + 0x38, 0xb4, 0x20, 0xa7, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0xa1, 0xcb, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xf6, 0x80, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xf1, 0x3c, + 0x38, 0xb4, 0xd7, 0x80, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x02, 0x0d, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xd9, 0x80, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x01, 0x0d, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x40, 0x0d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x10, 0x87, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x0e, 0x12, + 0x38, 0xb4, 0x08, 0xa1, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x20, 0x12, + 0x38, 0xb4, 0x08, 0x81, + 0x38, 0xb4, 0x03, 0xa2, + 0x38, 0xb4, 0x2f, 0x8a, + 0x38, 0xb4, 0x30, 0xa1, + 0x38, 0xb4, 0x04, 0x82, + 0xff, 0xff, 0xff, 0xff, + 0x6c, 0xe8, 0x00, 0xa0, + 0x38, 0xb4, 0x40, 0xa1, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x20, 0x12, + 0x38, 0xb4, 0x40, 0x81, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x17, 0x12, + 0x38, 0xb4, 0xa2, 0xcb, + 0x38, 0xb4, 0x7a, 0xd1, + 0x38, 0xb4, 0x4b, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x04, 0xa2, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xa7, 0x5f, + 0x38, 0xb4, 0x20, 0xb9, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xb4, 0x7f, + 0x38, 0xb4, 0x20, 0x99, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x45, 0x61, + 0x38, 0xb4, 0x74, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x00, 0x81, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xa7, 0x5f, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xfa, 0x80, + 0x38, 0xb4, 0x20, 0xb8, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xa5, 0x7f, + 0x38, 0xb4, 0x20, 0x98, + 0x38, 0xb4, 0x01, 0x9b, + 0x38, 0xb4, 0x02, 0xd4, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x03, 0x12, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0xb1, 0x33, + 0x38, 0xb4, 0x20, 0x81, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0xb5, 0x60, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x69, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x22, 0x81, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x88, 0x81, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xab, 0x40, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x10, 0x81, + 0x38, 0xb4, 0x84, 0x82, + 0x38, 0xb4, 0x04, 0x84, + 0x38, 0xb4, 0x10, 0xa7, + 0x38, 0xb4, 0x20, 0x81, + 0x38, 0xb4, 0x41, 0x82, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x0e, 0x12, + 0x38, 0xb4, 0x04, 0xa1, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x20, 0x12, + 0x38, 0xb4, 0x04, 0x81, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x17, 0x12, + 0x38, 0xb4, 0x2f, 0xaa, + 0x38, 0xb4, 0xa3, 0xcb, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x8b, 0x43, + 0x38, 0xb4, 0x84, 0xa2, + 0x38, 0xb4, 0x78, 0xd0, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x10, 0x81, + 0x38, 0xb4, 0x84, 0xa2, + 0x38, 0xb4, 0x04, 0x84, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x08, 0xa1, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x19, 0x0f, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xb3, 0x5f, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x1f, 0x8f, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x33, 0x7f, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x07, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x10, 0x81, + 0x38, 0xb4, 0x84, 0xa2, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0xa4, 0xcb, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xa1, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x10, 0xad, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x4b, 0x41, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x80, 0x00, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x01, + 0x38, 0xb4, 0xe0, 0x0c, + 0x38, 0xb4, 0x40, 0x03, + 0x38, 0xb4, 0x52, 0xcc, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x71, 0x81, + 0x38, 0xb4, 0xc0, 0x80, + 0x38, 0xb4, 0x03, 0x81, + 0x38, 0xb4, 0xe0, 0x83, + 0x38, 0xb4, 0xff, 0x8c, + 0x38, 0xb4, 0x93, 0xd1, + 0x38, 0xb4, 0x47, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x10, 0xa1, + 0x38, 0xb4, 0xa5, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xaa, 0x5f, + 0x38, 0xb4, 0x80, 0xa1, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x41, 0x60, + 0x38, 0xb4, 0x02, 0xa4, + 0x38, 0xb4, 0xa6, 0xcb, + 0x38, 0xb4, 0xf5, 0xd1, + 0x38, 0xb4, 0x49, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x10, 0x87, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0x90, 0xa1, + 0x38, 0xb4, 0x04, 0xa2, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0xa7, 0xcb, + 0x38, 0xb4, 0x80, 0xbb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x20, 0xb9, + 0x38, 0xb4, 0x80, 0x9b, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xd7, 0x81, 0x38, 0xb4, 0x10, 0xa2, 0x38, 0xb4, 0x0a, 0xa0, 0x38, 0xb4, 0x40, 0xaa, @@ -15704,132 +16525,394 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x6b, 0x12, 0x38, 0xb4, 0x00, 0xd7, 0x38, 0xb4, 0x59, 0x35, - 0x38, 0xb4, 0xa8, 0x80, - 0x38, 0xb4, 0xfb, 0xff, + 0x38, 0xb4, 0xb4, 0x81, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xad, 0x81, 0x38, 0xb4, 0x00, 0xd7, 0x38, 0xb4, 0x4b, 0x60, 0x38, 0xb4, 0x8a, 0xcb, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0x59, 0x36, - 0x38, 0xb4, 0xb1, 0x80, - 0x38, 0xb4, 0xfb, 0xff, + 0x38, 0xb4, 0x59, 0x36, + 0x38, 0xb4, 0xbe, 0x81, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xb7, 0x81, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x6b, 0x60, + 0x38, 0xb4, 0x8b, 0xcb, + 0x38, 0xb4, 0xcb, 0x5e, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x41, 0x60, + 0x38, 0xb4, 0x02, 0xa4, + 0x38, 0xb4, 0x8c, 0xcb, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xba, 0x60, + 0x38, 0xb4, 0x79, 0xd1, + 0x38, 0xb4, 0x49, 0xd0, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xce, 0x81, + 0x38, 0xb4, 0x60, 0xd1, + 0x38, 0xb4, 0x4b, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x8d, 0xcb, + 0x38, 0xb4, 0x10, 0x87, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xd4, 0x5f, + 0x38, 0xb4, 0x20, 0xb9, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xb4, 0x7f, + 0x38, 0xb4, 0x20, 0x99, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x45, 0x61, + 0x38, 0xb4, 0x74, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xdc, 0x81, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xab, 0x5f, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xd6, 0x81, + 0x38, 0xb4, 0x10, 0xa7, + 0x38, 0xb4, 0x20, 0xb8, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xa5, 0x7f, + 0x38, 0xb4, 0x20, 0x98, + 0x38, 0xb4, 0x14, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xba, 0x5f, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x76, 0x5f, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x34, 0x5f, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x81, 0x60, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x5a, 0x40, + 0x38, 0xb4, 0x80, 0xa4, + 0x38, 0xb4, 0x86, 0xcb, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xba, 0x60, + 0x38, 0xb4, 0xc8, 0xd1, + 0x38, 0xb4, 0x45, 0xd0, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x08, 0x82, + 0x38, 0xb4, 0x7a, 0xd1, + 0x38, 0xb4, 0x4b, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x01, 0x01, + 0x38, 0xb4, 0xe0, 0x0c, + 0x38, 0xb4, 0x20, 0x03, + 0x38, 0xb4, 0x29, 0xcc, + 0x38, 0xb4, 0x08, 0xa2, + 0x38, 0xb4, 0x04, 0x82, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xf5, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x80, 0x87, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x04, 0x8e, + 0x38, 0xb4, 0x14, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xf4, 0x5f, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x3e, 0x0c, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x9d, 0x60, + 0x38, 0xb4, 0x17, 0xd4, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x03, 0x12, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x89, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x7a, 0x5f, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x36, 0x5f, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x89, 0x60, + 0x38, 0xb4, 0x0c, 0xd4, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x03, 0x12, + 0x38, 0xb4, 0x40, 0xaa, + 0x38, 0xb4, 0x10, 0xbb, + 0x38, 0xb4, 0x50, 0xcb, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x10, 0xa3, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x5f, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x89, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x75, 0x5f, + 0x38, 0xb4, 0x90, 0x81, + 0x38, 0xb4, 0xa0, 0x82, + 0x38, 0xb4, 0x02, 0x84, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x18, 0x87, + 0x38, 0xb4, 0x10, 0x9b, + 0x38, 0xb4, 0x20, 0x9b, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0xb5, 0x7f, + 0x38, 0xb4, 0x51, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x94, 0x5f, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xa9, 0x61, + 0x38, 0xb4, 0x02, 0xd7, + 0x38, 0xb4, 0xa1, 0x40, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x79, 0x40, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x9d, 0x60, + 0x38, 0xb4, 0x41, 0xd1, + 0x38, 0xb4, 0x43, 0xd0, + 0x38, 0xb4, 0x06, 0xf0, + 0x38, 0xb4, 0x01, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x41, 0xd1, + 0x38, 0xb4, 0x44, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0x6b, 0x60, - 0x38, 0xb4, 0x8b, 0xcb, - 0x38, 0xb4, 0xeb, 0x5e, + 0x38, 0xb4, 0xe5, 0x60, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xbe, 0x60, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xb1, 0x29, + 0x38, 0xb4, 0x70, 0x82, + 0x38, 0xb4, 0x02, 0xf0, + 0x38, 0xb4, 0x80, 0xa8, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0x90, 0xa1, + 0x38, 0xb4, 0x20, 0x82, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x20, 0xa6, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xaa, 0xc5, + 0x38, 0xb4, 0x03, 0x95, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0x41, 0x60, + 0x38, 0xb4, 0x61, 0x60, 0x38, 0xb4, 0x02, 0xa4, - 0x38, 0xb4, 0x8c, 0xcb, - 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0x9a, 0x60, - 0x38, 0xb4, 0xb7, 0xd1, - 0x38, 0xb4, 0x49, 0xd0, - 0x38, 0xb4, 0x03, 0xf0, - 0x38, 0xb4, 0x60, 0xd1, - 0x38, 0xb4, 0x4b, 0xd0, + 0x38, 0xb4, 0x80, 0xa4, + 0x38, 0xb4, 0x52, 0xcb, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xb4, 0x5f, - 0x38, 0xb4, 0x8d, 0xcb, - 0x38, 0xb4, 0x10, 0x87, - 0x38, 0xb4, 0x1f, 0xd7, - 0x38, 0xb4, 0xd4, 0x5f, + 0x38, 0xb4, 0xba, 0x5f, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x76, 0x5f, 0x38, 0xb4, 0x20, 0xb9, + 0x38, 0xb4, 0x53, 0xcb, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, 0x38, 0xb4, 0x1f, 0xd7, 0x38, 0xb4, 0xb4, 0x7f, 0x38, 0xb4, 0x20, 0x99, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0x90, 0xa1, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x20, 0x82, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x80, 0xb5, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xa1, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x02, 0xa6, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x10, 0xa3, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x60, 0xcb, + 0x38, 0xb4, 0x01, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, - 0x38, 0xb4, 0x1f, 0xd7, - 0x38, 0xb4, 0x05, 0x61, - 0x38, 0xb4, 0x54, 0x60, - 0x38, 0xb4, 0xfb, 0xff, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x10, 0xaa, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x33, 0x28, + 0x38, 0xb4, 0xa9, 0x82, + 0x38, 0xb4, 0x03, 0xf0, 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x30, 0x13, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xa6, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x40, 0xa1, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xa3, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x20, 0xac, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x0c, 0xa9, + 0x38, 0xb4, 0x80, 0xaa, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x07, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x0a, 0xa0, + 0x38, 0xb4, 0x90, 0xa1, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x20, 0x82, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x80, 0xb5, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x00, 0xc5, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0xe0, 0x83, + 0x38, 0xb4, 0x01, 0x8e, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xab, 0x5f, - 0x38, 0xb4, 0xf0, 0xff, - 0x38, 0xb4, 0x10, 0xa7, - 0x38, 0xb4, 0x20, 0xb8, + 0x38, 0xb4, 0xa1, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x02, 0xa6, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x4a, 0xd1, + 0x38, 0xb4, 0x58, 0xd0, 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0x6b, 0x12, - 0x38, 0xb4, 0x1f, 0xd7, - 0x38, 0xb4, 0xa5, 0x7f, - 0x38, 0xb4, 0x20, 0x98, - 0x38, 0xb4, 0x14, 0xd1, - 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0xd7, 0x12, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x63, 0x40, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xea, 0x12, + 0x38, 0xb4, 0x6f, 0xcb, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, - 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xba, 0x5f, 0x38, 0xb4, 0x04, 0xd7, - 0x38, 0xb4, 0x76, 0x5f, - 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0x34, 0x5f, - 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0x81, 0x60, - 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0x5a, 0x40, - 0x38, 0xb4, 0x80, 0xa4, - 0x38, 0xb4, 0x86, 0xcb, + 0x38, 0xb4, 0x70, 0x2e, + 0x38, 0xb4, 0x17, 0x83, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x6e, 0x67, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x68, 0x38, + 0x38, 0xb4, 0xf2, 0x82, 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0x9a, 0x60, - 0x38, 0xb4, 0xc8, 0xd1, - 0x38, 0xb4, 0x45, 0xd0, - 0x38, 0xb4, 0x03, 0xf0, - 0x38, 0xb4, 0x7a, 0xd1, - 0x38, 0xb4, 0x4b, 0xd0, - 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0xc2, 0x61, + 0x38, 0xb4, 0x0c, 0xd7, + 0xff, 0xff, 0xff, 0xff, + 0x6c, 0xe8, 0x00, 0xa0, + 0x38, 0xb4, 0x18, 0x2f, + 0x38, 0xb4, 0xf8, 0x82, 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xb4, 0x5f, - 0x38, 0xb4, 0xc0, 0x0c, - 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x35, 0x5d, 0x38, 0xb4, 0x03, 0x0c, - 0x38, 0xb4, 0x01, 0x01, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xaa, 0xc5, + 0x38, 0xb4, 0x03, 0x95, 0x38, 0xb4, 0xe0, 0x0c, 0x38, 0xb4, 0x20, 0x03, - 0x38, 0xb4, 0x29, 0xcc, - 0x38, 0xb4, 0x08, 0xa2, - 0x38, 0xb4, 0x04, 0x82, - 0x38, 0xb4, 0x14, 0xd1, - 0x38, 0xb4, 0x40, 0xd0, - 0x38, 0xb4, 0x00, 0xd7, - 0x38, 0xb4, 0xf4, 0x5f, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x3e, 0x0c, - 0x38, 0xb4, 0x06, 0xd7, - 0x38, 0xb4, 0x9d, 0x60, - 0x38, 0xb4, 0x17, 0xd4, + 0x38, 0xb4, 0xfe, 0x82, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xaa, 0xc5, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x1e, 0x83, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xaa, 0xc5, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x20, 0x83, 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0x03, 0x12, + 0x38, 0xb4, 0xd7, 0x12, + 0x38, 0xb4, 0x02, 0xae, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x63, 0x40, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xea, 0x12, + 0x38, 0xb4, 0x61, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x6b, 0x12, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x70, 0x2e, + 0x38, 0xb4, 0x17, 0x83, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x68, 0x38, + 0x38, 0xb4, 0x1e, 0x83, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xe2, 0x61, + 0x38, 0xb4, 0x1f, 0xd7, + 0x38, 0xb4, 0x2e, 0x61, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x18, 0x2f, + 0x38, 0xb4, 0x20, 0x83, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x2e, 0x0d, + 0x38, 0xb4, 0xfe, 0x82, + 0x38, 0xb4, 0x02, 0x8e, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x99, 0x0f, + 0x38, 0xb4, 0x04, 0xae, + 0x38, 0xb4, 0x10, 0x83, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x31, 0x0e, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x9c, 0x85, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x07, 0x0e, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0xbe, 0x17, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0xa4, 0x5f, 0x38, 0xb4, 0x06, 0xa7, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0x8b, 0x40, - 0x38, 0xb4, 0x01, 0xa7, - 0x38, 0xb4, 0x02, 0xa5, + 0x38, 0xb4, 0x4b, 0x40, 0x38, 0xb4, 0x80, 0xa8, 0x38, 0xb4, 0x01, 0x88, 0x38, 0xb4, 0x01, 0x8e, 0x38, 0xb4, 0x50, 0xca, 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0xb6, 0x81, + 0x38, 0xb4, 0xc5, 0x83, 0x38, 0xb4, 0x51, 0xca, 0x38, 0xb4, 0x0e, 0xd7, 0x38, 0xb4, 0x10, 0x22, - 0x38, 0xb4, 0xb4, 0x81, + 0x38, 0xb4, 0xc3, 0x83, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x84, 0x40, 0x38, 0xb4, 0x05, 0xd7, @@ -15838,7 +16921,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0xc2, 0x17, 0x38, 0xb4, 0x0c, 0xd7, - 0x38, 0xb4, 0xa2, 0x5c, + 0x38, 0xb4, 0xe2, 0x5c, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x92, 0x16, 0x38, 0xb4, 0x0c, 0xd7, @@ -15852,12 +16935,12 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x62, 0xca, 0x38, 0xb4, 0x05, 0xd7, 0x38, 0xb4, 0x84, 0x30, - 0x38, 0xb4, 0x96, 0x81, + 0x38, 0xb4, 0xa5, 0x83, 0x38, 0xb4, 0x10, 0xba, 0x38, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x10, - 0x38, 0xb4, 0x90, 0x82, + 0x38, 0xb4, 0x9e, 0x84, 0x38, 0xb4, 0x03, 0x0c, 0x38, 0xb4, 0x00, 0x01, 0x38, 0xb4, 0x02, 0xd7, @@ -15939,19 +17022,17 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xc0, 0x81, 0x38, 0xb4, 0x80, 0xae, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x3b, 0x81, + 0x38, 0xb4, 0x4a, 0x83, 0x38, 0xb4, 0x04, 0x88, 0x38, 0xb4, 0x04, 0xa7, 0x38, 0xb4, 0x88, 0x87, - 0x38, 0xb4, 0x80, 0xff, + 0x38, 0xb4, 0x82, 0xff, 0x38, 0xb4, 0x08, 0xbb, 0x38, 0xb4, 0x1f, 0x0c, - 0x38, 0xb4, 0x8b, 0x03, + 0x38, 0xb4, 0x07, 0x09, 0x38, 0xb4, 0x40, 0x89, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0xdb, 0x17, - 0xff, 0xff, 0xff, 0xff, - 0x6c, 0xe8, 0x00, 0xa0, 0x38, 0xb4, 0x01, 0x87, 0x38, 0xb4, 0x02, 0x85, 0x38, 0xb4, 0xf4, 0xa0, @@ -15975,12 +17056,14 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x04, 0x88, 0x38, 0xb4, 0x06, 0xa7, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x15, 0x81, + 0x38, 0xb4, 0x26, 0x83, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x7c, 0x14, 0x38, 0xb4, 0x05, 0xd7, 0x38, 0xb4, 0x5f, 0x40, - 0x38, 0xb4, 0x36, 0xf0, + 0x38, 0xb4, 0x37, 0xf0, + 0x38, 0xb4, 0x01, 0xd7, + 0x38, 0xb4, 0x59, 0x42, 0x38, 0xb4, 0x05, 0xd7, 0x38, 0xb4, 0x34, 0x62, 0x38, 0xb4, 0x0c, 0xd7, @@ -15992,20 +17075,19 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x04, 0xd7, 0x38, 0xb4, 0x27, 0x61, 0x38, 0xb4, 0x51, 0x29, - 0x38, 0xb4, 0xcb, 0x81, + 0x38, 0xb4, 0xdc, 0x83, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x83, 0x40, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x81, 0x2e, - 0x38, 0xb4, 0xcb, 0x81, - 0x38, 0xb4, 0xc5, 0xf0, + 0x38, 0xb4, 0xdc, 0x83, + 0x38, 0xb4, 0xc2, 0xf0, 0x38, 0xb4, 0xfe, 0x80, 0x38, 0xb4, 0x10, 0x86, 0x38, 0xb4, 0x01, 0x85, 0x38, 0xb4, 0x04, 0x87, 0x38, 0xb4, 0x30, 0x0c, 0x38, 0xb4, 0x10, 0x04, - 0x38, 0xb4, 0x01, 0xa7, 0x38, 0xb4, 0x02, 0xac, 0x38, 0xb4, 0x02, 0xa5, 0x38, 0xb4, 0x80, 0x89, @@ -16014,7 +17096,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x65, 0x60, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0xdc, 0x81, + 0x38, 0xb4, 0xec, 0x83, 0x38, 0xb4, 0x04, 0x80, 0x38, 0xb4, 0x04, 0xa8, 0x38, 0xb4, 0x0f, 0x0c, @@ -16033,14 +17115,14 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0xdb, 0x17, 0x38, 0xb4, 0x80, 0xa7, - 0x38, 0xb4, 0xa2, 0xf0, + 0x38, 0xb4, 0xa0, 0xf0, 0x38, 0xb4, 0x04, 0xd7, - 0x38, 0xb4, 0xeb, 0x63, + 0x38, 0xb4, 0xab, 0x63, 0x38, 0xb4, 0x05, 0xd7, - 0x38, 0xb4, 0xb1, 0x43, + 0x38, 0xb4, 0x71, 0x43, 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0x9c, 0x33, - 0x38, 0xb4, 0x8f, 0x82, + 0x38, 0xb4, 0x9d, 0x84, 0x38, 0xb4, 0x88, 0x87, 0x38, 0xb4, 0x04, 0x87, 0x38, 0xb4, 0x1f, 0x0c, @@ -16063,8 +17145,6 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x01, 0x87, 0x38, 0xb4, 0x02, 0x85, 0x38, 0xb4, 0x02, 0x8c, - 0x38, 0xb4, 0x01, 0xa7, - 0x38, 0xb4, 0x02, 0xa5, 0x38, 0xb4, 0x82, 0xf0, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0xc5, 0x60, @@ -16072,7 +17152,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x53, 0x60, 0x38, 0xb4, 0x7d, 0xf0, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x8c, 0x82, + 0x38, 0xb4, 0x9a, 0x84, 0x38, 0xb4, 0x0d, 0xd7, 0x38, 0xb4, 0x1b, 0x4d, 0x38, 0xb4, 0x10, 0xba, @@ -16106,7 +17186,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0x57, 0x49, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x7e, 0x82, + 0x38, 0xb4, 0x8c, 0x84, 0x38, 0xb4, 0xc0, 0xa1, 0x38, 0xb4, 0x3f, 0x0c, 0x38, 0xb4, 0x20, 0x02, @@ -16177,7 +17257,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0x58, 0x60, 0x38, 0xb4, 0x02, 0xf0, - 0x38, 0xb4, 0xc7, 0xfe, + 0x38, 0xb4, 0xc8, 0xfe, 0x38, 0xb4, 0xc0, 0x81, 0x38, 0xb4, 0x80, 0x88, 0x38, 0xb4, 0x06, 0x87, @@ -16208,7 +17288,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x80, 0xa2, 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0xd0, 0x3b, - 0x38, 0xb4, 0xa0, 0x82, + 0x38, 0xb4, 0xae, 0x84, 0x38, 0xb4, 0x3f, 0x0c, 0x38, 0xb4, 0x23, 0x02, 0x38, 0xb4, 0x03, 0xf0, @@ -16266,11 +17346,13 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x6a, 0x60, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0xe8, 0x17, + 0xff, 0xff, 0xff, 0xff, + 0x6c, 0xe8, 0x00, 0xa0, 0x38, 0xb4, 0x0c, 0xd7, 0x38, 0xb4, 0x3c, 0x5f, 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0xd0, 0x3b, - 0x38, 0xb4, 0xde, 0x82, + 0x38, 0xb4, 0xec, 0x84, 0x38, 0xb4, 0x3f, 0x0c, 0x38, 0xb4, 0x0c, 0x02, 0x38, 0xb4, 0x02, 0xf0, @@ -16333,7 +17415,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xe8, 0x17, 0x38, 0xb4, 0x02, 0xd7, 0x38, 0xb4, 0x9c, 0x39, - 0x38, 0xb4, 0x11, 0x83, + 0x38, 0xb4, 0x1f, 0x85, 0x38, 0xb4, 0x40, 0x82, 0x38, 0xb4, 0x88, 0x87, 0x38, 0xb4, 0x02, 0xd7, @@ -16366,21 +17448,199 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x5f, 0xff, 0x38, 0xb4, 0x05, 0xd7, 0x38, 0xb4, 0xdd, 0x3c, - 0x38, 0xb4, 0x40, 0x83, + 0x38, 0xb4, 0x4e, 0x85, 0x38, 0xb4, 0x5b, 0xff, 0x38, 0xb4, 0xfc, 0x0c, 0x38, 0xb4, 0x90, 0x03, 0x38, 0xb4, 0xfc, 0x0c, 0x38, 0xb4, 0x90, 0x05, 0x38, 0xb4, 0x00, 0x08, - 0x38, 0xb4, 0x50, 0xcb, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xf9, 0x60, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x58, 0x69, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x02, 0x69, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x01, 0x10, + 0x38, 0xb4, 0x20, 0xa2, + 0x38, 0xb4, 0x04, 0xa4, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x54, 0x40, + 0x38, 0xb4, 0x40, 0xa7, + 0x38, 0xb4, 0x04, 0xa5, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xb5, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x03, 0xa0, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x90, 0x81, + 0x38, 0xb4, 0x91, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xb9, 0x7f, + 0x38, 0xb4, 0x20, 0x82, + 0x38, 0xb4, 0x04, 0x84, + 0x38, 0xb4, 0x80, 0xa2, + 0x38, 0xb4, 0x10, 0xa1, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x41, 0x40, + 0x38, 0xb4, 0x80, 0xa1, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x0c, 0x13, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x0f, 0x85, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x08, 0x0d, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x80, 0x0d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x5f, 0x61, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x03, 0x61, + 0x38, 0xb4, 0x04, 0x85, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xb5, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x03, 0x80, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x92, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xa3, 0x7f, + 0x38, 0xb4, 0x80, 0x82, + 0x38, 0xb4, 0x90, 0x81, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x0f, 0x0c, + 0x38, 0xb4, 0x0a, 0x05, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x00, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x01, 0x10, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x00, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0xb9, 0x40, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x63, 0x60, + 0x38, 0xb4, 0x20, 0xa0, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0x20, 0x80, + 0x38, 0xb4, 0x04, 0xa5, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xb5, 0x40, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0x03, 0xa0, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x54, 0x40, + 0x38, 0xb4, 0x40, 0xa7, + 0x38, 0xb4, 0x90, 0x81, + 0x38, 0xb4, 0x93, 0xcb, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0x63, 0x60, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x9c, 0x60, + 0x38, 0xb4, 0x4b, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x20, 0xd1, + 0x38, 0xb4, 0x40, 0xd0, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x00, 0xd7, + 0x38, 0xb4, 0xb4, 0x5f, + 0x38, 0xb4, 0x08, 0xa0, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0x40, 0x40, + 0x38, 0xb4, 0x02, 0xa0, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0x79, 0x40, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0x13, 0x13, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xf0, 0x85, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0xd9, 0x40, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x83, 0x60, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x09, 0x0d, + 0x38, 0xb4, 0x03, 0xf0, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x0a, 0x0d, + 0x38, 0xb4, 0xc0, 0x0c, + 0x38, 0xb4, 0x80, 0x0d, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x20, 0x80, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0x99, 0x41, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0x5f, 0x61, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0x03, 0x61, + 0x38, 0xb4, 0x04, 0x85, + 0x38, 0xb4, 0x04, 0xd7, + 0x38, 0xb4, 0xb5, 0x40, 0x38, 0xb4, 0x03, 0x0c, 0x38, 0xb4, 0x02, 0x15, - 0x38, 0xb4, 0x10, 0xa3, + 0x38, 0xb4, 0x03, 0x80, 0x38, 0xb4, 0x03, 0x95, - 0x38, 0xb4, 0x5f, 0xcb, + 0x38, 0xb4, 0x94, 0xcb, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xaf, 0x10, + 0x38, 0xb4, 0x06, 0xd7, + 0x38, 0xb4, 0xa2, 0x7f, + 0x38, 0xb4, 0x0a, 0x80, + 0x38, 0xb4, 0x03, 0x0c, + 0x38, 0xb4, 0x02, 0x15, + 0x38, 0xb4, 0xf0, 0x85, + 0x38, 0xb4, 0x03, 0x95, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0xb9, 0x40, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x00, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x05, 0xf0, + 0x38, 0xb4, 0x1f, 0x0c, + 0x38, 0xb4, 0x07, 0x0d, + 0x38, 0xb4, 0xc0, 0x8d, + 0x38, 0xb4, 0x90, 0xa1, + 0x38, 0xb4, 0x00, 0x10, + 0x38, 0xb4, 0xb5, 0x12, + 0x38, 0xb4, 0x05, 0xd7, + 0x38, 0xb4, 0xcc, 0x39, + 0x38, 0xb4, 0x07, 0x86, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x01, 0x10, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x3e, 0x0d, + 0x38, 0xb4, 0xb7, 0x82, 0x38, 0xb4, 0x13, 0xcb, 0x38, 0xb4, 0x06, 0xd7, 0x38, 0xb4, 0x89, 0x60, @@ -16436,7 +17696,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0xd7, 0x38, 0xb4, 0xb4, 0x5f, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0x59, 0x83, + 0x38, 0xb4, 0x19, 0x86, 0x38, 0xb4, 0x0a, 0x80, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x0e, 0x12, @@ -16462,9 +17722,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, 0x38, 0xb4, 0x1f, 0xd7, - 0xff, 0xff, 0xff, 0xff, 0x38, 0xb4, 0x8b, 0x7f, - 0x6c, 0xe8, 0x00, 0xa0, 0x38, 0xb4, 0x08, 0x9a, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x81, 0x05, @@ -16511,7 +17769,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x03, 0x0c, 0x38, 0xb4, 0x02, 0x09, 0x38, 0xb4, 0x00, 0x18, - 0x38, 0xb4, 0xa1, 0x83, + 0x38, 0xb4, 0x61, 0x86, 0x38, 0xb4, 0x0a, 0xa0, 0x38, 0xb4, 0x08, 0x93, 0x38, 0xb4, 0x10, 0xb2, @@ -16525,7 +17783,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x09, 0xd4, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x03, 0x12, - 0x38, 0xb4, 0x1e, 0xd1, + 0x38, 0xb4, 0x03, 0xd1, 0x38, 0xb4, 0x4c, 0xd0, 0x38, 0xb4, 0x00, 0x10, 0x38, 0xb4, 0x6b, 0x12, @@ -16533,12 +17791,20 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xb4, 0x5f, 0x38, 0xb4, 0x00, 0x18, 0x38, 0xb4, 0x81, 0x05, + 0x38, 0xb4, 0x0c, 0xd7, + 0x38, 0xb4, 0xb3, 0x60, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xa3, 0x86, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0x1a, 0x00, + 0x38, 0xb4, 0x00, 0x18, + 0x38, 0xb4, 0xcb, 0x12, 0x36, 0xb4, 0x0e, 0xa1, - 0x38, 0xb4, 0xff, 0xff, + 0x38, 0xb4, 0xcf, 0x12, 0x36, 0xb4, 0x0c, 0xa1, 0x38, 0xb4, 0xf8, 0x04, 0x36, 0xb4, 0x0a, 0xa1, - 0x38, 0xb4, 0x3d, 0x0d, + 0x38, 0xb4, 0x03, 0x10, 0x36, 0xb4, 0x08, 0xa1, 0x38, 0xb4, 0xfb, 0x15, 0x36, 0xb4, 0x06, 0xa1, @@ -16546,19 +17812,19 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x36, 0xb4, 0x04, 0xa1, 0x38, 0xb4, 0xcb, 0x0e, 0x36, 0xb4, 0x02, 0xa1, - 0x38, 0xb4, 0xca, 0x09, + 0x38, 0xb4, 0x19, 0x11, 0x36, 0xb4, 0x00, 0xa1, 0x38, 0xb4, 0x60, 0x09, 0x36, 0xb4, 0x10, 0xa1, - 0x38, 0xb4, 0x7f, 0x00, + 0x38, 0xb4, 0xff, 0x00, 0x6c, 0xe8, 0x00, 0xa0, 0x36, 0xb4, 0x16, 0xa0, 0x38, 0xb4, 0x20, 0x00, 0x36, 0xb4, 0x12, 0xa0, 0x38, 0xb4, 0xf8, 0x1f, 0x36, 0xb4, 0x14, 0xa0, - 0x38, 0xb4, 0x00, 0x00, - 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x04, 0xa7, + 0x38, 0xb4, 0xb7, 0x82, 0x38, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x00, @@ -16566,9 +17832,9 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x00, 0x36, 0xb4, 0x64, 0xa1, - 0x38, 0xb4, 0xff, 0x3f, + 0x38, 0xb4, 0x9f, 0x11, 0x36, 0xb4, 0x66, 0xa1, - 0x38, 0xb4, 0xff, 0x3f, + 0x38, 0xb4, 0xa1, 0x11, 0x36, 0xb4, 0x68, 0xa1, 0x38, 0xb4, 0xff, 0x3f, 0x36, 0xb4, 0x6a, 0xa1, @@ -16582,7 +17848,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x36, 0xb4, 0x72, 0xa1, 0x38, 0xb4, 0xff, 0x3f, 0x36, 0xb4, 0x62, 0xa1, - 0x38, 0xb4, 0x00, 0x00, + 0x38, 0xb4, 0x03, 0x00, 0x6c, 0xe8, 0x00, 0xa0, 0x36, 0xb4, 0x7c, 0xb8, 0x38, 0xb4, 0x63, 0x8a, @@ -16592,13 +17858,15 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xb6, 0x8a, 0x38, 0xb4, 0x8a, 0xaf, 0x38, 0xb4, 0xaf, 0xd6, + 0xff, 0xff, 0xff, 0xff, + 0x6c, 0xe8, 0x00, 0xa0, 0x38, 0xb4, 0xe4, 0x8a, 0x38, 0xb4, 0x8a, 0xaf, 0x38, 0xb4, 0xaf, 0xf2, - 0x38, 0xb4, 0x07, 0x8b, + 0x38, 0xb4, 0x01, 0x8b, 0x38, 0xb4, 0x8b, 0xaf, - 0x38, 0xb4, 0xaf, 0x07, - 0x38, 0xb4, 0x07, 0x8b, + 0x38, 0xb4, 0xaf, 0x0a, + 0x38, 0xb4, 0x10, 0x8b, 0x38, 0xb4, 0x35, 0xad, 0x38, 0xb4, 0xbf, 0x27, 0x38, 0xb4, 0x08, 0x73, @@ -16659,16 +17927,21 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x64, 0x0c, 0x38, 0xb4, 0x0c, 0xaf, 0x38, 0xb4, 0xe0, 0xcc, - 0x38, 0xb4, 0x13, 0x80, - 0x38, 0xb4, 0x6b, 0x02, - 0x38, 0xb4, 0xad, 0xa4, - 0x38, 0xb4, 0x09, 0x21, - 0x38, 0xb4, 0x64, 0x02, - 0x38, 0xb4, 0xbf, 0x47, - 0x38, 0xb4, 0x9b, 0x76, - 0x38, 0xb4, 0x7a, 0x02, - 0x38, 0xb4, 0xaf, 0xbc, - 0x38, 0xb4, 0x62, 0x65, + 0x38, 0xb4, 0xa5, 0x86, + 0x38, 0xb4, 0x25, 0xad, + 0x38, 0xb4, 0x02, 0x06, + 0x38, 0xb4, 0xa4, 0x6b, + 0x38, 0xb4, 0x65, 0x02, + 0x38, 0xb4, 0xaf, 0x4f, + 0x38, 0xb4, 0x9a, 0x6e, + 0x38, 0xb4, 0x24, 0xac, + 0x38, 0xb4, 0xaf, 0x03, + 0x38, 0xb4, 0xb4, 0x6b, + 0x38, 0xb4, 0x6b, 0xaf, + 0x38, 0xb4, 0x02, 0xb6, + 0x38, 0xb4, 0xe8, 0x7a, + 0x38, 0xb4, 0x6c, 0xaf, + 0x38, 0xb4, 0x00, 0xa1, 0x36, 0xb4, 0x5e, 0xb8, 0x38, 0xb4, 0x7f, 0x6a, 0x36, 0xb4, 0x60, 0xb8, @@ -16678,15 +17951,15 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x36, 0xb4, 0x64, 0xb8, 0x38, 0xb4, 0x61, 0x0c, 0x36, 0xb4, 0x86, 0xb8, - 0x38, 0xb4, 0x53, 0x65, + 0x38, 0xb4, 0x7c, 0x6e, 0x36, 0xb4, 0x88, 0xb8, - 0x38, 0xb4, 0xff, 0xff, + 0x38, 0xb4, 0xae, 0x6b, 0x36, 0xb4, 0x8a, 0xb8, - 0x38, 0xb4, 0xff, 0xff, + 0x38, 0xb4, 0x9b, 0x6c, 0x36, 0xb4, 0x8c, 0xb8, 0x38, 0xb4, 0xff, 0xff, 0x36, 0xb4, 0x38, 0xb8, - 0x38, 0xb4, 0x1f, 0x00, + 0x38, 0xb4, 0x7f, 0x00, 0x6c, 0xe8, 0x00, 0xb0, 0x20, 0xb8, 0x10, 0x00, 0x6c, 0xe8, 0x00, 0xa0, @@ -16698,17 +17971,17 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0xaf, 0x0c, 0x38, 0xb4, 0x13, 0x88, 0x38, 0xb4, 0x88, 0xaf, - 0x38, 0xb4, 0xaf, 0x13, - 0x38, 0xb4, 0x13, 0x88, + 0x38, 0xb4, 0xaf, 0x4b, + 0x38, 0xb4, 0x4b, 0x88, 0x38, 0xb4, 0x88, 0xaf, - 0x38, 0xb4, 0xaf, 0x13, - 0x38, 0xb4, 0x13, 0x88, + 0x38, 0xb4, 0xaf, 0x4b, + 0x38, 0xb4, 0x4b, 0x88, 0x38, 0xb4, 0x1d, 0xaf, 0x38, 0xb4, 0x02, 0x8a, 0x38, 0xb4, 0x4d, 0x86, 0x38, 0xb4, 0x10, 0x02, 0x38, 0xb4, 0xaf, 0x64, - 0x38, 0xb4, 0x52, 0x10, + 0x38, 0xb4, 0x63, 0x10, 0x38, 0xb4, 0xfa, 0xf8, 0x38, 0xb4, 0x69, 0xef, 0x38, 0xb4, 0x80, 0xe0, @@ -16936,6 +18209,34 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x38, 0xb4, 0x4c, 0x80, 0x38, 0xb4, 0xaf, 0x3a, 0x38, 0xb4, 0x27, 0x06, + 0x38, 0xb4, 0x88, 0xbf, + 0x38, 0xb4, 0x02, 0x48, + 0x38, 0xb4, 0xed, 0x77, + 0x38, 0xb4, 0x03, 0xd2, + 0x38, 0xb4, 0x83, 0xe0, + 0x38, 0xb4, 0x0d, 0x8a, + 0x38, 0xb4, 0xf6, 0x01, + 0x38, 0xb4, 0x1b, 0x27, + 0x38, 0xb4, 0xaa, 0x03, + 0x38, 0xb4, 0x82, 0x01, + 0x38, 0xb4, 0x83, 0xe0, + 0x38, 0xb4, 0x0d, 0x89, + 0x38, 0xb4, 0xf6, 0x01, + 0x38, 0xb4, 0x1b, 0x27, + 0x38, 0xb4, 0xaa, 0x03, + 0x38, 0xb4, 0x82, 0x01, + 0x38, 0xb4, 0x83, 0xe0, + 0x38, 0xb4, 0x0d, 0x88, + 0x38, 0xb4, 0xf6, 0x01, + 0x38, 0xb4, 0x1b, 0x27, + 0x38, 0xb4, 0xaa, 0x03, + 0x38, 0xb4, 0x82, 0x07, + 0x38, 0xb4, 0x88, 0xbf, + 0x38, 0xb4, 0x02, 0x48, + 0x38, 0xb4, 0xf6, 0x77, + 0x38, 0xb4, 0x16, 0xaf, + 0x38, 0xb4, 0x00, 0x15, + 0x38, 0xb4, 0x6a, 0xa8, 0x36, 0xb4, 0x18, 0xb8, 0x38, 0xb4, 0x84, 0x1d, 0x36, 0xb4, 0x1a, 0xb8, @@ -16943,7 +18244,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x36, 0xb4, 0x1c, 0xb8, 0x38, 0xb4, 0x23, 0x06, 0x36, 0xb4, 0x1e, 0xb8, - 0x38, 0xb4, 0xff, 0xff, + 0x38, 0xb4, 0xef, 0x15, 0x36, 0xb4, 0x50, 0xb8, 0x38, 0xb4, 0xff, 0xff, 0x36, 0xb4, 0x52, 0xb8, @@ -16953,7 +18254,7 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x36, 0xb4, 0x84, 0xb8, 0x38, 0xb4, 0xff, 0xff, 0x36, 0xb4, 0x32, 0xb8, - 0x38, 0xb4, 0x07, 0x00, + 0x38, 0xb4, 0x0f, 0x00, 0x36, 0xb4, 0x00, 0x00, 0x38, 0xb4, 0x00, 0x00, 0x6c, 0xe8, 0x00, 0xb0, @@ -16961,13 +18262,11 @@ static int rtl_ram_code_speed_up(struct r8152 *tp, bool wait) 0x6c, 0xe8, 0x00, 0xa0, 0x36, 0xb4, 0x23, 0x80, 0x38, 0xb4, 0x00, 0x00, - 0x36, 0xb4, 0x1e, 0x80, - 0x38, 0xb4, 0x04, 0x00, 0x6c, 0xe8, 0x00, 0xb0, 0x20, 0xb8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff}; - code_ver = 0x0004; + code_ver = 0x0013; ret = sram_read(tp, SRAM_GPHY_FW_VER, &fw_version); if (ret < 0) goto out; @@ -21150,9 +22449,6 @@ static void r8156b_hw_phy_cfg(struct r8152 *tp) /* disable ALDPS before updating the PHY parameters */ r8153_aldps_en(tp, false); - /* disable EEE before updating the PHY parameters */ - rtl_eee_enable(tp, false); - ret = r8153_phy_status(tp, PHY_STAT_LAN_ON); if (ret < 0) return; @@ -21406,8 +22702,7 @@ static void r8156b_hw_phy_cfg(struct r8152 *tp) ocp_reg_clr_bits(tp, 0xa5ea, BIT(0)); tp->ups_info.lite_mode = 0; - if (tp->eee_en) - rtl_eee_enable(tp, true); + rtl_eee_enable(tp, tp->eee_en); r8153_aldps_en(tp, true); r8152b_enable_fc(tp); @@ -21507,6 +22802,8 @@ static void r8157_hw_phy_cfg(struct r8152 *tp) r8156b_wait_loading_flash(tp); + r8157_patch_code(tp); + ocp_word_test_and_clr_bits(tp, MCU_TYPE_USB, USB_MISC_0, PCUT_STATUS); ret = r8153_phy_status(tp, 0); @@ -21545,6 +22842,9 @@ static void r8157_hw_phy_cfg(struct r8152 *tp) /* advanced Power Saving paramater */ ocp_reg_set_bits(tp, 0xa430, BIT(0) | BIT(1)); + /* aldpsce force mode */ + ocp_reg_clr_bits(tp, 0xa44a, BIT(2)); + switch (tp->version) { case RTL_VER_17: /* XG_INRX parameter */ @@ -21633,6 +22933,7 @@ static void r8157_hw_phy_cfg(struct r8152 *tp) ocp_reg_write(tp, OCP_SRAM_DATA, 0x0000); /* RFI-color noise gen parameter 5g */ + ocp_reg_set_bits(tp, 0xad9c, BIT(5)); ocp_reg_write(tp, 0xb87c, 0x8122); ocp_reg_w0w1(tp, 0xb87e, 0xff00, 0x0c00); ocp_reg_write(tp, 0xb87c, 0x82c8); @@ -21681,23 +22982,17 @@ static void r8157_hw_phy_cfg(struct r8152 *tp) ocp_reg_write(tp, 0xb87e, 0x0001); ocp_reg_write(tp, 0xb87e, 0x03f1); - /* spdchg_gtx_shape_100M */ - ocp_reg_write(tp, OCP_SRAM_ADDR, 0x8188); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0032); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0064); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0098); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00ca); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00fe); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00fe); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00fe); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00fe); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x00cc); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x009a); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0066); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0034); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0000); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0000); - ocp_reg_write(tp, OCP_SRAM_DATA, 0x0000); + /* modify thermal speed down threshold */ + ocp_reg_w0w1(tp, 0xb54c, 0xffc0, 0x3700); + + /* XG compatibility modification */ + ocp_reg_set_bits(tp, 0xb648, BIT(6)); + ocp_reg_write(tp, 0xb87c, 0x8082); + ocp_reg_w0w1(tp, 0xb87e, 0xff00, 0x5d00); + ocp_reg_write(tp, 0xb87c, 0x807c); + ocp_reg_w0w1(tp, 0xb87e, 0xff00, 0x5000); + ocp_reg_write(tp, 0xb87c, 0x809d); + ocp_reg_w0w1(tp, 0xb87e, 0xff00, 0x5000); break; default: break; @@ -21714,8 +23009,8 @@ static void r8157_hw_phy_cfg(struct r8152 *tp) tp->ups_info.eee_plloff_100 = false; tp->ups_info.eee_plloff_giga = false; - ocp_reg_clr_bits(tp, OCP_POWER_CFG, EEE_CLKDIV_EN); - tp->ups_info.eee_ckdiv = false; + ocp_reg_set_bits(tp, OCP_POWER_CFG, EEE_CLKDIV_EN); + tp->ups_info.eee_ckdiv = true; rtl_phy_patch_request(tp, false, true); @@ -22100,6 +23395,16 @@ static int r8157_init(struct r8152 *tp) if (test_bit(RTL8152_UNPLUG, &tp->flags)) return -ENODEV; + rtl_set_dbg_info_init(tp, 0x9); + + ret = ocp_byte_set_bits(tp, MCU_TYPE_USB, 0xcffe, BIT(3)); + if (ret < 0) + goto out; + + ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, 0xd3ca, BIT(0)); + if (ret < 0) + goto out; + ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, USB_ECM_OP, EN_ALL_SPEED); if (ret < 0) goto out; @@ -22156,6 +23461,24 @@ static int r8157_init(struct r8152 *tp) if (ret < 0) goto out; + /* Disable Interrupt Mitigation */ + ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, 0xcf04, + BIT(0) | BIT(1) | BIT(2) | BIT(7)); + if (ret < 0) + goto out; + + /* Disable all_speed_capability & rg_pwrdn_en */ + ret = ocp_word_clr_bits(tp, MCU_TYPE_USB, USB_SPEED_OPTION, + RG_PWRDN_EN | ALL_SPEED_OFF); + if (ret < 0) + goto out; + + /* Enable Auto Speed up */ + ret = ocp_word_set_bits(tp, MCU_TYPE_USB, USB_FW_CTRL, + AUTO_SPEEDUP); + if (ret < 0) + goto out; + /* MSC timer = 0xfff * 8ms = 32760 ms */ ret = ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff); if (ret < 0) @@ -22222,11 +23545,12 @@ static int r8157_init(struct r8152 *tp) if (ret < 0) goto out; - ret = r8156_mac_clk_spd(tp, false); + /* Disable bypass_turn_off_clk_in_aldps */ + ret = ocp_byte_clr_bits(tp, MCU_TYPE_PLA, 0xd3c8, BIT(0)); if (ret < 0) goto out; - ret = r8153b_mcu_spdown_en(tp, false); + ret = r8156_mac_clk_spd(tp, false); if (ret < 0) goto out; @@ -22241,9 +23565,14 @@ static int r8157_init(struct r8152 *tp) set_bit(GREEN_ETHERNET, &tp->flags); - /* rx aggregation */ + /* rx aggregation, 16 bytes Rx descriptor */ ret = ocp_word_clr_bits(tp, MCU_TYPE_USB, USB_USB_CTRL, - RX_AGG_DISABLE | RX_ZERO_EN); + RX_AGG_DISABLE | BIT(10)); + if (ret < 0) + goto out; + + /* Disable Rx Zero Len */ + ret = rtl_bmu_clr_bits(tp, 0x2300, BIT(3)); if (ret < 0) goto out; @@ -22253,6 +23582,11 @@ static int r8157_init(struct r8152 *tp) goto out; */ + /* TX descriptor Signature */ + ret = ocp_byte_clr_bits(tp, MCU_TYPE_USB, 0xd4ae, BIT(1)); + if (ret < 0) + goto out; + ret = r8156_mdio_force_mode(tp); if (ret < 0) goto out; @@ -23194,7 +24528,7 @@ static int rtl8152_get_link_ksettings(struct net_device *netdev, out2: usb_autopm_put_interface(tp->intf); out1: - return ret; + return (ret < 0) ? ret : 0; } static int rtl8152_set_link_ksettings(struct net_device *dev, @@ -23236,6 +24570,10 @@ static int rtl8152_set_link_ksettings(struct net_device *dev, cmd->link_modes.advertising)) advertising |= RTL_ADVERTISED_2500_FULL; + if (test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + cmd->link_modes.advertising)) + advertising |= RTL_ADVERTISED_5000_FULL; + mutex_lock(&tp->control); ret = rtl8152_set_speed(tp, cmd->base.autoneg, cmd->base.speed, @@ -23252,7 +24590,7 @@ static int rtl8152_set_link_ksettings(struct net_device *dev, usb_autopm_put_interface(tp->intf); out: - return ret; + return (ret < 0) ? ret : 0; } #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) */ @@ -23341,9 +24679,116 @@ static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) static int r8152_get_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + __ETHTOOL_DECLARE_LINK_MODE_MASK(common); + int ret; + u16 val; + + ret = r8152_mmd_read(tp, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->supported, val); + + ret = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->advertised, val); + + ret = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->lp_advertised, val); + + eee->eee_enabled = tp->eee_en; + + linkmode_and(common, eee->advertised, eee->lp_advertised); + eee->eee_active = phy_check_valid(tp->speed, tp->duplex, common); + +out: + return (ret < 0) ? ret : 0; +} + +static int r8152_set_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + u16 val = linkmode_to_mii_eee_cap1_t(eee->advertised); + + tp->eee_en = eee->eee_enabled; + tp->eee_adv = val; + + return rtl_eee_enable(tp, tp->eee_en); +} + +static int r8153_get_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + __ETHTOOL_DECLARE_LINK_MODE_MASK(common); + u16 val; + int ret; + + ret = ocp_reg_read(tp, OCP_EEE_ABLE, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->supported, val); + + ret = ocp_reg_read(tp, OCP_EEE_ADV, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->advertised, val); + + ret = ocp_reg_read(tp, OCP_EEE_LPABLE, &val); + if (ret < 0) + goto out; + mii_eee_cap1_mod_linkmode_t(eee->lp_advertised, val); + + eee->eee_enabled = tp->eee_en; + + linkmode_and(common, eee->advertised, eee->lp_advertised); + eee->eee_active = phy_check_valid(tp->speed, tp->duplex, common); + +out: + return (ret < 0) ? ret : 0; +} + +static int r8156_get_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + __ETHTOOL_DECLARE_LINK_MODE_MASK(common); + u16 val; + int ret; + + ret = r8153_get_eee(tp, eee); + if (ret < 0) + goto out; + + ret = ocp_reg_read(tp, OCP_EEE_ABLE2, &val); + if (ret < 0) + goto out; + mii_eee_cap2_mod_linkmode_sup_t(eee->supported, val); + + ret = ocp_reg_read(tp, OCP_EEE_ADV2, &val); + if (ret < 0) + goto out; + mii_eee_cap2_mod_linkmode_adv_t(eee->advertised, val); + + ret = ocp_reg_read(tp, OCP_EEE_LPABLE2, &val); + if (ret < 0) + goto out; + mii_eee_cap2_mod_linkmode_adv_t(eee->lp_advertised, val); + + linkmode_and(common, eee->advertised, eee->lp_advertised); + eee->eee_active = phy_check_valid(tp->speed, tp->duplex, common); + +out: + return (ret < 0) ? ret : 0; +} + +static int r8156_set_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + /* 2.5G EEE, 5G EEE */ + tp->eee_adv2 = linkmode_to_mii_eee_cap2_t(eee->advertised); + + return r8152_set_eee(tp, eee); +} #else static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee) -#endif { u32 lp, adv, supported = 0; int ret; @@ -23352,50 +24797,31 @@ static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee) ret = r8152_mmd_read(tp, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE, &val); if (ret < 0) goto out; - supported = mmd_eee_cap_to_ethtool_sup_t(val); ret = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, &val); if (ret < 0) goto out; - adv = mmd_eee_adv_to_ethtool_adv_t(val); ret = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE, &val); if (ret < 0) goto out; - lp = mmd_eee_adv_to_ethtool_adv_t(val); eee->eee_enabled = tp->eee_en; eee->eee_active = !!(supported & adv & lp); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) - ethtool_convert_legacy_u32_to_link_mode(eee->supported, supported); - ethtool_convert_legacy_u32_to_link_mode(eee->advertised, tp->eee_adv); - ethtool_convert_legacy_u32_to_link_mode(eee->lp_advertised, lp); -#else eee->supported = supported; eee->advertised = mmd_eee_adv_to_ethtool_adv_t(tp->eee_adv); eee->lp_advertised = lp; -#endif out: return (ret < 0) ? ret : 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) -static int r8152_set_eee(struct r8152 *tp, struct ethtool_keee *eee) -#else static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) - u32 advertised = 0; - ethtool_convert_link_mode_to_legacy_u32(&advertised, eee->advertised); - u16 val = ethtool_adv_to_mmd_eee_adv_t(advertised); -#else u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised); -#endif tp->eee_en = eee->eee_enabled; tp->eee_adv = val; @@ -23403,11 +24829,7 @@ static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee) return rtl_eee_enable(tp, tp->eee_en); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) -static int r8153_get_eee(struct r8152 *tp, struct ethtool_keee *eee) -#else static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee) -#endif { u32 lp, adv, supported = 0; u16 val; @@ -23430,26 +24852,27 @@ static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee) eee->eee_enabled = tp->eee_en; eee->eee_active = !!(supported & adv & lp); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) - ethtool_convert_legacy_u32_to_link_mode(eee->supported, supported); - ethtool_convert_legacy_u32_to_link_mode(eee->advertised, tp->eee_adv); - ethtool_convert_legacy_u32_to_link_mode(eee->lp_advertised, lp); -#else eee->supported = supported; eee->advertised = mmd_eee_adv_to_ethtool_adv_t(tp->eee_adv); eee->lp_advertised = lp; -#endif out: return (ret < 0) ? ret : 0; } +static int r8156_get_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + return r8153_get_eee(tp, eee); +} + +static int r8156_set_eee(struct r8152 *tp, struct ethtool_keee *eee) +{ + return r8152_set_eee(tp, eee); +} +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) */ + static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata) -#else -rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) -#endif { struct r8152 *tp = netdev_priv(net); int ret; @@ -23476,11 +24899,7 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) } static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0) rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata) -#else -rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) -#endif { struct r8152 *tp = netdev_priv(net); int ret; @@ -23497,8 +24916,11 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) mutex_lock(&tp->control); ret = tp->rtl_ops.eee_set(tp, edata); - if (!ret) + if (!ret) { ret = rtl_nway_restart(tp); + if (test_and_clear_bit(DISABLE_EEE_BOTTOM, &tp->flags)) + ret = rtl_disable_eee_bottom(tp); + } mutex_unlock(&tp->control); @@ -23700,7 +25122,7 @@ static int rtl8152_set_ringparam(struct net_device *netdev, { struct r8152 *tp = netdev_priv(netdev); - if (ring->rx_pending < (RTL8152_MAX_RX * 2)) + if (ring->rx_pending < RTL8152_MAX_RX) return -EINVAL; if (tp->rx_pending != ring->rx_pending) { @@ -24275,6 +25697,19 @@ static void rtl8153b_unload(struct r8152 *tp) rtl_set_dbg_info_state(tp, DGB_DRV_STATE_UNLOAD); } +static void rtl8157_unload(struct r8152 *tp) +{ + if (test_bit(RTL8152_UNPLUG, &tp->flags)) + return; + + r8153_power_cut_en(tp, false); + + /* Disable Interrupt Mitigation */ + if (ocp_byte_clr_bits(tp, MCU_TYPE_USB, 0xcf04, + BIT(0) | BIT(1) | BIT(2) | BIT(7)) < 0) + return; +} + static int r8152_desc_init(struct r8152 *tp) { tp->rx_desc.size = sizeof(struct rx_desc); @@ -24431,6 +25866,7 @@ static int rtl_ops_init(struct r8152 *tp) case RTL_VER_11: tp->eee_en = true; tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; + tp->eee_adv2 = MDIO_EEE_2_5GT; fallthrough; case RTL_VER_10: ops->init = r8156_init; @@ -24440,8 +25876,8 @@ static int rtl_ops_init(struct r8152 *tp) ops->down = rtl8156_down; ops->unload = rtl8153_unload; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) - ops->eee_get = r8153_get_eee; - ops->eee_set = r8152_set_eee; + ops->eee_get = r8156_get_eee; + ops->eee_set = r8156_set_eee; #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ ops->in_nway = rtl8153_in_nway; ops->hw_phy_cfg = r8156_hw_phy_cfg; @@ -24459,8 +25895,6 @@ static int rtl_ops_init(struct r8152 *tp) tp->support_2500full = 1; fallthrough; case RTL_VER_15: - tp->eee_en = true; - tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; ops->init = r8156b_init; ops->enable = rtl8156b_enable; ops->disable = rtl8153_disable; @@ -24468,8 +25902,8 @@ static int rtl_ops_init(struct r8152 *tp) ops->down = rtl8156_down; ops->unload = rtl8153_unload; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) - ops->eee_get = r8153_get_eee; - ops->eee_set = r8152_set_eee; + ops->eee_get = r8156_get_eee; + ops->eee_set = r8156_set_eee; #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ ops->in_nway = rtl8153_in_nway; ops->hw_phy_cfg = r8156b_hw_phy_cfg; @@ -24478,6 +25912,9 @@ static int rtl_ops_init(struct r8152 *tp) ops->phy_read = r8152_phy_read; ops->phy_write = r8152_phy_write; tp->rx_buf_sz = 48 * 1024; + tp->eee_en = true; + tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; + tp->eee_adv2 = MDIO_EEE_2_5GT; r8152_desc_init(tp); break; @@ -24512,10 +25949,10 @@ static int rtl_ops_init(struct r8152 *tp) ops->disable = rtl8153_disable; ops->up = rtl8157_up; ops->down = rtl8157_down; - ops->unload = rtl8153_unload; + ops->unload = rtl8157_unload; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) - ops->eee_get = r8153_get_eee; - ops->eee_set = r8152_set_eee; + ops->eee_get = r8156_get_eee; + ops->eee_set = r8156_set_eee; #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */ ops->in_nway = rtl8153_in_nway; ops->hw_phy_cfg = r8157_hw_phy_cfg; @@ -24524,10 +25961,11 @@ static int rtl_ops_init(struct r8152 *tp) ops->phy_read = r8157_phy_read; ops->phy_write = r8157_phy_write; tp->rx_buf_sz = 32 * 1024; - tp->eee_en = true; - tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; tp->support_2500full = 1; tp->support_5000full = 1; + tp->eee_en = true; + tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; + tp->eee_adv2 = MDIO_EEE_2_5GT | MDIO_EEE_5GT; r8157_desc_init(tp); break; @@ -25522,6 +26960,7 @@ static int rtl8152_probe(struct usb_interface *intf, case RTL_VER_12: case RTL_VER_13: case RTL_VER_15: + case RTL_VER_17: netdev->max_mtu = size_to_mtu(16 * 1024); break; case RTL_VER_01: