summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2010-11-06 12:36:13 +0100
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-11-17 00:08:48 +0100
commit902bca00dc6e3b3ff5fbb1e32e5dbb45d5f30579 (patch)
tree4800783df10844fc3f41071fe4446cea957f63e4 /drivers
parente53beacd23d9cb47590da6a7a7f6d417b941a994 (diff)
firewire: net: count stats.tx_packets and stats.tx_bytes
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/net.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 18fdd9703b48..e2e968e732bc 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -906,6 +906,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask);
static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
{
struct fwnet_device *dev = ptask->dev;
+ struct sk_buff *skb = ptask->skb;
unsigned long flags;
bool free;
@@ -916,8 +917,11 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
/* Check whether we or the networking TX soft-IRQ is last user. */
free = (ptask->outstanding_pkts == 0 && !list_empty(&ptask->pt_link));
- if (ptask->outstanding_pkts == 0)
+ if (ptask->outstanding_pkts == 0) {
list_del(&ptask->pt_link);
+ dev->netdev->stats.tx_packets++;
+ dev->netdev->stats.tx_bytes += skb->len;
+ }
spin_unlock_irqrestore(&dev->lock, flags);
@@ -926,7 +930,6 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
u16 fg_off;
u16 datagram_label;
u16 lf;
- struct sk_buff *skb;
/* Update the ptask to point to the next fragment and send it */
lf = fwnet_get_hdr_lf(&ptask->hdr);
@@ -953,7 +956,7 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
datagram_label = fwnet_get_hdr_dgl(&ptask->hdr);
break;
}
- skb = ptask->skb;
+
skb_pull(skb, ptask->max_payload);
if (ptask->outstanding_pkts > 1) {
fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG,