linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v4 3/4] mac80211: Framework to get wifi-driver stats via ethtool.
Date: Mon, 23 Apr 2012 15:35:13 -0700	[thread overview]
Message-ID: <4F95D921.6060104@candelatech.com> (raw)
In-Reply-To: <CAB3XZEd8+YORDzCS0ZTVati9E2e05gTP5=7QLirQ=-Kus5DF+A@mail.gmail.com>

On 04/23/2012 03:17 PM, Eliad Peller wrote:
> On Mon, Apr 23, 2012 at 10:50 PM,<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>
>> ---
> [...]
>
>> @@ -463,10 +463,17 @@ static int ieee80211_get_et_sset_count(struct wiphy *wiphy,
>>                                        struct net_device *dev,
>>                                        int sset)
>>   {
>> +       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
>> +       int rv = 0;
>> +
>>         if (sset == ETH_SS_STATS)
>> -               return STA_STATS_LEN;
>> +               rv += STA_STATS_LEN;
>>
>> -       return -EOPNOTSUPP;
>> +       rv += drv_get_et_sset_count(sdata, sset);
>> +
> this is pretty confusing, because usually negative return value (e.g.
> -EINVAL) is valid, and in this case it will corrupt the total sum
> instead.

Well, in this case, you just should not return a negative value.

I can think of no reason this method should have a failure mode
if it is implemented at all, and if it does for some reason,
it can return 0.

These API are not meant to be dynamic in nature.  Effectively
the get-count method just lets you know how many strings
and stats to expect, and the numbers (and positions)
of all three should not change once the driver is loaded.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2012-04-23 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 19:50 [PATCH v4 0/4] Add ethtool stats support for Wireless Devices greearb
2012-04-23 19:50 ` [PATCH v4 1/4] cfg80211: Add framework to support ethtool stats greearb
2012-04-23 19:50 ` [PATCH v4 2/4] mac80211: Support getting sta_info stats via ethtool greearb
2012-04-23 19:50 ` [PATCH v4 3/4] mac80211: Framework to get wifi-driver " greearb
2012-04-23 22:17   ` Eliad Peller
2012-04-23 22:35     ` Ben Greear [this message]
2012-04-23 19:50 ` [PATCH v4 4/4] mac80211: Add more ethtools stats: survey, rates, etc greearb

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=4F95D921.6060104@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=eliad@wizery.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).