All patches automatically rebased.
Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200
Signed-off-by: John Audia <graysky@archlinux.us>
-LINUX_VERSION-5.10 = .108
-LINUX_KERNEL_HASH-5.10.108 = bf6cc2d6e0918b8f34d1cde2fa39a6ad69c45025425048be1a1dac4a5b3641d8
+LINUX_VERSION-5.10 = .109
+LINUX_KERNEL_HASH-5.10.109 = 18fb22ecb249669ea775474aee614dcb0697cab299068074fd9f0bafa32113dc
/**
* init_display() - initialize the display controller
*
-@@ -145,6 +151,22 @@ static int init_display(struct fbtft_par
+@@ -147,6 +153,22 @@ static int init_display(struct fbtft_par
return 0;
}
/**
* set_var() - apply LCD properties like rotation and BGR mode
*
-@@ -155,20 +177,32 @@ static int init_display(struct fbtft_par
+@@ -157,20 +179,32 @@ static int init_display(struct fbtft_par
static int set_var(struct fbtft_par *par)
{
u8 madctl_par = 0;
break;
default:
return -EINVAL;
-@@ -265,7 +299,16 @@ static struct fbtft_display display = {
+@@ -267,7 +301,16 @@ static struct fbtft_display display = {
},
};
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
-@@ -5695,6 +5695,9 @@ int __init cgroup_init_early(void)
+@@ -5720,6 +5720,9 @@ int __init cgroup_init_early(void)
return 0;
}
/**
* cgroup_init - cgroup initialization
*
-@@ -5733,6 +5736,12 @@ int __init cgroup_init(void)
+@@ -5758,6 +5761,12 @@ int __init cgroup_init(void)
mutex_unlock(&cgroup_mutex);
for_each_subsys(ss, ssid) {
if (ss->early_init) {
struct cgroup_subsys_state *css =
-@@ -6270,6 +6279,10 @@ static int __init cgroup_disable(char *s
+@@ -6296,6 +6305,10 @@ static int __init cgroup_disable(char *s
strcmp(token, ss->legacy_name))
continue;
static_branch_disable(cgroup_subsys_enabled_key[i]);
pr_info("Disabling %s control group subsystem\n",
ss->name);
-@@ -6279,6 +6292,31 @@ static int __init cgroup_disable(char *s
+@@ -6305,6 +6318,31 @@ static int __init cgroup_disable(char *s
}
__setup("cgroup_disable=", cgroup_disable);
drivers/net/dsa/mv88e6xxx/port.h | 2 ++
4 files changed, 81 insertions(+), 4 deletions(-)
-diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
-index 1992be77522a..a77c86e0321d 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -1586,6 +1586,26 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
+@@ -1586,6 +1586,26 @@ static int mv88e6xxx_port_check_hw_vlan(
return 0;
}
static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port,
bool vlan_filtering,
struct switchdev_trans *trans)
-@@ -1599,7 +1619,16 @@ static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port,
+@@ -1599,7 +1619,16 @@ static int mv88e6xxx_port_vlan_filtering
return chip->info->max_vid ? 0 : -EOPNOTSUPP;
mv88e6xxx_reg_lock(chip);
mv88e6xxx_reg_unlock(chip);
return err;
-@@ -1982,8 +2011,10 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
+@@ -1982,8 +2011,10 @@ static void mv88e6xxx_port_vlan_add(stru
struct mv88e6xxx_chip *chip = ds->priv;
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
u16 vid;
if (!chip->info->max_vid)
-@@ -2008,9 +2039,23 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
+@@ -2008,9 +2039,23 @@ static void mv88e6xxx_port_vlan_add(stru
dev_err(ds->dev, "p%d: failed to add VLAN %d%c\n", port,
vid, untagged ? 'u' : 't');
mv88e6xxx_reg_unlock(chip);
}
-@@ -2061,6 +2106,7 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
+@@ -2061,6 +2106,7 @@ static int mv88e6xxx_port_vlan_del(struc
const struct switchdev_obj_port_vlan *vlan)
{
struct mv88e6xxx_chip *chip = ds->priv;
u16 pvid, vid;
int err = 0;
-@@ -2079,7 +2125,9 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
+@@ -2079,7 +2125,9 @@ static int mv88e6xxx_port_vlan_del(struc
goto unlock;
if (vid == pvid) {
if (err)
goto unlock;
}
-diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
-index 51a7ff44478e..843803c3adf2 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -224,9 +224,15 @@ struct mv88e6xxx_policy {
u64 serdes_stats[2];
u64 atu_member_violation;
u64 atu_miss_violation;
-diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
-index dfd9e8292e9a..a7177aa254a8 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
-@@ -1062,6 +1062,27 @@ int mv88e6xxx_port_set_8021q_mode(struct mv88e6xxx_chip *chip, int port,
+@@ -1062,6 +1062,27 @@ int mv88e6xxx_port_set_8021q_mode(struct
return 0;
}
int mv88e6xxx_port_set_map_da(struct mv88e6xxx_chip *chip, int port)
{
u16 reg;
-diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
-index 44d76ac973f6..3390517df42e 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
-@@ -364,6 +364,8 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
+@@ -364,6 +364,8 @@ int mv88e6390x_port_set_cmode(struct mv8
phy_interface_t mode);
int mv88e6185_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
int mv88e6352_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
int mv88e6xxx_port_set_map_da(struct mv88e6xxx_chip *chip, int port);
int mv88e6095_port_set_upstream_port(struct mv88e6xxx_chip *chip, int port,
int upstream_port);
---
-2.34.1
-
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -899,6 +899,7 @@ struct fw_header {
+@@ -898,6 +898,7 @@ struct fw_header {
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
* <struct fw_mac> + <info> + <firmware data>.
* @fw_offset: offset of the firmware binary data. The start address of
* the data would be the address of struct fw_mac + @fw_offset.
* @fw_reg: the register to load the firmware. Depends on chip.
-@@ -912,6 +913,7 @@ struct fw_header {
+@@ -911,6 +912,7 @@ struct fw_header {
* @bp_num: the break point number which needs to be set for this firmware.
* Depends on the firmware.
* @bp: break points. Depends on firmware.
* @fw_ver_reg: the register to store the fw version.
* @fw_ver_data: the firmware version of the current type.
* @info: additional information for debugging, and is followed by the
-@@ -937,8 +939,10 @@ struct fw_mac {
+@@ -936,8 +938,10 @@ struct fw_mac {
/**
* struct fw_phy_patch_key - a firmware block used by RTL_FW_PHY_START.
* This is used to set patch key when loading the firmware of PHY.
*/
struct fw_phy_patch_key {
struct fw_block blk_hdr;
-@@ -951,6 +955,7 @@ struct fw_phy_patch_key {
+@@ -950,6 +954,7 @@ struct fw_phy_patch_key {
* struct fw_phy_nc - a firmware block used by RTL_FW_PHY_NC.
* The layout of the firmware block is:
* <struct fw_phy_nc> + <info> + <firmware data>.
* @fw_offset: offset of the firmware binary data. The start address of
* the data would be the address of struct fw_phy_nc + @fw_offset.
* @fw_reg: the register to load the firmware. Depends on chip.
-@@ -961,6 +966,7 @@ struct fw_phy_patch_key {
+@@ -960,6 +965,7 @@ struct fw_phy_patch_key {
* @mode_reg: the regitster of switching the mode.
* @mod_pre: the mode needing to be set before loading the firmware.
* @mod_post: the mode to be set when finishing to load the firmware.
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -964,8 +964,8 @@ struct fw_phy_patch_key {
+@@ -963,8 +963,8 @@ struct fw_phy_patch_key {
* @patch_en_addr: the register of enabling patch mode. Depends on chip.
* @patch_en_value: patch mode enabled mask. Depends on the firmware.
* @mode_reg: the regitster of switching the mode.
obj-$(CONFIG_USB_NET_SR9700) += sr9700.o
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -27,6 +27,7 @@
+@@ -26,6 +26,7 @@
#include <linux/acpi.h>
#include <linux/firmware.h>
#include <crypto/hash.h>
/* Information for net-next */
#define NETNEXT_VERSION "11"
-@@ -654,18 +655,6 @@ enum rtl_register_content {
+@@ -653,18 +654,6 @@ enum rtl_register_content {
#define INTR_LINK 0x0004
#define RTL8153_MAX_PACKET 9216 /* 9K */
#define RTL8153_MAX_MTU (RTL8153_MAX_PACKET - VLAN_ETH_HLEN - \
ETH_FCS_LEN)
-@@ -690,21 +679,9 @@ enum rtl8152_flags {
+@@ -689,21 +678,9 @@ enum rtl8152_flags {
LENOVO_MACPASSTHRU,
};
struct tally_counter {
__le64 tx_packets;
__le64 rx_packets;
-@@ -6625,7 +6602,7 @@ static int rtl_fw_init(struct r8152 *tp)
+@@ -6602,7 +6579,7 @@ static int rtl_fw_init(struct r8152 *tp)
return 0;
}
{
struct usb_device *udev = interface_to_usbdev(intf);
u32 ocp_data = 0;
-@@ -6683,12 +6660,13 @@ static u8 rtl_get_version(struct usb_int
+@@ -6660,12 +6637,13 @@ static u8 rtl_get_version(struct usb_int
return version;
}
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -2394,11 +2394,9 @@ static void tx_bottom(struct r8152 *tp)
+@@ -2393,11 +2393,9 @@ static void tx_bottom(struct r8152 *tp)
} while (res == 0);
}
if (test_bit(RTL8152_UNPLUG, &tp->flags))
return;
-@@ -6718,7 +6716,7 @@ static int rtl8152_probe(struct usb_inte
+@@ -6695,7 +6693,7 @@ static int rtl8152_probe(struct usb_inte
mutex_init(&tp->control);
INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t);
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -3444,59 +3444,76 @@ static void rtl_clear_bp(struct r8152 *t
+@@ -3443,59 +3443,76 @@ static void rtl_clear_bp(struct r8152 *t
ocp_write_word(tp, type, PLA_BP_BA, 0);
}
ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, tp->ocp_base);
-@@ -3981,7 +3998,7 @@ static void rtl8152_fw_mac_apply(struct
+@@ -3980,7 +3997,7 @@ static void rtl8152_fw_mac_apply(struct
dev_dbg(&tp->intf->dev, "successfully applied %s\n", mac->info);
}
{
struct rtl_fw *rtl_fw = &tp->rtl_fw;
const struct firmware *fw;
-@@ -4012,12 +4029,11 @@ static void rtl8152_apply_firmware(struc
+@@ -4011,12 +4028,11 @@ static void rtl8152_apply_firmware(struc
case RTL_FW_PHY_START:
key = (struct fw_phy_patch_key *)block;
key_addr = __le16_to_cpu(key->key_reg);
break;
case RTL_FW_PHY_NC:
rtl8152_fw_phy_nc_apply(tp, (struct fw_phy_nc *)block);
-@@ -4222,7 +4238,7 @@ static void rtl8152_disable(struct r8152
+@@ -4221,7 +4237,7 @@ static void rtl8152_disable(struct r8152
static void r8152b_hw_phy_cfg(struct r8152 *tp)
{
rtl_eee_enable(tp, tp->eee_en);
r8152_aldps_en(tp, true);
r8152b_enable_fc(tp);
-@@ -4504,7 +4520,7 @@ static void r8153_hw_phy_cfg(struct r815
+@@ -4503,7 +4519,7 @@ static void r8153_hw_phy_cfg(struct r815
/* disable EEE before updating the PHY parameters */
rtl_eee_enable(tp, false);
if (tp->version == RTL_VER_03) {
data = ocp_reg_read(tp, OCP_EEE_CFG);
-@@ -4578,7 +4594,7 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4577,7 +4593,7 @@ static void r8153b_hw_phy_cfg(struct r81
/* disable EEE before updating the PHY parameters */
rtl_eee_enable(tp, false);
r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags));
-@@ -4619,7 +4635,7 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4618,7 +4634,7 @@ static void r8153b_hw_phy_cfg(struct r81
ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data);
/* Advnace EEE */
data = ocp_reg_read(tp, OCP_POWER_CFG);
data |= EEE_CLKDIV_EN;
ocp_reg_write(tp, OCP_POWER_CFG, data);
-@@ -4636,7 +4652,7 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4635,7 +4651,7 @@ static void r8153b_hw_phy_cfg(struct r81
ocp_reg_write(tp, OCP_SYSCLK_CFG, clk_div_expo(5));
tp->ups_info._250m_ckdiv = true;
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -1372,6 +1372,10 @@ void write_mii_word(struct net_device *n
+@@ -1371,6 +1371,10 @@ void write_mii_word(struct net_device *n
static int
r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
{
struct r8152 *tp = netdev_priv(netdev);
-@@ -3183,8 +3187,6 @@ static void r8153b_ups_en(struct r8152 *
+@@ -3182,8 +3186,6 @@ static void r8153b_ups_en(struct r8152 *
ocp_data |= BIT(0);
ocp_write_byte(tp, MCU_TYPE_USB, 0xcfff, ocp_data);
} else {
ocp_data &= ~(UPS_EN | USP_PREWAKE);
ocp_write_byte(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data);
-@@ -3192,31 +3194,20 @@ static void r8153b_ups_en(struct r8152 *
+@@ -3191,31 +3193,20 @@ static void r8153b_ups_en(struct r8152 *
ocp_data &= ~BIT(0);
ocp_write_byte(tp, MCU_TYPE_USB, 0xcfff, ocp_data);
}
}
}
-@@ -4588,13 +4579,37 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4587,13 +4578,37 @@ static void r8153b_hw_phy_cfg(struct r81
u32 ocp_data;
u16 data;
r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags));
-@@ -5543,9 +5558,6 @@ static void r8153b_init(struct r8152 *tp
+@@ -5522,9 +5537,6 @@ static void r8153b_init(struct r8152 *tp
/* MSC timer = 0xfff * 8ms = 32760 ms */
ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff);
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -3336,7 +3336,7 @@ static void rtl8153b_runtime_enable(stru
+@@ -3335,7 +3335,7 @@ static void rtl8153b_runtime_enable(stru
r8153b_ups_en(tp, false);
r8153_queue_wake(tp, false);
rtl_runtime_suspend_enable(tp, false);
r8153b_u1u2en(tp, true);
}
}
-@@ -5029,7 +5029,7 @@ static void rtl8153b_up(struct r8152 *tp
+@@ -5028,7 +5028,7 @@ static void rtl8153b_up(struct r8152 *tp
r8153_aldps_en(tp, true);
r8153b_u1u2en(tp, true);
}
-@@ -5571,8 +5571,9 @@ static void r8153b_init(struct r8152 *tp
+@@ -5550,8 +5550,9 @@ static void r8153b_init(struct r8152 *tp
ocp_data |= POLL_LINK_CHG;
ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data);
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -5758,6 +5758,9 @@ static int rtl8152_runtime_suspend(struc
+@@ -5735,6 +5735,9 @@ static int rtl8152_runtime_suspend(struc
struct net_device *netdev = tp->netdev;
int ret = 0;
set_bit(SELECTIVE_SUSPEND, &tp->flags);
smp_mb__after_atomic();
-@@ -6157,6 +6160,11 @@ rtl_ethtool_get_eee(struct net_device *n
+@@ -6134,6 +6137,11 @@ rtl_ethtool_get_eee(struct net_device *n
struct r8152 *tp = netdev_priv(net);
int ret;
ret = usb_autopm_get_interface(tp->intf);
if (ret < 0)
goto out;
-@@ -6179,6 +6187,11 @@ rtl_ethtool_set_eee(struct net_device *n
+@@ -6156,6 +6164,11 @@ rtl_ethtool_set_eee(struct net_device *n
struct r8152 *tp = netdev_priv(net);
int ret;
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -6594,7 +6594,7 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -6571,7 +6571,7 @@ static int rtl_ops_init(struct r8152 *tp
default:
ret = -ENODEV;
break;
}
-@@ -6851,7 +6851,7 @@ static int rtl8152_probe(struct usb_inte
+@@ -6828,7 +6828,7 @@ static int rtl8152_probe(struct usb_inte
ret = register_netdev(netdev);
if (ret != 0) {
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -2633,21 +2633,24 @@ static inline u8 rtl8152_get_speed(struc
+@@ -2632,21 +2632,24 @@ static inline u8 rtl8152_get_speed(struc
return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS);
}
}
static void rxdy_gated_en(struct r8152 *tp, bool enable)
-@@ -3128,10 +3131,22 @@ static void r8153b_ups_flags(struct r815
+@@ -3127,10 +3130,22 @@ static void r8153b_ups_flags(struct r815
ocp_write_dword(tp, MCU_TYPE_USB, USB_UPS_FLAGS, ups_flags);
}
if (enable) {
sram_write(tp, 0x8045, 0); /* 10M abiq&ldvbias */
sram_write(tp, 0x804d, 0x1222); /* 100M short abiq&ldvbias */
-@@ -3142,11 +3157,7 @@ static void r8153b_green_en(struct r8152
+@@ -3141,11 +3156,7 @@ static void r8153b_green_en(struct r8152
sram_write(tp, 0x805d, 0x2444); /* 1000M short abiq&ldvbias */
}
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -250,6 +250,9 @@
+@@ -249,6 +249,9 @@
/* PLA_TCR1 */
#define VERSION_MASK 0x7cf0
/* PLA_MTPS */
#define MTPS_JUMBO (12 * 1024 / 64)
-@@ -2748,6 +2751,29 @@ static int rtl_stop_rx(struct r8152 *tp)
+@@ -2747,6 +2750,29 @@ static int rtl_stop_rx(struct r8152 *tp)
return 0;
}
static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
{
ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
-@@ -2851,6 +2877,8 @@ static int rtl8153_enable(struct r8152 *
+@@ -2850,6 +2876,8 @@ static int rtl8153_enable(struct r8152 *
r8153_set_rx_early_timeout(tp);
r8153_set_rx_early_size(tp);
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -875,6 +875,14 @@ struct fw_header {
+@@ -874,6 +874,14 @@ struct fw_header {
struct fw_block blocks[];
} __packed;
/**
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
-@@ -3801,10 +3809,7 @@ static long rtl8152_check_firmware(struc
+@@ -3800,10 +3808,7 @@ static long rtl8152_check_firmware(struc
{
const struct firmware *fw = rtl_fw->fw;
struct fw_header *fw_hdr = (struct fw_header *)fw->data;
long ret = -EFAULT;
int i;
-@@ -3833,50 +3838,52 @@ static long rtl8152_check_firmware(struc
+@@ -3832,50 +3837,52 @@ static long rtl8152_check_firmware(struc
goto fail;
goto fw_end;
case RTL_FW_PLA:
dev_err(&tp->intf->dev,
"Check PHY_STOP fail\n");
goto fail;
-@@ -3887,28 +3894,28 @@ static long rtl8152_check_firmware(struc
+@@ -3886,28 +3893,28 @@ static long rtl8152_check_firmware(struc
"Invalid length for PHY_STOP\n");
goto fail;
}
break;
default:
-@@ -3922,7 +3929,7 @@ static long rtl8152_check_firmware(struc
+@@ -3921,7 +3928,7 @@ static long rtl8152_check_firmware(struc
}
fw_end:
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -658,15 +658,13 @@ enum rtl_register_content {
+@@ -657,15 +657,13 @@ enum rtl_register_content {
#define INTR_LINK 0x0004
/* rtl8152 flags */
enum rtl8152_flags {
-@@ -796,6 +794,7 @@ struct r8152 {
+@@ -795,6 +793,7 @@ struct r8152 {
bool (*in_nway)(struct r8152 *tp);
void (*hw_phy_cfg)(struct r8152 *tp);
void (*autosuspend_en)(struct r8152 *tp, bool enable);
} rtl_ops;
struct ups_info {
-@@ -1022,8 +1021,7 @@ enum tx_csum_stat {
+@@ -1021,8 +1020,7 @@ enum tx_csum_stat {
static const int multicast_filter_limit = 32;
static unsigned int agg_buf_sz = 16384;
static
int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
-@@ -2633,10 +2631,7 @@ static void rtl8152_nic_reset(struct r81
+@@ -2632,10 +2630,7 @@ static void rtl8152_nic_reset(struct r81
static void set_tx_qlen(struct r8152 *tp)
{
}
static inline u8 rtl8152_get_speed(struct r8152 *tp)
-@@ -4725,6 +4720,12 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4724,6 +4719,12 @@ static void r8153b_hw_phy_cfg(struct r81
set_bit(PHY_RESET, &tp->flags);
}
static void r8153_first_init(struct r8152 *tp)
{
u32 ocp_data;
-@@ -4757,9 +4758,7 @@ static void r8153_first_init(struct r815
+@@ -4756,9 +4757,7 @@ static void r8153_first_init(struct r815
rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
ocp_data |= TCR0_AUTO_FIFO;
-@@ -4794,8 +4793,7 @@ static void r8153_enter_oob(struct r8152
+@@ -4793,8 +4792,7 @@ static void r8153_enter_oob(struct r8152
wait_oob_link_list_ready(tp);
switch (tp->version) {
case RTL_VER_03:
-@@ -6518,12 +6516,21 @@ static int rtl8152_change_mtu(struct net
+@@ -6495,12 +6493,21 @@ static int rtl8152_change_mtu(struct net
dev->mtu = new_mtu;
if (netif_running(dev)) {
}
mutex_unlock(&tp->control);
-@@ -6612,6 +6619,7 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -6589,6 +6596,7 @@ static int rtl_ops_init(struct r8152 *tp
ops->in_nway = rtl8153_in_nway;
ops->hw_phy_cfg = r8153_hw_phy_cfg;
ops->autosuspend_en = rtl8153_runtime_enable;
if (tp->udev->speed < USB_SPEED_SUPER)
tp->rx_buf_sz = 16 * 1024;
else
-@@ -6633,6 +6641,7 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -6610,6 +6618,7 @@ static int rtl_ops_init(struct r8152 *tp
ops->in_nway = rtl8153_in_nway;
ops->hw_phy_cfg = r8153b_hw_phy_cfg;
ops->autosuspend_en = rtl8153b_runtime_enable;
tp->rx_buf_sz = 32 * 1024;
tp->eee_en = true;
tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX;
-@@ -6853,7 +6862,7 @@ static int rtl8152_probe(struct usb_inte
+@@ -6830,7 +6839,7 @@ static int rtl8152_probe(struct usb_inte
netdev->max_mtu = ETH_DATA_LEN;
break;
default:
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -44,10 +44,14 @@
+@@ -43,10 +43,14 @@
#define PLA_IDR 0xc000
#define PLA_RCR 0xc010
#define PLA_DMY_REG0 0xc0b0
#define PLA_FMC 0xc0b4
#define PLA_CFG_WOL 0xc0b6
-@@ -64,6 +68,8 @@
+@@ -63,6 +67,8 @@
#define PLA_MACDBG_PRE 0xd38c /* RTL_VER_04 only */
#define PLA_MACDBG_POST 0xd38e /* RTL_VER_04 only */
#define PLA_EXTRA_STATUS 0xd398
#define PLA_EFUSE_DATA 0xdd00
#define PLA_EFUSE_CMD 0xdd02
#define PLA_LEDSEL 0xdd90
-@@ -73,6 +79,8 @@
+@@ -72,6 +78,8 @@
#define PLA_LWAKE_CTRL_REG 0xe007
#define PLA_GPHY_INTR_IMR 0xe022
#define PLA_EEE_CR 0xe040
#define PLA_EEEP_CR 0xe080
#define PLA_MAC_PWR_CTRL 0xe0c0
#define PLA_MAC_PWR_CTRL2 0xe0ca
-@@ -83,6 +91,7 @@
+@@ -82,6 +90,7 @@
#define PLA_TCR1 0xe612
#define PLA_MTPS 0xe615
#define PLA_TXFIFO_CTRL 0xe618
#define PLA_RSTTALLY 0xe800
#define PLA_CR 0xe813
#define PLA_CRWECR 0xe81c
-@@ -99,6 +108,7 @@
+@@ -98,6 +107,7 @@
#define PLA_SFF_STS_7 0xe8de
#define PLA_PHYSTATUS 0xe908
#define PLA_CONFIG6 0xe90a /* CONFIG6 */
#define PLA_BP_BA 0xfc26
#define PLA_BP_0 0xfc28
#define PLA_BP_1 0xfc2a
-@@ -113,6 +123,7 @@
+@@ -112,6 +122,7 @@
#define USB_USB2PHY 0xb41e
#define USB_SSPHYLINK1 0xb426
#define USB_SSPHYLINK2 0xb428
#define USB_U2P3_CTRL 0xb460
#define USB_CSR_DUMMY1 0xb464
#define USB_CSR_DUMMY2 0xb466
-@@ -123,7 +134,12 @@
+@@ -122,7 +133,12 @@
#define USB_FW_FIX_EN0 0xcfca
#define USB_FW_FIX_EN1 0xcfcc
#define USB_LPM_CONFIG 0xcfd8
#define USB_FW_CTRL 0xd334 /* RTL8153B */
#define USB_FC_TIMER 0xd340
#define USB_USB_CTRL 0xd406
-@@ -137,16 +153,20 @@
+@@ -136,16 +152,20 @@
#define USB_RX_EXTRA_AGGR_TMR 0xd432 /* RTL8153B */
#define USB_TX_DMA 0xd434
#define USB_UPT_RXDMA_OWN 0xd437
#define USB_UPS_CFG 0xd842
#define USB_UPS_FLAGS 0xd848
#define USB_WDT1_CTRL 0xe404
-@@ -189,6 +209,9 @@
+@@ -188,6 +208,9 @@
#define OCP_EEE_ABLE 0xa5c4
#define OCP_EEE_ADV 0xa5d0
#define OCP_EEE_LPABLE 0xa5d2
#define OCP_PHY_STATE 0xa708 /* nway state for 8153 */
#define OCP_PHY_PATCH_STAT 0xb800
#define OCP_PHY_PATCH_CMD 0xb820
-@@ -200,6 +223,7 @@
+@@ -199,6 +222,7 @@
/* SRAM Register */
#define SRAM_GREEN_CFG 0x8011
#define SRAM_LPF_CFG 0x8012
#define SRAM_10M_AMP1 0x8080
#define SRAM_10M_AMP2 0x8082
#define SRAM_IMPEDANCE 0x8084
-@@ -211,11 +235,19 @@
+@@ -210,11 +234,19 @@
#define RCR_AM 0x00000004
#define RCR_AB 0x00000008
#define RCR_ACPT_ALL (RCR_AAP | RCR_APM | RCR_AM | RCR_AB)
/* PLA_RXFIFO_CTRL1 */
#define RXFIFO_THR2_FULL 0x00000060
#define RXFIFO_THR2_HIGH 0x00000038
-@@ -286,6 +318,7 @@
+@@ -285,6 +317,7 @@
#define MCU_BORW_EN 0x4000
/* PLA_CPCR */
#define CPCR_RX_VLAN 0x0040
/* PLA_CFG_WOL */
-@@ -311,6 +344,10 @@
+@@ -310,6 +343,10 @@
/* PLA_CONFIG6 */
#define LANWAKE_CLR_EN BIT(0)
/* PLA_CONFIG5 */
#define BWF_EN 0x0040
#define MWF_EN 0x0020
-@@ -334,6 +371,7 @@
+@@ -333,6 +370,7 @@
/* PLA_MAC_PWR_CTRL2 */
#define EEE_SPDWN_RATIO 0x8007
#define MAC_CLK_SPDWN_EN BIT(15)
/* PLA_MAC_PWR_CTRL3 */
#define PLA_MCU_SPDWN_EN BIT(14)
-@@ -346,6 +384,7 @@
+@@ -345,6 +383,7 @@
#define PWRSAVE_SPDWN_EN 0x1000
#define RXDV_SPDWN_EN 0x0800
#define TX10MIDLE_EN 0x0100
#define TP100_SPDWN_EN 0x0020
#define TP500_SPDWN_EN 0x0010
#define TP1000_SPDWN_EN 0x0008
-@@ -386,6 +425,13 @@
+@@ -385,6 +424,13 @@
#define LINK_CHANGE_FLAG BIT(8)
#define POLL_LINK_CHG BIT(0)
/* USB_USB2PHY */
#define USB2PHY_SUSPEND 0x0001
#define USB2PHY_L1 0x0002
-@@ -434,6 +480,9 @@
+@@ -433,6 +479,9 @@
#define BMU_RESET_EP_IN 0x01
#define BMU_RESET_EP_OUT 0x02
/* USB_UPT_RXDMA_OWN */
#define OWN_UPDATE BIT(0)
#define OWN_CLEAR BIT(1)
-@@ -441,27 +490,52 @@
+@@ -440,27 +489,52 @@
/* USB_FW_TASK */
#define FC_PATCH_TASK BIT(1)
/* USB_POWER_CUT */
#define PWR_EN 0x0001
-@@ -497,8 +571,12 @@
+@@ -496,8 +570,12 @@
#define SEN_VAL_NORMAL 0xa000
#define SEL_RXIDLE 0x0100
/* USB_UPS_FLAGS */
#define UPS_FLAGS_R_TUNE BIT(0)
-@@ -506,6 +584,7 @@
+@@ -505,6 +583,7 @@
#define UPS_FLAGS_250M_CKDIV BIT(2)
#define UPS_FLAGS_EN_ALDPS BIT(3)
#define UPS_FLAGS_CTAP_SHORT_DIS BIT(4)
#define ups_flags_speed(x) ((x) << 16)
#define UPS_FLAGS_EN_EEE BIT(20)
#define UPS_FLAGS_EN_500M_EEE BIT(21)
-@@ -526,6 +605,8 @@ enum spd_duplex {
+@@ -525,6 +604,8 @@ enum spd_duplex {
FORCE_10M_FULL,
FORCE_100M_HALF,
FORCE_100M_FULL,
};
/* OCP_ALDPS_CONFIG */
-@@ -590,6 +671,9 @@ enum spd_duplex {
+@@ -589,6 +670,9 @@ enum spd_duplex {
#define EN_10M_CLKDIV BIT(11)
#define EN_10M_BGOFF 0x0080
/* OCP_PHY_STATE */
#define TXDIS_STATE 0x01
#define ABD_STATE 0x02
-@@ -609,7 +693,8 @@ enum spd_duplex {
+@@ -608,7 +692,8 @@ enum spd_duplex {
#define EN_EMI_L 0x0040
/* OCP_SYSCLK_CFG */
/* SRAM_GREEN_CFG */
#define GREEN_ETH_EN BIT(15)
-@@ -640,6 +725,11 @@ enum spd_duplex {
+@@ -639,6 +724,11 @@ enum spd_duplex {
#define BP4_SUPER_ONLY 0x1578 /* RTL_VER_04 only */
enum rtl_register_content {
_1000bps = 0x10,
_100bps = 0x08,
_10bps = 0x04,
-@@ -647,6 +737,9 @@ enum rtl_register_content {
+@@ -646,6 +736,9 @@ enum rtl_register_content {
FULL_DUP = 0x01,
};
#define RTL8152_MAX_TX 4
#define RTL8152_MAX_RX 10
#define INTBUFSIZE 2
-@@ -661,7 +754,6 @@ enum rtl_register_content {
+@@ -660,7 +753,6 @@ enum rtl_register_content {
#define RTL8152_RMS (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
#define RTL8153_RMS RTL8153_MAX_PACKET
#define RTL8152_TX_TIMEOUT (5 * HZ)
#define mtu_to_size(m) ((m) + VLAN_ETH_HLEN + ETH_FCS_LEN)
#define size_to_mtu(s) ((s) - VLAN_ETH_HLEN - ETH_FCS_LEN)
#define rx_reserved_size(x) (mtu_to_size(x) + sizeof(struct rx_desc) + RX_ALIGN)
-@@ -798,6 +890,7 @@ struct r8152 {
+@@ -797,6 +889,7 @@ struct r8152 {
} rtl_ops;
struct ups_info {
u32 _10m_ckdiv:1;
u32 _250m_ckdiv:1;
u32 aldps:1;
-@@ -839,7 +932,9 @@ struct r8152 {
+@@ -838,7 +931,9 @@ struct r8152 {
u32 rx_buf_sz;
u32 rx_copybreak;
u32 rx_pending;
u16 ocp_base;
u16 speed;
u16 eee_adv;
-@@ -999,6 +1094,15 @@ enum rtl_version {
+@@ -998,6 +1093,15 @@ enum rtl_version {
RTL_VER_07,
RTL_VER_08,
RTL_VER_09,
RTL_VER_MAX
};
-@@ -1014,6 +1118,7 @@ enum tx_csum_stat {
+@@ -1013,6 +1117,7 @@ enum tx_csum_stat {
#define RTL_ADVERTISED_100_FULL BIT(3)
#define RTL_ADVERTISED_1000_HALF BIT(4)
#define RTL_ADVERTISED_1000_FULL BIT(5)
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
* The RTL chips use a 64 element hash table based on the Ethernet CRC.
-@@ -2607,7 +2712,7 @@ static netdev_tx_t rtl8152_start_xmit(st
+@@ -2606,7 +2711,7 @@ static netdev_tx_t rtl8152_start_xmit(st
static void r8152b_reset_packet_filter(struct r8152 *tp)
{
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_FMC);
ocp_data &= ~FMC_FCR_MCU_EN;
-@@ -2618,14 +2723,47 @@ static void r8152b_reset_packet_filter(s
+@@ -2617,14 +2722,47 @@ static void r8152b_reset_packet_filter(s
static void rtl8152_nic_reset(struct r8152 *tp)
{
}
}
-@@ -2634,9 +2772,9 @@ static void set_tx_qlen(struct r8152 *tp
+@@ -2633,9 +2771,9 @@ static void set_tx_qlen(struct r8152 *tp
tp->tx_qlen = agg_buf_sz / (mtu_to_size(tp->netdev->mtu) + sizeof(struct tx_desc));
}
}
static void rtl_eee_plus_en(struct r8152 *tp, bool enable)
-@@ -2796,6 +2934,7 @@ static int rtl_enable(struct r8152 *tp)
+@@ -2795,6 +2933,7 @@ static int rtl_enable(struct r8152 *tp)
switch (tp->version) {
case RTL_VER_08:
case RTL_VER_09:
r8153b_rx_agg_chg_indicate(tp);
break;
default:
-@@ -2833,6 +2972,7 @@ static void r8153_set_rx_early_timeout(s
+@@ -2832,6 +2971,7 @@ static void r8153_set_rx_early_timeout(s
case RTL_VER_08:
case RTL_VER_09:
/* The RTL8153B uses USB_RX_EXTRA_AGGR_TMR for rx timeout
* primarily. For USB_RX_EARLY_TIMEOUT, we fix it to 128ns.
*/
-@@ -2842,6 +2982,18 @@ static void r8153_set_rx_early_timeout(s
+@@ -2841,6 +2981,18 @@ static void r8153_set_rx_early_timeout(s
ocp_data);
break;
default:
break;
}
-@@ -2861,8 +3013,19 @@ static void r8153_set_rx_early_size(stru
+@@ -2860,8 +3012,19 @@ static void r8153_set_rx_early_size(stru
break;
case RTL_VER_08:
case RTL_VER_09:
break;
default:
WARN_ON_ONCE(1);
-@@ -2872,6 +3035,8 @@ static void r8153_set_rx_early_size(stru
+@@ -2871,6 +3034,8 @@ static void r8153_set_rx_early_size(stru
static int rtl8153_enable(struct r8152 *tp)
{
if (test_bit(RTL8152_UNPLUG, &tp->flags))
return -ENODEV;
-@@ -2882,15 +3047,18 @@ static int rtl8153_enable(struct r8152 *
+@@ -2881,15 +3046,18 @@ static int rtl8153_enable(struct r8152 *
rtl_set_ifg(tp, rtl8152_get_speed(tp));
}
return rtl_enable(tp);
-@@ -2955,12 +3123,40 @@ static void rtl_rx_vlan_en(struct r8152
+@@ -2954,12 +3122,40 @@ static void rtl_rx_vlan_en(struct r8152
{
u32 ocp_data;
}
static int rtl8152_set_features(struct net_device *dev,
-@@ -3053,6 +3249,40 @@ static void __rtl_set_wol(struct r8152 *
+@@ -3052,6 +3248,40 @@ static void __rtl_set_wol(struct r8152 *
device_set_wakeup_enable(&tp->udev->dev, false);
}
static void r8153_u1u2en(struct r8152 *tp, bool enable)
{
u8 u1u2[8];
-@@ -3112,6 +3342,9 @@ static void r8153b_ups_flags(struct r815
+@@ -3111,6 +3341,9 @@ static void r8153b_ups_flags(struct r815
if (tp->ups_info.eee_cmod_lv)
ups_flags |= UPS_FLAGS_EEE_CMOD_LV_EN;
if (tp->ups_info._10m_ckdiv)
ups_flags |= UPS_FLAGS_EN_10M_CKDIV;
-@@ -3162,6 +3395,88 @@ static void r8153b_ups_flags(struct r815
+@@ -3161,6 +3394,88 @@ static void r8153b_ups_flags(struct r815
ocp_write_dword(tp, MCU_TYPE_USB, USB_UPS_FLAGS, ups_flags);
}
static void rtl_green_en(struct r8152 *tp, bool enable)
{
u16 data;
-@@ -3225,16 +3540,16 @@ static void r8153b_ups_en(struct r8152 *
+@@ -3224,16 +3539,16 @@ static void r8153b_ups_en(struct r8152 *
ocp_data |= UPS_EN | USP_PREWAKE | PHASE2_EN;
ocp_write_byte(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data);
if (ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0) & PCUT_STATUS) {
int i;
-@@ -3254,6 +3569,95 @@ static void r8153b_ups_en(struct r8152 *
+@@ -3253,6 +3568,95 @@ static void r8153b_ups_en(struct r8152 *
}
}
static void r8153_power_cut_en(struct r8152 *tp, bool enable)
{
u32 ocp_data;
-@@ -3383,6 +3787,38 @@ static void rtl8153b_runtime_enable(stru
+@@ -3382,6 +3786,38 @@ static void rtl8153b_runtime_enable(stru
}
}
static void r8153_teredo_off(struct r8152 *tp)
{
u32 ocp_data;
-@@ -3403,14 +3839,19 @@ static void r8153_teredo_off(struct r815
+@@ -3402,14 +3838,19 @@ static void r8153_teredo_off(struct r815
case RTL_VER_08:
case RTL_VER_09:
}
ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE);
-@@ -3445,6 +3886,12 @@ static void rtl_clear_bp(struct r8152 *t
+@@ -3444,6 +3885,12 @@ static void rtl_clear_bp(struct r8152 *t
break;
case RTL_VER_08:
case RTL_VER_09:
default:
if (type == MCU_TYPE_USB) {
ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0);
-@@ -3654,6 +4101,11 @@ static bool rtl8152_is_fw_mac_ok(struct
+@@ -3653,6 +4100,11 @@ static bool rtl8152_is_fw_mac_ok(struct
case RTL_VER_06:
case RTL_VER_08:
case RTL_VER_09:
fw_reg = 0xf800;
bp_ba_addr = PLA_BP_BA;
bp_en_addr = PLA_BP_EN;
-@@ -3677,6 +4129,11 @@ static bool rtl8152_is_fw_mac_ok(struct
+@@ -3676,6 +4128,11 @@ static bool rtl8152_is_fw_mac_ok(struct
break;
case RTL_VER_08:
case RTL_VER_09:
fw_reg = 0xe600;
bp_ba_addr = USB_BP_BA;
bp_en_addr = USB_BP2_EN;
-@@ -4216,6 +4673,22 @@ static void r8153_eee_en(struct r8152 *t
+@@ -4215,6 +4672,22 @@ static void r8153_eee_en(struct r8152 *t
tp->ups_info.eee = enable;
}
static void rtl_eee_enable(struct r8152 *tp, bool enable)
{
switch (tp->version) {
-@@ -4237,6 +4710,7 @@ static void rtl_eee_enable(struct r8152
+@@ -4236,6 +4709,7 @@ static void rtl_eee_enable(struct r8152
case RTL_VER_06:
case RTL_VER_08:
case RTL_VER_09:
if (enable) {
r8153_eee_en(tp, true);
ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv);
-@@ -4245,6 +4719,19 @@ static void rtl_eee_enable(struct r8152
+@@ -4244,6 +4718,19 @@ static void rtl_eee_enable(struct r8152
ocp_reg_write(tp, OCP_EEE_ADV, 0);
}
break;
default:
break;
}
-@@ -4291,6 +4778,20 @@ static void wait_oob_link_list_ready(str
+@@ -4290,6 +4777,20 @@ static void wait_oob_link_list_ready(str
}
}
static void r8152b_exit_oob(struct r8152 *tp)
{
u32 ocp_data;
-@@ -4341,7 +4842,7 @@ static void r8152b_exit_oob(struct r8152
+@@ -4340,7 +4841,7 @@ static void r8152b_exit_oob(struct r8152
}
/* TX share fifo free credit full threshold */
ocp_write_byte(tp, MCU_TYPE_USB, USB_TX_AGG, TX_AGG_MAX_THRESHOLD);
ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_HIGH);
-@@ -4518,6 +5019,21 @@ static int r8153b_post_firmware_1(struct
+@@ -4517,6 +5018,21 @@ static int r8153b_post_firmware_1(struct
return 0;
}
static void r8153_aldps_en(struct r8152 *tp, bool enable)
{
u16 data;
-@@ -4720,6 +5236,13 @@ static void r8153b_hw_phy_cfg(struct r81
+@@ -4719,6 +5235,13 @@ static void r8153b_hw_phy_cfg(struct r81
set_bit(PHY_RESET, &tp->flags);
}
static void rtl8153_change_mtu(struct r8152 *tp)
{
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, mtu_to_size(tp->netdev->mtu));
-@@ -4807,6 +5330,7 @@ static void r8153_enter_oob(struct r8152
+@@ -4806,6 +5329,7 @@ static void r8153_enter_oob(struct r8152
case RTL_VER_08:
case RTL_VER_09:
/* Clear teredo wake event. bit[15:8] is the teredo wakeup
* type. Set it to zero. bits[7:0] are the W1C bits about
* the events. Set them to all 1 to clear them.
-@@ -4843,6 +5367,96 @@ static void rtl8153_disable(struct r8152
+@@ -4842,6 +5366,96 @@ static void rtl8153_disable(struct r8152
r8153_aldps_en(tp, true);
}
static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u32 speed, u8 duplex,
u32 advertising)
{
-@@ -4891,58 +5505,73 @@ static int rtl8152_set_speed(struct r815
+@@ -4890,58 +5504,73 @@ static int rtl8152_set_speed(struct r815
tp->mii.force_media = 1;
} else {
}
bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
-@@ -5098,6 +5727,253 @@ static void rtl8153b_down(struct r8152 *
+@@ -5097,6 +5726,253 @@ static void rtl8153b_down(struct r8152 *
r8153_aldps_en(tp, true);
}
static bool rtl8152_in_nway(struct r8152 *tp)
{
u16 nway_state;
-@@ -5128,7 +6004,7 @@ static void set_carrier(struct r8152 *tp
+@@ -5127,7 +6003,7 @@ static void set_carrier(struct r8152 *tp
{
struct net_device *netdev = tp->netdev;
struct napi_struct *napi = &tp->napi;
speed = rtl8152_get_speed(tp);
-@@ -5141,7 +6017,7 @@ static void set_carrier(struct r8152 *tp
+@@ -5140,7 +6016,7 @@ static void set_carrier(struct r8152 *tp
rtl_start_rx(tp);
clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
_rtl8152_set_rx_mode(netdev);
netif_wake_queue(netdev);
netif_info(tp, link, netdev, "carrier on\n");
} else if (netif_queue_stopped(netdev) &&
-@@ -5521,14 +6397,9 @@ static void r8153_init(struct r8152 *tp)
+@@ -5502,14 +6378,9 @@ static void r8153_init(struct r8152 *tp)
ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001);
r8153_u1u2en(tp, true);
usb_enable_lpm(tp->udev);
-@@ -5621,9 +6492,7 @@ static void r8153b_init(struct r8152 *tp
+@@ -5600,9 +6471,7 @@ static void r8153b_init(struct r8152 *tp
usb_enable_lpm(tp->udev);
/* MAC clock speed down */
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3);
ocp_data &= ~PLA_MCU_SPDWN_EN;
-@@ -5652,6 +6521,1069 @@ static void r8153b_init(struct r8152 *tp
- r8152_led_configuration(tp);
+@@ -5629,6 +6498,1069 @@ static void r8153b_init(struct r8152 *tp
+ tp->coalesce = 15000; /* 15 us */
}
+static void r8153c_init(struct r8152 *tp)
static int rtl8152_pre_reset(struct usb_interface *intf)
{
struct r8152 *tp = usb_get_intfdata(intf);
-@@ -6015,6 +7947,22 @@ int rtl8152_get_link_ksettings(struct ne
+@@ -5992,6 +7924,22 @@ int rtl8152_get_link_ksettings(struct ne
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
mutex_unlock(&tp->control);
usb_autopm_put_interface(tp->intf);
-@@ -6058,6 +8006,10 @@ static int rtl8152_set_link_ksettings(st
+@@ -6035,6 +7983,10 @@ static int rtl8152_set_link_ksettings(st
cmd->link_modes.advertising))
advertising |= RTL_ADVERTISED_1000_FULL;
mutex_lock(&tp->control);
ret = rtl8152_set_speed(tp, cmd->base.autoneg, cmd->base.speed,
-@@ -6647,6 +8599,67 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -6624,6 +8576,67 @@ static int rtl_ops_init(struct r8152 *tp
tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX;
break;
default:
ret = -ENODEV;
dev_err(&tp->intf->dev, "Unknown Device\n");
-@@ -6660,11 +8673,13 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -6637,11 +8650,13 @@ static int rtl_ops_init(struct r8152 *tp
#define FIRMWARE_8153A_3 "rtl_nic/rtl8153a-3.fw"
#define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw"
#define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw"
static int rtl_fw_init(struct r8152 *tp)
{
-@@ -6690,6 +8705,11 @@ static int rtl_fw_init(struct r8152 *tp)
+@@ -6667,6 +8682,11 @@ static int rtl_fw_init(struct r8152 *tp)
rtl_fw->pre_fw = r8153b_pre_firmware_1;
rtl_fw->post_fw = r8153b_post_firmware_1;
break;
default:
break;
}
-@@ -6745,6 +8765,27 @@ u8 rtl8152_get_version(struct usb_interf
+@@ -6722,6 +8742,27 @@ u8 rtl8152_get_version(struct usb_interf
case 0x6010:
version = RTL_VER_09;
break;
default:
version = RTL_VER_UNKNOWN;
dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data);
-@@ -6857,12 +8898,29 @@ static int rtl8152_probe(struct usb_inte
+@@ -6834,12 +8875,29 @@ static int rtl8152_probe(struct usb_inte
/* MTU range: 68 - 1500 or 9194 */
netdev->min_mtu = ETH_MIN_MTU;
switch (tp->version) {
break;
}
-@@ -6878,7 +8936,13 @@ static int rtl8152_probe(struct usb_inte
+@@ -6855,7 +8913,13 @@ static int rtl8152_probe(struct usb_inte
tp->advertising = RTL_ADVERTISED_10_HALF | RTL_ADVERTISED_10_FULL |
RTL_ADVERTISED_100_HALF | RTL_ADVERTISED_100_FULL;
if (tp->mii.supports_gmii) {
tp->advertising |= RTL_ADVERTISED_1000_FULL;
}
tp->duplex = DUPLEX_FULL;
-@@ -6902,7 +8966,11 @@ static int rtl8152_probe(struct usb_inte
+@@ -6879,7 +8943,11 @@ static int rtl8152_probe(struct usb_inte
set_ethernet_addr(tp);
usb_set_intfdata(intf, tp);
ret = register_netdev(netdev);
if (ret != 0) {
-@@ -6938,7 +9006,8 @@ static void rtl8152_disconnect(struct us
+@@ -6915,7 +8983,8 @@ static void rtl8152_disconnect(struct us
unregister_netdev(tp->netdev);
tasklet_kill(&tp->tx_tl);
cancel_delayed_work_sync(&tp->hw_phy_work);
rtl8152_release_firmware(tp);
free_netdev(tp->netdev);
}
-@@ -6958,13 +9027,28 @@ static void rtl8152_disconnect(struct us
+@@ -6935,13 +9004,28 @@ static void rtl8152_disconnect(struct us
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_COMM, \
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -975,8 +975,60 @@ enum rtl8152_fw_flags {
+@@ -974,8 +974,60 @@ enum rtl8152_fw_flags {
FW_FLAGS_START,
FW_FLAGS_STOP,
FW_FLAGS_NC,
/**
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
-@@ -1081,6 +1133,15 @@ enum rtl_fw_type {
+@@ -1080,6 +1132,15 @@ enum rtl_fw_type {
RTL_FW_PHY_START,
RTL_FW_PHY_STOP,
RTL_FW_PHY_NC,
};
enum rtl_version {
-@@ -4000,6 +4061,162 @@ static int rtl_post_ram_code(struct r815
+@@ -3999,6 +4060,162 @@ static int rtl_post_ram_code(struct r815
return 0;
}
static bool rtl8152_is_fw_phy_nc_ok(struct r8152 *tp, struct fw_phy_nc *phy)
{
u32 length;
-@@ -4320,6 +4537,10 @@ static long rtl8152_check_firmware(struc
+@@ -4319,6 +4536,10 @@ static long rtl8152_check_firmware(struc
case RTL_FW_PHY_START:
if (test_bit(FW_FLAGS_START, &fw_flags) ||
test_bit(FW_FLAGS_NC, &fw_flags) ||
test_bit(FW_FLAGS_STOP, &fw_flags)) {
dev_err(&tp->intf->dev,
"check PHY_START fail\n");
-@@ -4368,7 +4589,153 @@ static long rtl8152_check_firmware(struc
+@@ -4367,7 +4588,153 @@ static long rtl8152_check_firmware(struc
goto fail;
}
__set_bit(FW_FLAGS_NC, &fw_flags);
break;
default:
dev_warn(&tp->intf->dev, "Unknown type %u is found\n",
-@@ -4391,6 +4758,143 @@ fail:
+@@ -4390,6 +4757,143 @@ fail:
return ret;
}
static void rtl8152_fw_phy_nc_apply(struct r8152 *tp, struct fw_phy_nc *phy)
{
u16 mode_reg, bp_index;
-@@ -4444,6 +4948,12 @@ static void rtl8152_fw_mac_apply(struct
+@@ -4443,6 +4947,12 @@ static void rtl8152_fw_mac_apply(struct
return;
}
rtl_clear_bp(tp, type);
/* Enable backup/restore of MACDBG. This is required after clearing PLA
-@@ -4479,7 +4989,6 @@ static void rtl8152_fw_mac_apply(struct
+@@ -4478,7 +4988,6 @@ static void rtl8152_fw_mac_apply(struct
ocp_write_word(tp, type, bp_en_addr,
__le16_to_cpu(mac->bp_en_value));
if (fw_ver_reg)
ocp_write_byte(tp, MCU_TYPE_USB, fw_ver_reg,
mac->fw_ver_data);
-@@ -4494,7 +5003,7 @@ static void rtl8152_apply_firmware(struc
+@@ -4493,7 +5002,7 @@ static void rtl8152_apply_firmware(struc
struct fw_header *fw_hdr;
struct fw_phy_patch_key *key;
u16 key_addr = 0;
if (IS_ERR_OR_NULL(rtl_fw->fw))
return;
-@@ -4516,17 +5025,40 @@ static void rtl8152_apply_firmware(struc
+@@ -4515,17 +5024,40 @@ static void rtl8152_apply_firmware(struc
rtl8152_fw_mac_apply(tp, (struct fw_mac *)block);
break;
case RTL_FW_PHY_START:
default:
break;
}
-@@ -5034,6 +5566,21 @@ static int r8153c_post_firmware_1(struct
+@@ -5033,6 +5565,21 @@ static int r8153c_post_firmware_1(struct
return 0;
}
static void r8153_aldps_en(struct r8152 *tp, bool enable)
{
u16 data;
-@@ -8674,12 +9221,16 @@ static int rtl_ops_init(struct r8152 *tp
+@@ -8651,12 +9198,16 @@ static int rtl_ops_init(struct r8152 *tp
#define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw"
#define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw"
#define FIRMWARE_8153C_1 "rtl_nic/rtl8153c-1.fw"
static int rtl_fw_init(struct r8152 *tp)
{
-@@ -8705,6 +9256,14 @@ static int rtl_fw_init(struct r8152 *tp)
+@@ -8682,6 +9233,14 @@ static int rtl_fw_init(struct r8152 *tp)
rtl_fw->pre_fw = r8153b_pre_firmware_1;
rtl_fw->post_fw = r8153b_post_firmware_1;
break;
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
-@@ -30,7 +30,7 @@
+@@ -29,7 +29,7 @@
#include <linux/usb/r8152.h>
/* Information for net-next */
/* Information for net */
#define NET_VERSION "11"
-@@ -8131,6 +8131,39 @@ static void r8156b_init(struct r8152 *tp
+@@ -8108,6 +8108,39 @@ static void r8156b_init(struct r8152 *tp
tp->coalesce = 15000; /* 15 us */
}
static int rtl8152_pre_reset(struct usb_interface *intf)
{
struct r8152 *tp = usb_get_intfdata(intf);
-@@ -9369,10 +9402,8 @@ static int rtl8152_probe(struct usb_inte
+@@ -9346,10 +9379,8 @@ static int rtl8152_probe(struct usb_inte
if (version == RTL_VER_UNKNOWN)
return -ENODEV;
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -2659,6 +2659,9 @@ static int mv88e6xxx_setup_port(struct m
+@@ -2705,6 +2705,9 @@ static int mv88e6xxx_setup_port(struct m
if (dsa_is_cpu_port(ds, port))
reg = 0;
#include <linux/crc32.h>
#include <linux/if_vlan.h>
#include <linux/uaccess.h>
-@@ -5301,6 +5302,22 @@ static void rtl_tally_reset(struct r8152
+@@ -6780,6 +6781,22 @@ static void rtl_tally_reset(struct r8152
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
}
static void r8152b_init(struct r8152 *tp)
{
u32 ocp_data;
-@@ -5342,6 +5359,8 @@ static void r8152b_init(struct r8152 *tp
+@@ -6821,6 +6838,8 @@ static void r8152b_init(struct r8152 *tp
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
}
static void r8153_init(struct r8152 *tp)
-@@ -5487,6 +5506,8 @@ static void r8153_init(struct r8152 *tp)
+@@ -6961,6 +6980,8 @@ static void r8153_init(struct r8152 *tp)
tp->coalesce = COALESCE_SLOW;
break;
}
}
static void r8153b_init(struct r8152 *tp)
-@@ -5573,6 +5594,8 @@ static void r8153b_init(struct r8152 *tp
+@@ -7043,6 +7064,8 @@ static void r8153b_init(struct r8152 *tp
rtl_tally_reset(tp);
tp->coalesce = 15000; /* 15 us */
+ r8152_led_configuration(tp);
}
- static int rtl8152_pre_reset(struct usb_interface *intf)
+ static void r8153c_init(struct r8152 *tp)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2171,8 +2171,8 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2179,8 +2179,8 @@ static irqreturn_t mtk_handle_irq_rx(int
eth->rx_events++;
if (likely(napi_schedule_prep(ð->rx_napi))) {
}
return IRQ_HANDLED;
-@@ -2184,8 +2184,8 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2192,8 +2192,8 @@ static irqreturn_t mtk_handle_irq_tx(int
eth->tx_events++;
if (likely(napi_schedule_prep(ð->tx_napi))) {
}
return IRQ_HANDLED;
-@@ -3229,6 +3229,8 @@ static int mtk_probe(struct platform_dev
+@@ -3300,6 +3300,8 @@ static int mtk_probe(struct platform_dev
* for NAPI to work
*/
init_dummy_netdev(ð->dummy_dev);
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -2869,6 +2869,7 @@ static int mv88e6xxx_setup(struct dsa_sw
+@@ -2917,6 +2917,7 @@ static int mv88e6xxx_setup(struct dsa_sw
chip->ds = ds;
ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -5436,6 +5436,7 @@ static int mv88e6xxx_register_switch(str
+@@ -5484,6 +5484,7 @@ static int mv88e6xxx_register_switch(str
ds->ops = &mv88e6xxx_switch_ops;
ds->ageing_time_min = chip->info->age_time_coeff;
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
/*
* This structure holds all XPS maps for device. Maps are indexed by CPU.
*/
-@@ -1445,6 +1455,9 @@ struct net_device_ops {
+@@ -1452,6 +1462,9 @@ struct net_device_ops {
const struct sk_buff *skb,
u16 rxq_index,
u32 flow_id);
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3373,6 +3373,7 @@ static const struct mtk_soc_data mt7623_
+@@ -3375,6 +3375,7 @@ static const struct mtk_soc_data mt7623_
.hw_features = MTK_HW_FEATURES,
.required_clks = MT7623_CLKS_BITMAP,
.required_pctl = true,
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2949,6 +2949,7 @@ static const struct net_device_ops mtk_n
+@@ -2955,6 +2955,7 @@ static const struct net_device_ops mtk_n
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
{
const __be32 *_id = of_get_property(np, "reg", NULL);
phy_interface_t phy_mode;
struct phylink *phylink;
-@@ -3044,6 +3045,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3050,6 +3051,9 @@ static int mtk_add_mac(struct mtk_eth *e
else
eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;