1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
5 * Based on the r8180 driver, which is:
6 * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al.
8 * Contact Information: wlanfae <wlanfae@realtek.com>
10 #include <linux/netdevice.h>
11 #include <linux/ethtool.h>
12 #include <linux/delay.h>
16 static void _rtl92e_ethtool_get_drvinfo(struct net_device *dev,
17 struct ethtool_drvinfo *info)
19 struct r8192_priv *priv = rtllib_priv(dev);
21 strscpy(info->driver, DRV_NAME, sizeof(info->driver));
22 strscpy(info->version, DRV_VERSION, sizeof(info->version));
23 strscpy(info->bus_info, pci_name(priv->pdev), sizeof(info->bus_info));
26 static u32 _rtl92e_ethtool_get_link(struct net_device *dev)
28 struct r8192_priv *priv = rtllib_priv(dev);
30 return ((priv->rtllib->state == RTLLIB_LINKED) ||
31 (priv->rtllib->state == RTLLIB_LINKED_SCANNING));
34 const struct ethtool_ops rtl819x_ethtool_ops = {
35 .get_drvinfo = _rtl92e_ethtool_get_drvinfo,
36 .get_link = _rtl92e_ethtool_get_link,