arcnet: convert to internal stats
Use pre-existing network_device_stats inside network_device rather than own private structure. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
60961ce4d0
commit
5803c5122a
@@ -88,7 +88,6 @@ MODULE_LICENSE("GPL");
|
||||
*/
|
||||
static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct arcnet_local *lp = netdev_priv(dev);
|
||||
struct archdr *pkt = (struct archdr *) skb->data;
|
||||
struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
|
||||
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
|
||||
@@ -112,8 +111,8 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
|
||||
return htons(ETH_P_ARP);
|
||||
|
||||
default:
|
||||
lp->stats.rx_errors++;
|
||||
lp->stats.rx_crc_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
dev->stats.rx_crc_errors++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ static void rx(struct net_device *dev, int bufnum,
|
||||
skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
|
||||
if (skb == NULL) {
|
||||
BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
|
||||
lp->stats.rx_dropped++;
|
||||
dev->stats.rx_dropped++;
|
||||
return;
|
||||
}
|
||||
skb_put(skb, length + ARC_HDR_SIZE);
|
||||
@@ -168,7 +167,6 @@ static void rx(struct net_device *dev, int bufnum,
|
||||
static int build_header(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned short type, uint8_t daddr)
|
||||
{
|
||||
struct arcnet_local *lp = netdev_priv(dev);
|
||||
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
|
||||
struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
|
||||
struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
|
||||
@@ -184,8 +182,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
|
||||
default:
|
||||
BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n",
|
||||
type, type);
|
||||
lp->stats.tx_errors++;
|
||||
lp->stats.tx_aborted_errors++;
|
||||
dev->stats.tx_errors++;
|
||||
dev->stats.tx_aborted_errors++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user