Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133827
b: refs/heads/master
c: ddbe9a6
h: refs/heads/master
i:
  133825: 61c16c0
  133823: 5e4db9f
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 21, 2009
1 parent ffca117 commit 85e07f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff908cf83498010e832819cf50a23e16c43b1373
refs/heads/master: ddbe9a686805c36a0e68451ebb8cb51b21d0c718
34 changes: 12 additions & 22 deletions trunk/drivers/net/hamradio/mkiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ struct mkiss {
unsigned char *xhead; /* pointer to next byte to XMIT */
int xleft; /* bytes left in XMIT queue */

struct net_device_stats stats;

/* Detailed SLIP statistics. */
int mtu; /* Our mtu (to spot changes!) */
int buffsize; /* Max buffers sizes */
Expand Down Expand Up @@ -253,7 +251,7 @@ static void ax_bump(struct mkiss *ax)
if (ax->rbuff[0] > 0x0f) {
if (ax->rbuff[0] & 0x80) {
if (check_crc_16(ax->rbuff, ax->rcount) < 0) {
ax->stats.rx_errors++;
ax->dev->stats.rx_errors++;
spin_unlock_bh(&ax->buflock);

return;
Expand All @@ -268,7 +266,7 @@ static void ax_bump(struct mkiss *ax)
*ax->rbuff &= ~0x80;
} else if (ax->rbuff[0] & 0x20) {
if (check_crc_flex(ax->rbuff, ax->rcount) < 0) {
ax->stats.rx_errors++;
ax->dev->stats.rx_errors++;
spin_unlock_bh(&ax->buflock);
return;
}
Expand All @@ -295,16 +293,16 @@ static void ax_bump(struct mkiss *ax)
if ((skb = dev_alloc_skb(count)) == NULL) {
printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n",
ax->dev->name);
ax->stats.rx_dropped++;
ax->dev->stats.rx_dropped++;
spin_unlock_bh(&ax->buflock);
return;
}

memcpy(skb_put(skb,count), ax->rbuff, count);
skb->protocol = ax25_type_trans(skb, ax->dev);
netif_rx(skb);
ax->stats.rx_packets++;
ax->stats.rx_bytes += count;
ax->dev->stats.rx_packets++;
ax->dev->stats.rx_bytes += count;
spin_unlock_bh(&ax->buflock);
}

Expand Down Expand Up @@ -344,7 +342,7 @@ static void kiss_unesc(struct mkiss *ax, unsigned char s)
return;
}

ax->stats.rx_over_errors++;
ax->dev->stats.rx_over_errors++;
set_bit(AXF_ERROR, &ax->flags);
}
spin_unlock_bh(&ax->buflock);
Expand Down Expand Up @@ -406,7 +404,7 @@ static void ax_changedmtu(struct mkiss *ax)
memcpy(ax->xbuff, ax->xhead, ax->xleft);
} else {
ax->xleft = 0;
ax->stats.tx_dropped++;
dev->stats.tx_dropped++;
}
}

Expand All @@ -417,7 +415,7 @@ static void ax_changedmtu(struct mkiss *ax)
memcpy(ax->rbuff, orbuff, ax->rcount);
} else {
ax->rcount = 0;
ax->stats.rx_over_errors++;
dev->stats.rx_over_errors++;
set_bit(AXF_ERROR, &ax->flags);
}
}
Expand All @@ -444,7 +442,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
if (len > ax->mtu) { /* Sigh, shouldn't occur BUT ... */
len = ax->mtu;
printk(KERN_ERR "mkiss: %s: truncating oversized transmit packet!\n", ax->dev->name);
ax->stats.tx_dropped++;
dev->stats.tx_dropped++;
netif_start_queue(dev);
return;
}
Expand Down Expand Up @@ -518,8 +516,8 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)

set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);
actual = ax->tty->ops->write(ax->tty, ax->xbuff, count);
ax->stats.tx_packets++;
ax->stats.tx_bytes += actual;
dev->stats.tx_packets++;
dev->stats.tx_bytes += actual;

ax->dev->trans_start = jiffies;
ax->xleft = count - actual;
Expand Down Expand Up @@ -664,13 +662,6 @@ static int ax_close(struct net_device *dev)
return 0;
}

static struct net_device_stats *ax_get_stats(struct net_device *dev)
{
struct mkiss *ax = netdev_priv(dev);

return &ax->stats;
}

static const struct header_ops ax_header_ops = {
.create = ax_header,
.rebuild = ax_rebuild_header,
Expand All @@ -683,7 +674,6 @@ static void ax_setup(struct net_device *dev)
dev->hard_start_xmit = ax_xmit;
dev->open = ax_open_dev;
dev->stop = ax_close;
dev->get_stats = ax_get_stats;
dev->set_mac_address = ax_set_mac_address;
dev->hard_header_len = 0;
dev->addr_len = 0;
Expand Down Expand Up @@ -929,7 +919,7 @@ static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp,
while (count--) {
if (fp != NULL && *fp++) {
if (!test_and_set_bit(AXF_ERROR, &ax->flags))
ax->stats.rx_errors++;
ax->dev->stats.rx_errors++;
cp++;
continue;
}
Expand Down

0 comments on commit 85e07f9

Please sign in to comment.