Search Linux Wireless

Re: [PATCH v4 3/4] mac80211: Framework to get wifi-driver stats via ethtool.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/23/2012 03:17 PM, Eliad Peller wrote:
On Mon, Apr 23, 2012 at 10:50 PM,<greearb@xxxxxxxxxxxxxxx>  wrote:
From: Ben Greear<greearb@xxxxxxxxxxxxxxx>

This adds hooks to call into the driver to get additional
stats for the ethtool API.

Signed-off-by: Ben Greear<greearb@xxxxxxxxxxxxxxx>
---
[...]

@@ -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@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux