diff options
-rw-r--r-- | include/net/cfg80211.h | 17 | ||||
-rw-r--r-- | net/wireless/ethtool.c | 29 |
2 files changed, 46 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 815dc3f37e2b..27f956101bbd 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1514,6 +1514,16 @@ struct cfg80211_gtk_rekey_data { | |||
1514 | * later passes to cfg80211_probe_status(). | 1514 | * later passes to cfg80211_probe_status(). |
1515 | * | 1515 | * |
1516 | * @set_noack_map: Set the NoAck Map for the TIDs. | 1516 | * @set_noack_map: Set the NoAck Map for the TIDs. |
1517 | * | ||
1518 | * @get_et_sset_count: Ethtool API to get string-set count. | ||
1519 | * See @ethtool_ops.get_sset_count | ||
1520 | * | ||
1521 | * @get_et_stats: Ethtool API to get a set of u64 stats. | ||
1522 | * See @ethtool_ops.get_ethtool_stats | ||
1523 | * | ||
1524 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | ||
1525 | * and perhaps other supported types of ethtool data-sets. | ||
1526 | * See @ethtool_ops.get_strings | ||
1517 | */ | 1527 | */ |
1518 | struct cfg80211_ops { | 1528 | struct cfg80211_ops { |
1519 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1529 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
@@ -1712,6 +1722,13 @@ struct cfg80211_ops { | |||
1712 | 1722 | ||
1713 | struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy, | 1723 | struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy, |
1714 | enum nl80211_channel_type *type); | 1724 | enum nl80211_channel_type *type); |
1725 | |||
1726 | int (*get_et_sset_count)(struct wiphy *wiphy, | ||
1727 | struct net_device *dev, int sset); | ||
1728 | void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, | ||
1729 | struct ethtool_stats *stats, u64 *data); | ||
1730 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | ||
1731 | u32 sset, u8 *data); | ||
1715 | }; | 1732 | }; |
1716 | 1733 | ||
1717 | /* | 1734 | /* |
diff --git a/net/wireless/ethtool.c b/net/wireless/ethtool.c index 9bde4d1d3e9b..7eecdf40cf80 100644 --- a/net/wireless/ethtool.c +++ b/net/wireless/ethtool.c | |||
@@ -68,6 +68,32 @@ static int cfg80211_set_ringparam(struct net_device *dev, | |||
68 | return -ENOTSUPP; | 68 | return -ENOTSUPP; |
69 | } | 69 | } |
70 | 70 | ||
71 | static int cfg80211_get_sset_count(struct net_device *dev, int sset) | ||
72 | { | ||
73 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
74 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
75 | if (rdev->ops->get_et_sset_count) | ||
76 | return rdev->ops->get_et_sset_count(wdev->wiphy, dev, sset); | ||
77 | return -EOPNOTSUPP; | ||
78 | } | ||
79 | |||
80 | static void cfg80211_get_stats(struct net_device *dev, | ||
81 | struct ethtool_stats *stats, u64 *data) | ||
82 | { | ||
83 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
84 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
85 | if (rdev->ops->get_et_stats) | ||
86 | rdev->ops->get_et_stats(wdev->wiphy, dev, stats, data); | ||
87 | } | ||
88 | |||
89 | static void cfg80211_get_strings(struct net_device *dev, u32 sset, u8 *data) | ||
90 | { | ||
91 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
92 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
93 | if (rdev->ops->get_et_strings) | ||
94 | rdev->ops->get_et_strings(wdev->wiphy, dev, sset, data); | ||
95 | } | ||
96 | |||
71 | const struct ethtool_ops cfg80211_ethtool_ops = { | 97 | const struct ethtool_ops cfg80211_ethtool_ops = { |
72 | .get_drvinfo = cfg80211_get_drvinfo, | 98 | .get_drvinfo = cfg80211_get_drvinfo, |
73 | .get_regs_len = cfg80211_get_regs_len, | 99 | .get_regs_len = cfg80211_get_regs_len, |
@@ -75,4 +101,7 @@ const struct ethtool_ops cfg80211_ethtool_ops = { | |||
75 | .get_link = ethtool_op_get_link, | 101 | .get_link = ethtool_op_get_link, |
76 | .get_ringparam = cfg80211_get_ringparam, | 102 | .get_ringparam = cfg80211_get_ringparam, |
77 | .set_ringparam = cfg80211_set_ringparam, | 103 | .set_ringparam = cfg80211_set_ringparam, |
104 | .get_strings = cfg80211_get_strings, | ||
105 | .get_ethtool_stats = cfg80211_get_stats, | ||
106 | .get_sset_count = cfg80211_get_sset_count, | ||
78 | }; | 107 | }; |