byte counters for mkiss

From: davej@codemonkey.org.uk
Date: Wed May 14 2003 - 22:31:15 EST


>From 2.4 from way back 13 months ago..

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/hamradio/mkiss.c linux-2.5/drivers/net/hamradio/mkiss.c
--- bk-linus/drivers/net/hamradio/mkiss.c 2003-04-24 03:50:37.000000000 +0100
+++ linux-2.5/drivers/net/hamradio/mkiss.c 2003-04-24 03:53:14.000000000 +0100
@@ -347,6 +347,7 @@ static void ax_bump(struct ax_disp *ax)
         netif_rx(skb);
         tmp_ax->dev->last_rx = jiffies;
         tmp_ax->rx_packets++;
+ tmp_ax->rx_bytes+=count;
 }
 
 /* Encapsulate one AX.25 packet and stuff into a TTY queue. */
@@ -386,6 +387,7 @@ static void ax_encaps(struct ax_disp *ax
                 ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
                 actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count);
                 ax->tx_packets++;
+ ax->tx_bytes+=actual;
                 ax->dev->trans_start = jiffies;
                 ax->xleft = count - actual;
                 ax->xhead = ax->xbuff + actual;
@@ -394,6 +396,7 @@ static void ax_encaps(struct ax_disp *ax
                 ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
                 actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
                 ax->tx_packets++;
+ ax->tx_bytes+=actual;
                 ax->mkiss->dev->trans_start = jiffies;
                 ax->mkiss->xleft = count - actual;
                 ax->mkiss->xhead = ax->mkiss->xbuff + actual;
@@ -709,6 +712,8 @@ static struct net_device_stats *ax_get_s
 
         stats.rx_packets = ax->rx_packets;
         stats.tx_packets = ax->tx_packets;
+ stats.rx_bytes = ax->rx_bytes;
+ stats.tx_bytes = ax->tx_bytes;
         stats.rx_dropped = ax->rx_dropped;
         stats.tx_dropped = ax->tx_dropped;
         stats.tx_errors = ax->tx_errors;
@@ -936,7 +941,7 @@ static int ax25_init(struct net_device *
         memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
 
         /* New-style flags. */
- dev->flags = 0;
+ dev->flags = IFF_BROADCAST | IFF_MULTICAST;
 
         return 0;
 }
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/hamradio/mkiss.h linux-2.5/drivers/net/hamradio/mkiss.h
--- bk-linus/drivers/net/hamradio/mkiss.h 2003-04-10 06:01:21.000000000 +0100
+++ linux-2.5/drivers/net/hamradio/mkiss.h 2003-03-17 23:42:28.000000000 +0000
@@ -31,6 +31,8 @@ struct ax_disp {
         /* SLIP interface statistics. */
         unsigned long rx_packets; /* inbound frames counter */
         unsigned long tx_packets; /* outbound frames counter */
+ unsigned long rx_bytes; /* inbound bytes counter */
+ unsigned long tx_bytes; /* outbound bytes counter */
         unsigned long rx_errors; /* Parity, etc. errors */
         unsigned long tx_errors; /* Planned stuff */
         unsigned long rx_dropped; /* No memory for skb */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:55 EST