Commit 7f409844 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] byte counters for mkiss

From 2.4 from way back 13 months ago..
parent e33de428
...@@ -347,6 +347,7 @@ static void ax_bump(struct ax_disp *ax) ...@@ -347,6 +347,7 @@ static void ax_bump(struct ax_disp *ax)
netif_rx(skb); netif_rx(skb);
tmp_ax->dev->last_rx = jiffies; tmp_ax->dev->last_rx = jiffies;
tmp_ax->rx_packets++; tmp_ax->rx_packets++;
tmp_ax->rx_bytes+=count;
} }
/* Encapsulate one AX.25 packet and stuff into a TTY queue. */ /* Encapsulate one AX.25 packet and stuff into a TTY queue. */
...@@ -386,6 +387,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) ...@@ -386,6 +387,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len)
ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count); actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count);
ax->tx_packets++; ax->tx_packets++;
ax->tx_bytes+=actual;
ax->dev->trans_start = jiffies; ax->dev->trans_start = jiffies;
ax->xleft = count - actual; ax->xleft = count - actual;
ax->xhead = ax->xbuff + actual; ax->xhead = ax->xbuff + actual;
...@@ -394,6 +396,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) ...@@ -394,6 +396,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len)
ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count); actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
ax->tx_packets++; ax->tx_packets++;
ax->tx_bytes+=actual;
ax->mkiss->dev->trans_start = jiffies; ax->mkiss->dev->trans_start = jiffies;
ax->mkiss->xleft = count - actual; ax->mkiss->xleft = count - actual;
ax->mkiss->xhead = ax->mkiss->xbuff + actual; ax->mkiss->xhead = ax->mkiss->xbuff + actual;
...@@ -709,6 +712,8 @@ static struct net_device_stats *ax_get_stats(struct net_device *dev) ...@@ -709,6 +712,8 @@ static struct net_device_stats *ax_get_stats(struct net_device *dev)
stats.rx_packets = ax->rx_packets; stats.rx_packets = ax->rx_packets;
stats.tx_packets = ax->tx_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.rx_dropped = ax->rx_dropped;
stats.tx_dropped = ax->tx_dropped; stats.tx_dropped = ax->tx_dropped;
stats.tx_errors = ax->tx_errors; stats.tx_errors = ax->tx_errors;
...@@ -936,7 +941,7 @@ static int ax25_init(struct net_device *dev) ...@@ -936,7 +941,7 @@ static int ax25_init(struct net_device *dev)
memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN); memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
/* New-style flags. */ /* New-style flags. */
dev->flags = 0; dev->flags = IFF_BROADCAST | IFF_MULTICAST;
return 0; return 0;
} }
......
...@@ -31,6 +31,8 @@ struct ax_disp { ...@@ -31,6 +31,8 @@ struct ax_disp {
/* SLIP interface statistics. */ /* SLIP interface statistics. */
unsigned long rx_packets; /* inbound frames counter */ unsigned long rx_packets; /* inbound frames counter */
unsigned long tx_packets; /* outbound 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 rx_errors; /* Parity, etc. errors */
unsigned long tx_errors; /* Planned stuff */ unsigned long tx_errors; /* Planned stuff */
unsigned long rx_dropped; /* No memory for skb */ unsigned long rx_dropped; /* No memory for skb */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment