summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-01-12 16:28:18 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-01-12 16:28:18 +0000
commit73bf8cb603fb521dc2470a2626f35aa118c870c9 (patch)
tree61fadb0f8e2076599170d2dd84f0df361027c87a /zaptel.c
parent546553e2e2915d1a8ef2856c097b01e7d8c68a40 (diff)
Fix for HDLC API that might have been broken for some 2.4.x kernels, also fix to stop and start the
queues on the net interface. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@894 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rw-r--r--zaptel.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/zaptel.c b/zaptel.c
index 1dad83d..1c3a7f5 100644
--- a/zaptel.c
+++ b/zaptel.c
@@ -1310,6 +1310,8 @@ static int zt_net_open(hdlc_device *hdlc)
fasthdlc_init(&ms->txhdlc);
ms->infcs = PPP_INITFCS;
+ netif_start_queue(ztchan_to_dev(ms));
+
#ifndef LINUX26
MOD_INC_USE_COUNT;
#endif
@@ -1322,8 +1324,13 @@ static int zt_net_open(hdlc_device *hdlc)
#ifdef NEW_HDLC_INTERFACE
static int zt_net_stop(struct net_device *dev)
{
- hdlc_device *h = dev_to_hdlc(dev);
- struct zt_hdlc *hdlc = h->priv;
+#ifdef LINUX26
+ hdlc_device *h = dev_to_hdlc(dev);
+ struct zt_hdlc *hdlc = h->priv;
+#else
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+#endif
+
#else
static void zt_net_close(hdlc_device *hdlc)
{
@@ -1348,6 +1355,7 @@ static void zt_net_close(hdlc_device *hdlc)
#endif
}
/* Not much to do here. Just deallocate the buffers */
+ netif_stop_queue(ztchan_to_dev(ms));
zt_reallocbufs(ms, 0, 0);
#ifdef LINUX26
hdlc_close(dev);
@@ -1464,7 +1472,9 @@ static int zt_xmit(hdlc_device *hdlc, struct sk_buff *skb)
if (ss->inwritebuf == ss->outwritebuf) {
/* Whoops, no more space. */
- ss->inwritebuf = -1;
+ ss->inwritebuf = -1;
+
+ netif_stop_queue(ztchan_to_dev(ss));
}
if (ss->outwritebuf < 0) {
/* Let the interrupt handler know there's