diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-11-06 07:36:13 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-11-16 18:08:48 -0500 |
commit | 902bca00dc6e3b3ff5fbb1e32e5dbb45d5f30579 (patch) | |
tree | 4800783df10844fc3f41071fe4446cea957f63e4 /drivers/firewire/net.c | |
parent | e53beacd23d9cb47590da6a7a7f6d417b941a994 (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/firewire/net.c')
-rw-r--r-- | drivers/firewire/net.c | 9 |
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); | |||
906 | static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) | 906 | static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) |
907 | { | 907 | { |
908 | struct fwnet_device *dev = ptask->dev; | 908 | struct fwnet_device *dev = ptask->dev; |
909 | struct sk_buff *skb = ptask->skb; | ||
909 | unsigned long flags; | 910 | unsigned long flags; |
910 | bool free; | 911 | bool free; |
911 | 912 | ||
@@ -916,8 +917,11 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) | |||
916 | /* Check whether we or the networking TX soft-IRQ is last user. */ | 917 | /* Check whether we or the networking TX soft-IRQ is last user. */ |
917 | free = (ptask->outstanding_pkts == 0 && !list_empty(&ptask->pt_link)); | 918 | free = (ptask->outstanding_pkts == 0 && !list_empty(&ptask->pt_link)); |
918 | 919 | ||
919 | if (ptask->outstanding_pkts == 0) | 920 | if (ptask->outstanding_pkts == 0) { |
920 | list_del(&ptask->pt_link); | 921 | list_del(&ptask->pt_link); |
922 | dev->netdev->stats.tx_packets++; | ||
923 | dev->netdev->stats.tx_bytes += skb->len; | ||
924 | } | ||
921 | 925 | ||
922 | spin_unlock_irqrestore(&dev->lock, flags); | 926 | spin_unlock_irqrestore(&dev->lock, flags); |
923 | 927 | ||
@@ -926,7 +930,6 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) | |||
926 | u16 fg_off; | 930 | u16 fg_off; |
927 | u16 datagram_label; | 931 | u16 datagram_label; |
928 | u16 lf; | 932 | u16 lf; |
929 | struct sk_buff *skb; | ||
930 | 933 | ||
931 | /* Update the ptask to point to the next fragment and send it */ | 934 | /* Update the ptask to point to the next fragment and send it */ |
932 | lf = fwnet_get_hdr_lf(&ptask->hdr); | 935 | lf = fwnet_get_hdr_lf(&ptask->hdr); |
@@ -953,7 +956,7 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) | |||
953 | datagram_label = fwnet_get_hdr_dgl(&ptask->hdr); | 956 | datagram_label = fwnet_get_hdr_dgl(&ptask->hdr); |
954 | break; | 957 | break; |
955 | } | 958 | } |
956 | skb = ptask->skb; | 959 | |
957 | skb_pull(skb, ptask->max_payload); | 960 | skb_pull(skb, ptask->max_payload); |
958 | if (ptask->outstanding_pkts > 1) { | 961 | if (ptask->outstanding_pkts > 1) { |
959 | fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG, | 962 | fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG, |