Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / rtl8192e / rtl8192e / rtl_ethtool.c
1 /******************************************************************************
2  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3  *
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.
9  *
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
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18  *
19  * The full GNU General Public License is included in this distribution in the
20  * file called LICENSE.
21  *
22  * Contact Information:
23  * wlanfae <wlanfae@realtek.com>
24  *****************************************************************************
25  */
26 #include <linux/netdevice.h>
27 #include <linux/ethtool.h>
28 #include <linux/delay.h>
29
30 #include "rtl_core.h"
31
32 static void rtl819x_ethtool_get_drvinfo(struct net_device *dev,
33                 struct ethtool_drvinfo *info)
34 {
35         struct r8192_priv *priv = rtllib_priv(dev);
36
37         strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
38         strlcpy(info->version, DRV_VERSION, sizeof(info->version));
39         strlcpy(info->bus_info, pci_name(priv->pdev), sizeof(info->bus_info));
40 }
41
42 static u32 rtl819x_ethtool_get_link(struct net_device *dev)
43 {
44         struct r8192_priv *priv = rtllib_priv(dev);
45
46         return ((priv->rtllib->state == RTLLIB_LINKED) ||
47                 (priv->rtllib->state == RTLLIB_LINKED_SCANNING));
48 }
49
50 const struct ethtool_ops rtl819x_ethtool_ops = {
51         .get_drvinfo = rtl819x_ethtool_get_drvinfo,
52         .get_link = rtl819x_ethtool_get_link,
53 };