summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-07-28 21:16:14 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-07-28 21:16:14 +0000
commit59d533b18bc76fb3b08c284dfe9fe84b124003e4 (patch)
tree94650374d6b8dc04ac50892b8eab515de8e12e60 /zaptel.c
parentbe1e5d408f5a953f3d8b6abed6017761c8a1beff (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-xzaptel.c20
1 files 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) {