1 | // SPDX-License-Identifier: GPL-2.0 |
2 | /* |
3 | * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. |
4 | * |
5 | * Based on the r8180 driver, which is: |
6 | * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al. |
7 | * |
8 | * Contact Information: wlanfae <wlanfae@realtek.com> |
9 | */ |
10 | #include <linux/netdevice.h> |
11 | #include <linux/ethtool.h> |
12 | #include <linux/delay.h> |
13 | |
14 | #include "rtl_core.h" |
15 | |
16 | static void _rtl92e_ethtool_get_drvinfo(struct net_device *dev, |
17 | struct ethtool_drvinfo *info) |
18 | { |
19 | struct r8192_priv *priv = rtllib_priv(dev); |
20 | |
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)); |
24 | } |
25 | |
26 | static u32 _rtl92e_ethtool_get_link(struct net_device *dev) |
27 | { |
28 | struct r8192_priv *priv = rtllib_priv(dev); |
29 | |
30 | return ((priv->rtllib->link_state == MAC80211_LINKED) || |
31 | (priv->rtllib->link_state == MAC80211_LINKED_SCANNING)); |
32 | } |
33 | |
34 | const struct ethtool_ops rtl819x_ethtool_ops = { |
35 | .get_drvinfo = _rtl92e_ethtool_get_drvinfo, |
36 | .get_link = _rtl92e_ethtool_get_link, |
37 | }; |
38 | |