Skip to content

Commit 8884f50

Browse files
hayesorzdavem330
authored andcommitted
r8152: support nway_reset of ethtool
Support the nway_reset() function for ethtool. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f37119c commit 8884f50

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/net/usb/r8152.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)