1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * Based on the r8180 driver, which is:
5 * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * The full GNU General Public License is included in this distribution in the
16 * file called LICENSE.
18 * Contact Information:
19 * wlanfae <wlanfae@realtek.com>
20 *****************************************************************************
22 #include <linux/netdevice.h>
23 #include <linux/ethtool.h>
24 #include <linux/delay.h>
28 static void _rtl92e_ethtool_get_drvinfo(struct net_device *dev,
29 struct ethtool_drvinfo *info)
31 struct r8192_priv *priv = rtllib_priv(dev);
33 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
34 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
35 strlcpy(info->bus_info, pci_name(priv->pdev), sizeof(info->bus_info));
38 static u32 _rtl92e_ethtool_get_link(struct net_device *dev)
40 struct r8192_priv *priv = rtllib_priv(dev);
42 return ((priv->rtllib->state == RTLLIB_LINKED) ||
43 (priv->rtllib->state == RTLLIB_LINKED_SCANNING));
46 const struct ethtool_ops rtl819x_ethtool_ops = {
47 .get_drvinfo = _rtl92e_ethtool_get_drvinfo,
48 .get_link = _rtl92e_ethtool_get_link,