提交 5a7616af 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

hdlcdrv: convert to internal net_device_stats

Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Acked-by: NThomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 52db6250
...@@ -154,7 +154,7 @@ static void hdlc_rx_flag(struct net_device *dev, struct hdlcdrv_state *s) ...@@ -154,7 +154,7 @@ static void hdlc_rx_flag(struct net_device *dev, struct hdlcdrv_state *s)
pkt_len = s->hdlcrx.len - 2 + 1; /* KISS kludge */ pkt_len = s->hdlcrx.len - 2 + 1; /* KISS kludge */
if (!(skb = dev_alloc_skb(pkt_len))) { if (!(skb = dev_alloc_skb(pkt_len))) {
printk("%s: memory squeeze, dropping packet\n", dev->name); printk("%s: memory squeeze, dropping packet\n", dev->name);
s->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
cp = skb_put(skb, pkt_len); cp = skb_put(skb, pkt_len);
...@@ -162,7 +162,7 @@ static void hdlc_rx_flag(struct net_device *dev, struct hdlcdrv_state *s) ...@@ -162,7 +162,7 @@ static void hdlc_rx_flag(struct net_device *dev, struct hdlcdrv_state *s)
memcpy(cp, s->hdlcrx.buffer, pkt_len - 1); memcpy(cp, s->hdlcrx.buffer, pkt_len - 1);
skb->protocol = ax25_type_trans(skb, dev); skb->protocol = ax25_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
s->stats.rx_packets++; dev->stats.rx_packets++;
} }
void hdlcdrv_receiver(struct net_device *dev, struct hdlcdrv_state *s) void hdlcdrv_receiver(struct net_device *dev, struct hdlcdrv_state *s)
...@@ -326,7 +326,7 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s) ...@@ -326,7 +326,7 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s)
s->hdlctx.len = pkt_len+2; /* the appended CRC */ s->hdlctx.len = pkt_len+2; /* the appended CRC */
s->hdlctx.tx_state = 2; s->hdlctx.tx_state = 2;
s->hdlctx.bitstream = 0; s->hdlctx.bitstream = 0;
s->stats.tx_packets++; dev->stats.tx_packets++;
break; break;
case 2: case 2:
if (!s->hdlctx.len) { if (!s->hdlctx.len) {
...@@ -426,19 +426,6 @@ static int hdlcdrv_set_mac_address(struct net_device *dev, void *addr) ...@@ -426,19 +426,6 @@ static int hdlcdrv_set_mac_address(struct net_device *dev, void *addr)
return 0; return 0;
} }
/* --------------------------------------------------------------------- */
static struct net_device_stats *hdlcdrv_get_stats(struct net_device *dev)
{
struct hdlcdrv_state *sm = netdev_priv(dev);
/*
* Get the current statistics. This may be called with the
* card open or closed.
*/
return &sm->stats;
}
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* /*
* Open/initialize the board. This is called (in the current kernel) * Open/initialize the board. This is called (in the current kernel)
...@@ -568,10 +555,10 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -568,10 +555,10 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
bi.data.cs.ptt = hdlcdrv_ptt(s); bi.data.cs.ptt = hdlcdrv_ptt(s);
bi.data.cs.dcd = s->hdlcrx.dcd; bi.data.cs.dcd = s->hdlcrx.dcd;
bi.data.cs.ptt_keyed = s->ptt_keyed; bi.data.cs.ptt_keyed = s->ptt_keyed;
bi.data.cs.tx_packets = s->stats.tx_packets; bi.data.cs.tx_packets = dev->stats.tx_packets;
bi.data.cs.tx_errors = s->stats.tx_errors; bi.data.cs.tx_errors = dev->stats.tx_errors;
bi.data.cs.rx_packets = s->stats.rx_packets; bi.data.cs.rx_packets = dev->stats.rx_packets;
bi.data.cs.rx_errors = s->stats.rx_errors; bi.data.cs.rx_errors = dev->stats.rx_errors;
break; break;
case HDLCDRVCTL_OLDGETSTAT: case HDLCDRVCTL_OLDGETSTAT:
......
...@@ -241,7 +241,6 @@ struct hdlcdrv_state { ...@@ -241,7 +241,6 @@ struct hdlcdrv_state {
struct hdlcdrv_bitbuffer bitbuf_hdlc; struct hdlcdrv_bitbuffer bitbuf_hdlc;
#endif /* HDLCDRV_DEBUG */ #endif /* HDLCDRV_DEBUG */
struct net_device_stats stats;
int ptt_keyed; int ptt_keyed;
/* queued skb for transmission */ /* queued skb for transmission */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册