Commit 396e2e23 authored by hayeswang's avatar hayeswang Committed by David S. Miller
Browse files

r8152: change rx early size when the mtu is changed

The rx early size is calculated with the mtu, so it has to be
re-calculated when the mtu is changed.
Signed-off-by: default avatarHayes Wang <>
Signed-off-by: default avatarDavid S. Miller <>
parent 464ec10a
......@@ -3777,6 +3777,7 @@ out:
static int rtl8152_change_mtu(struct net_device *dev, int new_mtu)
struct r8152 *tp = netdev_priv(dev);
int ret;
switch (tp->version) {
case RTL_VER_01:
......@@ -3789,9 +3790,22 @@ static int rtl8152_change_mtu(struct net_device *dev, int new_mtu)
if (new_mtu < 68 || new_mtu > RTL8153_MAX_MTU)
return -EINVAL;
ret = usb_autopm_get_interface(tp->intf);
if (ret < 0)
return ret;
dev->mtu = new_mtu;
return 0;
if (netif_running(dev) && netif_carrier_ok(dev))
return ret;
static const struct net_device_ops rtl8152_netdev_ops = {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment