From 59d533b18bc76fb3b08c284dfe9fe84b124003e4 Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 28 Jul 2004 21:16:14 +0000 Subject: Only use stats if NETHDLC not for PPP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@446 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/zaptel.c b/zaptel.c index a0912e6..f394d24 100755 --- a/zaptel.c +++ b/zaptel.c @@ -5506,11 +5506,6 @@ static inline void __zt_putbuf_chunk(struct zt_chan *ss, unsigned char *rxb) #if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP) if (ms->flags & (ZT_FLAG_NETDEV | ZT_FLAG_PPP)) { #ifdef CONFIG_ZAPATA_NET -#ifdef LINUX26 - struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); -#else /* LINUX26 */ - struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; -#endif /* LINUX26 */ #endif /* CONFIG_ZAPATA_NET */ /* Our network receiver logic is MUCH different. We actually only use a single @@ -5528,14 +5523,27 @@ static inline void __zt_putbuf_chunk(struct zt_chan *ss, unsigned char *rxb) memcpy(skb->data, ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]); skb_put(skb, ms->readn[ms->inreadbuf]); #ifdef CONFIG_ZAPATA_NET + if (ms->flags & ZT_FLAG_NETDEV) { +#ifdef LINUX26 + struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); +#else /* LINUX26 */ + struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; +#endif /* LINUX26 */ stats->rx_packets++; stats->rx_bytes += ms->readn[ms->inreadbuf]; + } #endif } else { #ifdef CONFIG_ZAPATA_NET - if (ms->flags & ZT_FLAG_NETDEV) + if (ms->flags & ZT_FLAG_NETDEV) { +#ifdef LINUX26 + struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); +#else /* LINUX26 */ + struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; +#endif /* LINUX26 */ stats->rx_dropped++; + } #endif #ifdef CONFIG_ZAPATA_PPP if (ms->flags & ZT_FLAG_PPP) { -- cgit v1.2.3