aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/asix_devices.c
diff options
context:
space:
mode:
authorOleksij Rempel <[email protected]>2021-06-07 08:27:24 +0000
committerDavid S. Miller <[email protected]>2021-06-07 20:23:02 +0000
commit34a1dee6bc4458d9e059af510f2addc7a74b4c83 (patch)
tree75685163975df0605336314bdccc7e0e9382b33e /drivers/net/usb/asix_devices.c
parentnet: usb: asix: ax88772: add phylib support (diff)
downloadkernel-34a1dee6bc4458d9e059af510f2addc7a74b4c83.tar.gz
kernel-34a1dee6bc4458d9e059af510f2addc7a74b4c83.zip
net: usb: asix: ax88772: add generic selftest support
With working phylib support we are able now to use generic selftests. Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/usb/asix_devices.c')
-rw-r--r--drivers/net/usb/asix_devices.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index e4cd85e38edd..57dafb3262d9 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -283,6 +283,26 @@ out:
return ret;
}
+static void ax88772_ethtool_get_strings(struct net_device *netdev, u32 sset,
+ u8 *data)
+{
+ switch (sset) {
+ case ETH_SS_TEST:
+ net_selftest_get_strings(data);
+ break;
+ }
+}
+
+static int ax88772_ethtool_get_sset_count(struct net_device *ndev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_TEST:
+ return net_selftest_get_count();
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
static const struct ethtool_ops ax88772_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = usbnet_get_link,
@@ -296,6 +316,9 @@ static const struct ethtool_ops ax88772_ethtool_ops = {
.nway_reset = phy_ethtool_nway_reset,
.get_link_ksettings = phy_ethtool_get_link_ksettings,
.set_link_ksettings = phy_ethtool_set_link_ksettings,
+ .self_test = net_selftest,
+ .get_strings = ax88772_ethtool_get_strings,
+ .get_sset_count = ax88772_ethtool_get_sset_count,
};
static int ax88772_reset(struct usbnet *dev)