diff mbox

mac80211: fix TX device statistics for monitor interfaces

Message ID 1386492357-20826-1-git-send-email-pali.rohar@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Pali Rohár Dec. 8, 2013, 8:45 a.m. UTC
From: David Gnedt <david.gnedt@davizone.at>

Count TX packets and bytes also for monitor interfaces.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
---
 net/mac80211/tx.c |    3 +++
 1 file changed, 3 insertions(+)

Comments

Johannes Berg Dec. 16, 2013, 12:38 p.m. UTC | #1
On Sun, 2013-12-08 at 09:45 +0100, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> Count TX packets and bytes also for monitor interfaces.

> +	dev->stats.tx_packets++;
> +	dev->stats.tx_bytes += skb->len;
> +
>  	/*
>  	 * fix up the pointers accounting for the radiotap
>  	 * header still being in there.  We are being given

Should we really count the machine-local radiotap management stuff?

johannes

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

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c558b24..37b38fb 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1623,6 +1623,9 @@  netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
 	if (unlikely(skb->len < len_rthdr))
 		goto fail; /* skb too short for claimed rt header extent */
 
+	dev->stats.tx_packets++;
+	dev->stats.tx_bytes += skb->len;
+
 	/*
 	 * fix up the pointers accounting for the radiotap
 	 * header still being in there.  We are being given