linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/4] cfg80211:  Add framework to support ethtool stats.
@ 2012-03-19 18:51 greearb
  2012-03-19 18:51 ` [PATCH v3 2/4] mac80211: Support getting sta_info stats via ethtool greearb
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: greearb @ 2012-03-19 18:51 UTC (permalink / raw)
  To: linux-wireless; +Cc: netdev, Ben Greear

From: Ben Greear <greearb@candelatech.com>

Signed-off-by: Ben Greear <greearb@candelatech.com>
---

v3:  Add reference to ethtool_ops in comments.
   This doesn't actually make kdoc generate links,
   but hopefully a human can figure it out.

:100644 100644 9ed8021... c60b180... M	include/net/cfg80211.h
:100644 100644 9bde4d1... 7eecdf4... M	net/wireless/ethtool.c
 include/net/cfg80211.h |   17 +++++++++++++++++
 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 9ed8021..c60b180 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1491,6 +1491,16 @@ struct cfg80211_gtk_rekey_data {
  *	later passes to cfg80211_probe_status().
  *
  * @set_noack_map: Set the NoAck Map for the TIDs.
+ *
+ * @get_et_sset_count:  Ethtool API to get string-set count.
+ *	See @ethtool_ops.get_sset_count
+ *
+ * @get_et_stats:  Ethtool API to get a set of u64 stats.
+ *	See @ethtool_ops.get_ethtool_stats
+ *
+ * @get_et_strings:  Ethtool API to get a set of strings to describe stats
+ *	and perhaps other supported types of ethtool data-sets.
+ *	See @ethtool_ops.get_strings
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -1689,6 +1699,13 @@ struct cfg80211_ops {
 				  u16 noack_map);
 
 	struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
+
+	int	(*get_et_sset_count)(struct wiphy *wiphy,
+				     struct net_device *dev, int sset);
+	void	(*get_et_stats)(struct wiphy *wiphy, struct net_device *dev,
+				struct ethtool_stats *stats, u64 *data);
+	void	(*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
+				  u32 sset, u8 *data);
 };
 
 /*
diff --git a/net/wireless/ethtool.c b/net/wireless/ethtool.c
index 9bde4d1..7eecdf4 100644
--- a/net/wireless/ethtool.c
+++ b/net/wireless/ethtool.c
@@ -68,6 +68,32 @@ static int cfg80211_set_ringparam(struct net_device *dev,
 	return -ENOTSUPP;
 }
 
+static int cfg80211_get_sset_count(struct net_device *dev, int sset)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+	if (rdev->ops->get_et_sset_count)
+		return rdev->ops->get_et_sset_count(wdev->wiphy, dev, sset);
+	return -EOPNOTSUPP;
+}
+
+static void cfg80211_get_stats(struct net_device *dev,
+			       struct ethtool_stats *stats, u64 *data)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+	if (rdev->ops->get_et_stats)
+		rdev->ops->get_et_stats(wdev->wiphy, dev, stats, data);
+}
+
+static void cfg80211_get_strings(struct net_device *dev, u32 sset, u8 *data)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+	if (rdev->ops->get_et_strings)
+		rdev->ops->get_et_strings(wdev->wiphy, dev, sset, data);
+}
+
 const struct ethtool_ops cfg80211_ethtool_ops = {
 	.get_drvinfo = cfg80211_get_drvinfo,
 	.get_regs_len = cfg80211_get_regs_len,
@@ -75,4 +101,7 @@ const struct ethtool_ops cfg80211_ethtool_ops = {
 	.get_link = ethtool_op_get_link,
 	.get_ringparam = cfg80211_get_ringparam,
 	.set_ringparam = cfg80211_set_ringparam,
+	.get_strings = cfg80211_get_strings,
+	.get_ethtool_stats = cfg80211_get_stats,
+	.get_sset_count = cfg80211_get_sset_count,
 };
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH v3 0/4] Add ethtool stats support for Wireless Devices
@ 2012-04-20 22:53 greearb
  2012-04-20 22:53 ` [PATCH v3 3/4] mac80211: Framework to get wifi-driver stats via ethtool greearb
  0 siblings, 1 reply; 11+ messages in thread
From: greearb @ 2012-04-20 22:53 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This enables ethtool stats for mac80211 devices.  It also
adds hooks to call down into mac80211 drivers for additional
stats.  Patches to enable this hook in ath9k will be posted
in a different series.

V3:  Do a direct-lookup of the sta_info object if in MANAGED mode.
     Iterate through all survey results until we find the matching
      frequency.
     Roll the small sta-state patch into patch 4. 

Ben Greear (4):
  cfg80211: Add framework to support ethtool stats.
  mac80211: Support getting sta_info stats via ethtool.
  mac80211: Framework to get wifi-driver stats via ethtool.
  mac80211: Add more ethtools stats: survey, rates, etc

 include/net/cfg80211.h      |   17 ++++
 include/net/mac80211.h      |   17 ++++
 net/mac80211/cfg.c          |  179 +++++++++++++++++++++++++++++++++++++++++++
 net/mac80211/driver-ops.h   |   37 +++++++++
 net/mac80211/driver-trace.h |   15 ++++
 net/wireless/ethtool.c      |   29 +++++++
 6 files changed, 294 insertions(+), 0 deletions(-)

-- 
1.7.3.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-04-20 22:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 18:51 [PATCH v3 1/4] cfg80211: Add framework to support ethtool stats greearb
2012-03-19 18:51 ` [PATCH v3 2/4] mac80211: Support getting sta_info stats via ethtool greearb
2012-03-19 18:51 ` [PATCH v3 3/4] mac80211: Framework to get wifi-driver " greearb
2012-03-19 18:51 ` [PATCH v3 4/4] ath9k: Support ethtool getstats api greearb
2012-03-20  8:42   ` Florian Fainelli
2012-03-20 16:47     ` Ben Greear
2012-03-21  7:07       ` Sujith Manoharan
2012-03-21 15:12         ` Ben Greear
2012-03-21 16:10         ` Ben Hutchings
2012-03-21 16:20           ` Ben Greear
  -- strict thread matches above, loose matches on Subject: below --
2012-04-20 22:53 [PATCH v3 0/4] Add ethtool stats support for Wireless Devices greearb
2012-04-20 22:53 ` [PATCH v3 3/4] mac80211: Framework to get wifi-driver stats via ethtool greearb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).