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:


Hi Wojciech!

Do you recall what patch it was that you applied?

Did you apply it directly on a SC1100 SBC (Wrap, RouterBoard, Soekris, etc)?

Thanks!

-Rich

On Fri, 8 Sep 2006, Wojciech Tryc wrote:

I have TDMoE running on 0.4.3. Initially I experienced some problems but I 
applied small patch to Zaptel and since then everything works just fine
W
On 8-Sep-06, at 5:57 PM, Kristian Kielhofner wrote:

Richard D Alloway wrote:
On Fri, 8 Sep 2006, Kristian Kielhofner wrote:


Richard D Alloway wrote:

Thanks for the quick reply, Kristian!

Right now it's blank, but I did have wcfxo in there, but didn't know if 
my
X100p card was causing the problems...

Should I have something?

-Rich


Rich,

Try "ztd-eth" and then make sure that /stat/etc/zaptel.conf or
/mnt/kd/zaptel.conf is configured and reboot.


Okay, now the ztd-eth is static across reboots :)

That's a good thing!

But, when I do and ifconfig, I see there are 674582 RX packets and 27 TX
packets.  For some reason, even though the zaptel interface shows up (cat
/proc/zaptel/1 shows it) the box isn't sending the packets.

BTW, this is AstLinux 0.4.3 on a SC1100 SBC.

-Rich

Rich,

I have never used tdmoe before, here are some AstLinux specific 
things
to check:


1)  Make sure that your ethernet interfaces for TDMoE do not conflict
with any others (I doubt that is your problem here).

2)  Make sure that iptables isn't getting in the way.  Technically this
isn't IP territory, but just for kicks, try disabling iptables with
"service iptables stop".

3)  Clocking.  Try to stop zaptel/asterisk and unload everything, and
then try loading ztdummy and ztd-eth in different orders with different
span settings in zaptel.

Sorry I can't be of more help!

--
Kristian Kielhofner
_______________________________________________
Astlinux-users mailing list

Donations to support AstLinux are graciously accepted via PayPal to 



--- Wojtek




_______________________________________________
Astlinux-users mailing list

Donations to support AstLinux are graciously accepted via PayPal to [EMAIL PROTECTED].



--- 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]

Reply via email to