From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/4] mac80211: Framework to get wifi-driver stats via ethtool.
Date: Fri, 16 Mar 2012 09:54:05 +0100 [thread overview]
Message-ID: <1331888045.3435.1.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1331853606-28434-3-git-send-email-greearb@candelatech.com> (sfid-20120316_002024_641881_9A17A76F)
On Thu, 2012-03-15 at 16:20 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> This adds hooks to call into the driver to get additional
> stats for the ethtool API.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 d49928b... e89a742... M include/net/mac80211.h
> :100644 100644 0aef0d2... 872e06e... M net/mac80211/cfg.c
> include/net/mac80211.h | 9 +++++++++
> net/mac80211/cfg.c | 23 +++++++++++++++++++++--
> 2 files changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index d49928b..e89a742 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -2236,6 +2236,15 @@ struct ieee80211_ops {
> u16 tids, int num_frames,
> enum ieee80211_frame_release_type reason,
> bool more_data);
> +
> + int (*get_et_sset_count)(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif, int sset);
> + void (*get_et_stats)(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif,
> + struct ethtool_stats *stats, u64 *data);
> + void (*get_et_strings)(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif,
> + u32 sset, u8 *data);
> };
>
> /**
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 0aef0d2..872e06e 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -125,8 +125,17 @@ static int ieee80211_get_et_sset_count(struct wiphy *wiphy,
> struct net_device *dev,
> int sset)
> {
> - if (sset == ETH_SS_STATS)
> - return STA_STATS_LEN;
> + struct ieee80211_sub_if_data *sdata;
> + struct ieee80211_local *local;
> + if (sset == ETH_SS_STATS) {
> + int rv = STA_STATS_LEN;
> + sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> + local = sdata->local;
> + if (local->ops->get_et_sset_count)
> + rv += local->ops->get_et_sset_count(&local->hw,
> + &sdata->vif, sset);
should there be tracing for this?
johannes
next prev parent reply other threads:[~2012-03-16 8:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 23:20 [PATCH 1/4] cfg80211: Add framework to support ethtool stats greearb
2012-03-15 23:20 ` [PATCH 2/4] mac80211: Support getting sta_info stats via ethtool greearb
2012-03-15 23:20 ` [PATCH 3/4] mac80211: Framework to get wifi-driver " greearb
2012-03-16 8:54 ` Johannes Berg [this message]
2012-03-15 23:20 ` [PATCH 4/4] ath9k: Support ethtool getstats api greearb
2012-03-16 15:06 ` Felix Fietkau
2012-03-16 16:23 ` Ben Greear
2012-03-16 16:36 ` Felix Fietkau
2012-03-16 16:51 ` Ben Greear
2012-03-16 17:06 ` Felix Fietkau
2012-03-16 18:37 ` Ben Greear
2012-03-16 8:50 ` [PATCH 1/4] cfg80211: Add framework to support ethtool stats Johannes Berg
2012-03-16 10:05 ` Florian Fainelli
2012-03-16 15:06 ` Ben Greear
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331888045.3435.1.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).