Skip to content

Commit 8b243a6

Browse files
committed
Merge branch 'r8152-next'
Hayes Wang says: ==================== r8152: support nway_reset Fix the CHECK from checkpatch.pl and support nway_reset. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents dca145f + 8884f50 commit 8b243a6

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

drivers/net/usb/r8152.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ struct tally_counter {
486486
__le64 rx_broadcast;
487487
__le32 rx_multicast;
488488
__le16 tx_aborted;
489-
__le16 tx_underun;
489+
__le16 tx_underrun;
490490
};
491491

492492
struct rx_desc {
@@ -3420,7 +3420,7 @@ static void rtl8152_get_ethtool_stats(struct net_device *dev,
34203420
data[9] = le64_to_cpu(tally.rx_broadcast);
34213421
data[10] = le32_to_cpu(tally.rx_multicast);
34223422
data[11] = le16_to_cpu(tally.tx_aborted);
3423-
data[12] = le16_to_cpu(tally.tx_underun);
3423+
data[12] = le16_to_cpu(tally.tx_underrun);
34243424
}
34253425

34263426
static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -3558,11 +3558,33 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
35583558
return ret;
35593559
}
35603560

3561+
static int rtl8152_nway_reset(struct net_device *dev)
3562+
{
3563+
struct r8152 *tp = netdev_priv(dev);
3564+
int ret;
3565+
3566+
ret = usb_autopm_get_interface(tp->intf);
3567+
if (ret < 0)
3568+
goto out;
3569+
3570+
mutex_lock(&tp->control);
3571+
3572+
ret = mii_nway_restart(&tp->mii);
3573+
3574+
mutex_unlock(&tp->control);
3575+
3576+
usb_autopm_put_interface(tp->intf);
3577+
3578+
out:
3579+
return ret;
3580+
}
3581+
35613582
static struct ethtool_ops ops = {
35623583
.get_drvinfo = rtl8152_get_drvinfo,
35633584
.get_settings = rtl8152_get_settings,
35643585
.set_settings = rtl8152_set_settings,
35653586
.get_link = ethtool_op_get_link,
3587+
.nway_reset = rtl8152_nway_reset,
35663588
.get_msglevel = rtl8152_get_msglevel,
35673589
.set_msglevel = rtl8152_set_msglevel,
35683590
.get_wol = rtl8152_get_wol,

0 commit comments

Comments
 (0)