diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-10-04 04:20:10 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-04 22:46:49 -0700 |
commit | ef1828058b8a37f7005be677686727bbbde77f6a (patch) | |
tree | ef3dd450c5265f983b33c0a35858c3bf00acbdeb /drivers/net/qlcnic/qlcnic.h | |
parent | 31dee692e22eedaf2540fa543fa9c91df6ab8bda (diff) | |
download | lwn-ef1828058b8a37f7005be677686727bbbde77f6a.tar.gz lwn-ef1828058b8a37f7005be677686727bbbde77f6a.zip |
qlcnic: fix eswitch stats
Some of the counters are not implemented in fw.
Fw return NOT AVAILABLE VALUE as (0xffffffffffffffff).
Adding these counters, result in invalid value.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic.h')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 714ddf461d73..4667463d5523 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h @@ -1169,6 +1169,18 @@ struct qlcnic_esw_func_cfg { #define QLCNIC_STATS_ESWITCH 2 #define QLCNIC_QUERY_RX_COUNTER 0 #define QLCNIC_QUERY_TX_COUNTER 1 +#define QLCNIC_ESW_STATS_NOT_AVAIL 0xffffffffffffffffULL + +#define QLCNIC_ADD_ESW_STATS(VAL1, VAL2)\ +do { \ + if (((VAL1) == QLCNIC_ESW_STATS_NOT_AVAIL) && \ + ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ + (VAL1) = (VAL2); \ + else if (((VAL1) != QLCNIC_ESW_STATS_NOT_AVAIL) && \ + ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ + (VAL1) += (VAL2); \ +} while (0) + struct __qlcnic_esw_statistics { __le16 context_id; __le16 version; |