| Rich, This patch is not related to you hardware platform, it's required to get TDMoE working properly on any platform... In my case, I am using it on Soekris box... You can save it as zaptel-tdmoe.patch within packages/zaptel and it will get automatically applied during compilation. Here is a patch: --- zaptel-1.2.5/zaptel.h 2005-12-16 21:04:05.000000000 -0500 +++ zaptel-1.2.5/zaptel.h 2006-05-24 00:27:00.000000000 -0400 @@ -1357,7 +1357,8 @@ void (*destroy)(void *tpipe); /* Transmit a given message */ - int (*transmit)(void *tpipe, unsigned char *msg, int msglen); + //int (*transmit)(void *tpipe, unsigned char *msg, int msglen); + struct sk_buff * (*transmit)(void *tpipe, unsigned char *msg, int msglen); struct zt_dynamic_driver *next; }; --- zaptel-1.2.5.orig/ztd-eth.c 2005-11-29 13:42:08.000000000 -0500 +++ zaptel-1.2.5/ztd-eth.c 2006-05-24 00:29:00.000000000 -0400 @@ -135,7 +135,8 @@ return 0; } -static int ztdeth_transmit(void *pvt, unsigned char *msg, int msglen) +//static int ztdeth_transmit(void *pvt, unsigned char *msg, int msglen) +static struct sk_buff *ztdeth_transmit(void *pvt, unsigned char *msg, int msglen) { struct ztdeth *z; struct sk_buff *skb; @@ -171,12 +172,14 @@ skb->dev = dev; if (dev->hard_header) dev->hard_header(skb, dev, ETH_P_ZTDETH, addr, dev->dev_addr, skb->len); - dev_queue_xmit(skb); + //dev_queue_xmit(skb); + return skb; } } else spin_unlock_irqrestore(&zlock, flags); - return 0; + //return 0; + return NULL; } static struct packet_type ztdeth_ptype = { --- zaptel-1.2.5/ztd-loc.c 2005-11-29 13:42:08.000000000 -0500 +++ zaptel-1.2.5/ztd-loc.c 2006-05-24 00:31:12.000000000 -0400 @@ -81,7 +81,8 @@ struct ztdlocal *next; } *zdevs = NULL; -/*static*/ int ztdlocal_transmit(void *pvt, unsigned char *msg, int msglen) +///*static*/ int ztdlocal_transmit(void *pvt, unsigned char *msg, int msglen) +/*static*/ struct sk_buff * ztdlocal_transmit(void *pvt, unsigned char *msg, int msglen) { struct ztdlocal *z; unsigned long flags; @@ -95,7 +96,8 @@ zt_dynamic_receive(z->monitor_rx_peer->span, msg, msglen); } spin_unlock_irqrestore(&zlock, flags); - return 0; + return NULL; + //return 0; } static int digit2int(char d) --- zaptel-1.2.5/ztdynamic.c 2005-11-29 13:42:08.000000000 -0500 +++ zaptel-1.2.5/ztdynamic.c 2006-05-24 00:37:47.000000000 -0400 @@ -31,6 +31,8 @@ #include <linux/slab.h> #include <linux/kmod.h> #include <linux/sched.h> +#include <linux/skbuff.h> +#include <linux/netdevice.h> #include <linux/interrupt.h> #include <linux/vmalloc.h> #ifdef CONFIG_DEVFS_FS @@ -166,7 +168,8 @@ printk("TDMoX: No master.\n"); } -static void ztd_sendmessage(struct zt_dynamic *z) +//static void ztd_sendmessage(struct zt_dynamic *z) +static struct sk_buff *ztd_sendmessage(struct zt_dynamic *z) { unsigned char *buf = z->msgbuf; unsigned short bits; @@ -222,7 +225,8 @@ msglen += ZT_CHUNKSIZE; } - z->driver->transmit(z->pvt, z->msgbuf, msglen); + //z->driver->transmit(z->pvt, z->msgbuf, msglen); + return z->driver->transmit(z->pvt, z->msgbuf, msglen); } @@ -230,7 +234,10 @@ { unsigned long flags; struct zt_dynamic *z; + struct sk_buff_head skbs; + struct sk_buff *skb; int y; + skb_queue_head_init(&skbs); spin_lock_irqsave(&dlock, flags); z = dspans; while(z) { @@ -242,12 +249,21 @@ } zt_receive(&z->span); zt_transmit(&z->span); - /* Handle all transmissions now */ - ztd_sendmessage(z); + // /* Handle all transmissions now */ + // ztd_sendmessage(z); + /* Prepare all transmissions packets */ + skb = ztd_sendmessage(z); + if(skb) skb_queue_tail(&skbs, skb); } z = z->next; } spin_unlock_irqrestore(&dlock, flags); + /* Handle all transmissions now */ + for(;;) { + skb = skb_dequeue(&skbs); + if(skb == NULL) break; + dev_queue_xmit(skb); + } } #ifdef ENABLE_TASKLETS @@ -773,8 +789,10 @@ z = dspans; while(z) { newalarm = z->span.alarms & ~ZT_ALARM_RED; - /* If nothing received for a minute, consider that RED ALARM */ - if ((jiffies - z->rxjif) > 1000 / HZ) { + ///* If nothing received for a minute, consider that RED ALARM */ + //if ((jiffies - z->rxjif) > 1000 / HZ) { + /* If nothing received for a second, consider that RED ALARM */ + if ((jiffies - z->rxjif) > 1 * HZ) { newalarm |= ZT_ALARM_RED; if (z->span.alarms != newalarm) { z->span.alarms = newalarm; Wojtek On 11-Sep-06, at 10:28 AM, Richard D Alloway wrote:
--- Wojtek |
_______________________________________________ Astlinux-users mailing list [email protected] http://lists.kriscompanies.com/mailman/listinfo/astlinux-users
Donations to support AstLinux are graciously accepted via PayPal to [EMAIL PROTECTED]
