diff options
author | Martin Hundebøll <martin@hundeboll.net> | 2012-04-20 11:02:45 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-11-07 14:00:23 -0500 |
commit | 4046b24aface62f5647699e9af3260a486bc5f49 (patch) | |
tree | 82e7fe03be17690b109fb3fff82e83fb63ef28cd /net/batman-adv/distributed-arp-table.h | |
parent | 33af49ad8ae44de52c0ac30b1a9707dad5e4c418 (diff) |
batman-adv: Add get_ethtool_stats() support for DAT
Added additional counters for D.A.T.
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.h')
-rw-r--r-- | net/batman-adv/distributed-arp-table.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/batman-adv/distributed-arp-table.h b/net/batman-adv/distributed-arp-table.h index fdb3522ad516..d060c033e7de 100644 --- a/net/batman-adv/distributed-arp-table.h +++ b/net/batman-adv/distributed-arp-table.h | |||
@@ -74,6 +74,28 @@ int batadv_dat_init(struct batadv_priv *bat_priv); | |||
74 | void batadv_dat_free(struct batadv_priv *bat_priv); | 74 | void batadv_dat_free(struct batadv_priv *bat_priv); |
75 | int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset); | 75 | int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset); |
76 | 76 | ||
77 | /** | ||
78 | * batadv_dat_inc_counter - increment the correct DAT packet counter | ||
79 | * @bat_priv: the bat priv with all the soft interface information | ||
80 | * @subtype: the 4addr subtype of the packet to be counted | ||
81 | * | ||
82 | * Updates the ethtool statistics for the received packet if it is a DAT subtype | ||
83 | */ | ||
84 | static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv, | ||
85 | uint8_t subtype) | ||
86 | { | ||
87 | switch (subtype) { | ||
88 | case BATADV_P_DAT_DHT_GET: | ||
89 | batadv_inc_counter(bat_priv, | ||
90 | BATADV_CNT_DAT_GET_RX); | ||
91 | break; | ||
92 | case BATADV_P_DAT_DHT_PUT: | ||
93 | batadv_inc_counter(bat_priv, | ||
94 | BATADV_CNT_DAT_PUT_RX); | ||
95 | break; | ||
96 | } | ||
97 | } | ||
98 | |||
77 | #else | 99 | #else |
78 | 100 | ||
79 | static inline bool | 101 | static inline bool |
@@ -135,6 +157,11 @@ static inline void batadv_dat_free(struct batadv_priv *bat_priv) | |||
135 | { | 157 | { |
136 | } | 158 | } |
137 | 159 | ||
160 | static inline void batadv_dat_inc_counter(struct batadv_priv *bat_priv, | ||
161 | uint8_t subtype) | ||
162 | { | ||
163 | } | ||
164 | |||
138 | #endif /* CONFIG_BATMAN_ADV_DAT */ | 165 | #endif /* CONFIG_BATMAN_ADV_DAT */ |
139 | 166 | ||
140 | #endif /* _NET_BATMAN_ADV_ARP_H_ */ | 167 | #endif /* _NET_BATMAN_ADV_ARP_H_ */ |