mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* byte counters for mkiss
@ 2003-05-15  3:31 davej
  0 siblings, 0 replies; only message in thread
From: davej @ 2003-05-15  3:31 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

>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            */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-15  3:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-15  3:31 byte counters for mkiss davej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®