diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-07-28 21:16:14 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-07-28 21:16:14 +0000 |
commit | 59d533b18bc76fb3b08c284dfe9fe84b124003e4 (patch) | |
tree | 94650374d6b8dc04ac50892b8eab515de8e12e60 /zaptel.c | |
parent | be1e5d408f5a953f3d8b6abed6017761c8a1beff (diff) |
Only use stats if NETHDLC not for PPP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@446 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-x | zaptel.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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) { |