Author: arekm                        Date: Wed Jul 16 19:52:08 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated for 1.4.11

---- Files affected:
SOURCES:
   zaptel-bristuff.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/zaptel-bristuff.patch
diff -u SOURCES/zaptel-bristuff.patch:1.4 SOURCES/zaptel-bristuff.patch:1.5
--- SOURCES/zaptel-bristuff.patch:1.4   Sun May 25 14:13:22 2008
+++ SOURCES/zaptel-bristuff.patch       Wed Jul 16 21:52:03 2008
@@ -1,7 +1,7 @@
-diff -urN zaptel-1.4.8.org/cwain/cwain.c zaptel-1.4.8/cwain/cwain.c
---- zaptel-1.4.8.org/cwain/cwain.c     1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/cwain.c 2008-02-09 17:56:18.498299056 +0100
-@@ -0,0 +1,2206 @@
+diff -urN zaptel-1.4.11.org/cwain/cwain.c zaptel-1.4.11/cwain/cwain.c
+--- zaptel-1.4.11.org/cwain/cwain.c    1970-01-01 01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/cwain.c        2008-07-16 21:26:32.000000000 +0200
+@@ -0,0 +1,2236 @@
 +/*
 + * cwain.c - Zaptel driver for the Junghanns.NET E1 card
 + *
@@ -157,7 +157,7 @@
 +    if (!(cwaintmp->span.flags & ZT_FLAG_RUNNING)) {
 +      return;
 +    }
-+    if ((cwaintmp->type == 0xb553) || (cwaintmp->type == 0xb554)) {
++    if ((cwaintmp->type == 0xb553) || (cwaintmp->type == 0xb554) || 
(cwaintmp->type == 0xb555)) {
 +      /* sync status */
 +      if (((cwaintmp->sync_sta & 0x07) == 0x07) && cwaintmp->sync) {
 +          cwaintmp->leds[0] = 1;    
@@ -235,8 +235,14 @@
 +    cwain_outb(cwaintmp,cwain_R_CTRL,0x0); 
 +
 +    /* no blinky blink */
-+    cwain_outb(cwaintmp,cwain_R_GPIO_SEL,0x20 | 0x10);
-+    cwain_outb(cwaintmp,cwain_R_GPIO_EN1,0x0f);
++    if (cwaintmp->type == 0xb555) {
++      cwain_outb(cwaintmp,cwain_R_GPIO_SEL,0x20 | 0x10 | 0x02);
++      cwain_outb(cwaintmp,cwain_R_GPIO_EN1,0x0f);
++      cwain_outb(cwaintmp,cwain_R_GPIO_EN0,0x08 | 0x04);
++    } else {
++      cwain_outb(cwaintmp,cwain_R_GPIO_SEL,0x20 | 0x10);
++      cwain_outb(cwaintmp,cwain_R_GPIO_EN1,0x0f);
++    }
 +    cwain_outb(cwaintmp,cwain_R_GPIO_OUT1,0x0f);
 +
 +    /* IRQs off */
@@ -329,13 +335,14 @@
 +      
 +          spin_lock_init(&cwaintmp->lock);
 +          cwaintmp->pcibus = cwainspan->pcibus;
-+          cwaintmp->spans = cwainspan->type - 46419;
++//        cwaintmp->spans = cwainspan->type - 46419;
++          cwaintmp->spans = (cwainspan->type & (2321 * 20)) - 46419;
 +          cwaintmp->span[0] = cwainspan;
 +          cwaintmp->cardID = cwainspan->cardID;
 +          cwaintmp->syncs[0] = -1;
 +          cwain_register_card(cwaintmp);
 +      } else {
-+          cwaintmp->spans = cwainspan->type - 46418;
++          cwaintmp->spans = (cwainspan->type & (2321 * 20)) - 46418;
 +          if (cwainspan->cardID < cwaintmp->cardID) {
 +              cwaintmp->cardID = cwainspan->cardID;
 +              cwaintmp->span[1] = cwaintmp->span[0];
@@ -346,8 +353,8 @@
 +              cwaintmp->syncs[1] = -1;
 +          }
 +          printk(KERN_INFO
-+              "cwain: Junghanns.NET doubleE1 PCI ISDN card configured at mem 
(%lx / %lx) IRQ %d HZ %d CardID (%d / %d) bus %#x\n",
-+                (unsigned long) cwaintmp->span[0]->pci_io, (unsigned long) 
cwaintmp->span[1]->pci_io,
++              "cwain: Junghanns.NET doubleE1 PCI ISDN %d.0 card configured at 
mem (%lx / %lx) IRQ %d HZ %d CardID (%d / %d) bus %#x\n",
++              (cwainspan->type - 0xb553),  (unsigned long) 
cwaintmp->span[0]->pci_io, (unsigned long) cwaintmp->span[1]->pci_io,
 +              cwaintmp->span[0]->irq, HZ, cwaintmp->span[0]->cardID, 
cwaintmp->span[1]->cardID, cwaintmp->pcibus);
 +      }
 +    }
@@ -1110,6 +1117,16 @@
 +
 +static inline void cwain_audio_run(struct zt_cwain *cwaintmp) {
 +    int fifo=0;
++    
++    if (cwaintmp->wdp) {
++      if (cwaintmp->wdp == 0x04) {
++          cwaintmp->wdp = 0x08;
++      } else {
++          cwaintmp->wdp = 0x04;
++      }
++      cwain_outb(cwaintmp, cwain_R_GPIO_OUT0, cwaintmp->wdp);
++    }
++    
 +    if (hdlcnet) return;
 +    
 +    if (hw_hdlc) {
@@ -1231,19 +1248,25 @@
 +      if (sync_ok) {
 +          switch (cwainspan->type) {
 +              case 0xb553:
-+                  sprintf(cwainspan->span.desc,"Junghanns.NET singleE1 PCI 
ISDN Card %d (cardID %d) SYNCED",cwainspan->cardno,cwainspan->cardID);
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET singleE1 PCI ISDN %d (cardID %d) 
SYNCED",cwainspan->cardno,cwainspan->cardID);
 +                  break;
 +              case 0xb554:
-+                  sprintf(cwainspan->span.desc,"Junghanns.NET doubleE1 PCI 
ISDN Card %d (cardID %d) (1 E1 port) 
SYNCED",cwainspan->cardno,cwainspan->cardID);
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET doubleE1 PCI ISDN %d (cardID %d) 
(1 E1 port) SYNCED",cwainspan->cardno,cwainspan->cardID);
++                  break;
++              case 0xb555:
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET doubleE1 PCI ISDN 2.0 %d (cardID 
%d) (1 E1 port) SYNCED",cwainspan->cardno,cwainspan->cardID);
 +                  break;
 +          }
 +      } else {
 +          switch (cwainspan->type) {
 +              case 0xb553:
-+                  sprintf(cwainspan->span.desc,"Junghanns.NET singleE1 PCI 
ISDN Card %d (cardID %d) NO SYNC (sync_sta = 
%#x)",cwainspan->cardno,cwainspan->cardID, sync_sta);
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET singleE1 PCI ISDN %d (cardID %d) 
NO SYNC (sync_sta = %#x)",cwainspan->cardno,cwainspan->cardID, sync_sta);
 +                  break;
 +              case 0xb554:
-+                  sprintf(cwainspan->span.desc,"Junghanns.NET doubleE1 PCI 
ISDN Card %d (cardID %d) (1 E1 port) NO SYNC (sync_sta = 
%#x)",cwainspan->cardno,cwainspan->cardID, sync_sta);
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET doubleE1 PCI ISDN %d (cardID %d) 
(1 E1 port) NO SYNC (sync_sta = %#x)",cwainspan->cardno,cwainspan->cardID, 
sync_sta);
++                  break;
++              case 0xb555:
++                  snprintf(cwainspan->span.desc, 
sizeof(cwainspan->span.desc), "Junghanns.NET doubleE1 PCI ISDN 2.0 %d (cardID 
%d) (1 E1 port) NO SYNC (sync_sta = %#x)",cwainspan->cardno,cwainspan->cardID, 
sync_sta);
 +                  break;
 +          }
 +      }
@@ -1817,6 +1840,9 @@
 +    cwain_outb(cwaintmp,cwain_R_IRQ_CTRL, 0); 
 +    cwain_inb(cwaintmp,cwain_R_STATUS);
 +
++    cwain_outb(cwaintmp,cwain_R_GPIO_EN0,0x00);
++    cwain_outb(cwaintmp,cwain_R_GPIO_EN1,0x00);
++
 +
 +    span->flags &= ~ZT_FLAG_RUNNING;
 +
@@ -1861,10 +1887,14 @@
 +      sprintf(cwaintmp->span.name,"cwain/%d",cwaintmp->cardno);
 +      switch (cwaintmp->type) {
 +          case 0xb553:
-+              sprintf(cwaintmp->span.desc,"Junghanns.NET singleE1 PCI ISDN 
Card %d (cardID %d)",cwaintmp->cardno,cwaintmp->cardID);
++              snprintf(cwaintmp->span.desc, sizeof(cwaintmp->span.desc), 
"Junghanns.NET singleE1 PCI ISDN %d (cardID 
%d)",cwaintmp->cardno,cwaintmp->cardID);
 +              break;
 +          case 0xb554:
-+              sprintf(cwaintmp->span.desc,"Junghanns.NET doubleE1 PCI ISDN 
Card %d (cardID %d) (1 E1 port)",cwaintmp->cardno,cwaintmp->cardID);
++              snprintf(cwaintmp->span.desc, sizeof(cwaintmp->span.desc), 
"Junghanns.NET doubleE1 PCI ISDN %d (cardID %d) (1 E1 
port)",cwaintmp->cardno,cwaintmp->cardID);
++              break;
++          case 0xb555:
++              snprintf(cwaintmp->span.desc, sizeof(cwaintmp->span.desc), 
"Junghanns.NET doubleE1 PCI ISDN 2.0 %d (cardID %d) (1 E1 
port)",cwaintmp->cardno,cwaintmp->cardID);
++              cwaintmp->wdp = 0x04;
 +              break;
 +          default:
 +              return -1;
@@ -2042,7 +2072,7 @@
 +      /* disable interrupts */
 +      cwain_outb(cwaintmp,cwain_R_IRQ_CTRL, 0); 
 +
-+        if (((tmp->subsystem_device==0xb553) || 
(tmp->subsystem_device==0xb554))&& (pcidid == PCI_DEVICE_ID_CCD_E)) {
++        if (((tmp->subsystem_device==0xb553)|| 
(tmp->subsystem_device==0xb554) || (tmp->subsystem_device==0xb555))&& (pcidid 
== PCI_DEVICE_ID_CCD_E)) {
 +          dips = (cwain_inb(cwaintmp,cwain_R_GPI_IN0) >> 5);
 +          cid = 7;
 +          for (i=0;i<3;i++) {
@@ -2208,10 +2238,10 @@
 +#ifdef MODULE_LICENSE
 +MODULE_LICENSE("GPL");
 +#endif        
-diff -urN zaptel-1.4.8.org/cwain/cwain.h zaptel-1.4.8/cwain/cwain.h
---- zaptel-1.4.8.org/cwain/cwain.h     1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/cwain.h 2008-02-09 17:56:18.498299056 +0100
-@@ -0,0 +1,251 @@
+diff -urN zaptel-1.4.11.org/cwain/cwain.h zaptel-1.4.11/cwain/cwain.h
+--- zaptel-1.4.11.org/cwain/cwain.h    1970-01-01 01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/cwain.h        2008-07-16 21:26:32.000000000 +0200
+@@ -0,0 +1,252 @@
 +#define cwain_FIFO_SIZE       128
 +#define cwain_DFIFO_SIZE      4096
 +#define cwain_DFIFO_FRAMES    0x10
@@ -2247,6 +2277,7 @@
 +    
 +    /* blinky blink */
 +    unsigned char leds[4];
++    unsigned int wdp;
 +
 +    /* B chan buffers */
 +    unsigned char rxbuf[31][ZT_CHUNKSIZE];
@@ -2463,9 +2494,9 @@
 +#define CLKDEL_TE     0xe     /* CLKDEL in TE mode */
 +#define CLKDEL_NT     0xc     /* CLKDEL in NT mode */
 +
-diff -urN zaptel-1.4.8.org/cwain/Makefile zaptel-1.4.8/cwain/Makefile
---- zaptel-1.4.8.org/cwain/Makefile    1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/Makefile        2008-02-09 17:56:18.501632550 +0100
+diff -urN zaptel-1.4.11.org/cwain/Makefile zaptel-1.4.11/cwain/Makefile
+--- zaptel-1.4.11.org/cwain/Makefile   1970-01-01 01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/Makefile       2008-07-16 21:26:32.000000000 +0200
 @@ -0,0 +1,88 @@
 +KINCLUDES = /usr/src/linux/include
 +BRISTUFFBASE = $(shell dirname `pwd`)
@@ -2555,14 +2586,14 @@
 +
 +unload: 
 +      rmmod cwain zaptel
-diff -urN zaptel-1.4.8.org/cwain/TODO zaptel-1.4.8/cwain/TODO
---- zaptel-1.4.8.org/cwain/TODO        1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/TODO    2008-02-09 17:56:18.498299056 +0100
+diff -urN zaptel-1.4.11.org/cwain/TODO zaptel-1.4.11/cwain/TODO
+--- zaptel-1.4.11.org/cwain/TODO       1970-01-01 01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/TODO   2008-07-16 21:26:32.000000000 +0200
 @@ -0,0 +1 @@
 +
-diff -urN zaptel-1.4.8.org/cwain/zapata.conf zaptel-1.4.8/cwain/zapata.conf
---- zaptel-1.4.8.org/cwain/zapata.conf 1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/zapata.conf     2008-02-09 17:56:18.501632550 +0100
+diff -urN zaptel-1.4.11.org/cwain/zapata.conf zaptel-1.4.11/cwain/zapata.conf
+--- zaptel-1.4.11.org/cwain/zapata.conf        1970-01-01 01:00:00.000000000 
+0100
++++ zaptel-1.4.11/cwain/zapata.conf    2008-07-16 21:26:32.000000000 +0200
 @@ -0,0 +1,32 @@
 +;
 +; Zapata telephony interface
@@ -2596,9 +2627,9 @@
 +group = 1
 +channel => 1-15,17-31
 +
-diff -urN zaptel-1.4.8.org/cwain/zapata.conf.doubleE1 
zaptel-1.4.8/cwain/zapata.conf.doubleE1
---- zaptel-1.4.8.org/cwain/zapata.conf.doubleE1        1970-01-01 
01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/zapata.conf.doubleE1    2008-02-09 17:56:18.501632550 
+0100
+diff -urN zaptel-1.4.11.org/cwain/zapata.conf.doubleE1 
zaptel-1.4.11/cwain/zapata.conf.doubleE1
+--- zaptel-1.4.11.org/cwain/zapata.conf.doubleE1       1970-01-01 
01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/zapata.conf.doubleE1   2008-07-16 21:26:32.000000000 
+0200
 @@ -0,0 +1,35 @@
 +;
 +; Zapata telephony interface
@@ -2635,9 +2666,9 @@
 +group = 2
 +channel => 32-46,48-62
 +
-diff -urN zaptel-1.4.8.org/cwain/zaptel.conf zaptel-1.4.8/cwain/zaptel.conf
---- zaptel-1.4.8.org/cwain/zaptel.conf 1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/zaptel.conf     2008-02-09 17:56:18.498299056 +0100
+diff -urN zaptel-1.4.11.org/cwain/zaptel.conf zaptel-1.4.11/cwain/zaptel.conf
+--- zaptel-1.4.11.org/cwain/zaptel.conf        1970-01-01 01:00:00.000000000 
+0100
++++ zaptel-1.4.11/cwain/zaptel.conf    2008-07-16 21:26:32.000000000 +0200
 @@ -0,0 +1,11 @@
 +loadzone=nl
 +defaultzone=nl
@@ -2650,9 +2681,9 @@
 +bchan=17-31
 +
 +
-diff -urN zaptel-1.4.8.org/cwain/zaptel.conf.doubleE1 
zaptel-1.4.8/cwain/zaptel.conf.doubleE1
---- zaptel-1.4.8.org/cwain/zaptel.conf.doubleE1        1970-01-01 
01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/zaptel.conf.doubleE1    2008-02-09 17:56:18.498299056 
+0100
+diff -urN zaptel-1.4.11.org/cwain/zaptel.conf.doubleE1 
zaptel-1.4.11/cwain/zaptel.conf.doubleE1
+--- zaptel-1.4.11.org/cwain/zaptel.conf.doubleE1       1970-01-01 
01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/zaptel.conf.doubleE1   2008-07-16 21:26:32.000000000 
+0200
 @@ -0,0 +1,14 @@
 +loadzone=nl
 +defaultzone=nl
@@ -2668,9 +2699,9 @@
 +bchan=32-46
 +dchan=47
 +bchan=48-62
-diff -urN zaptel-1.4.8.org/cwain/zaptel.conf.hdlcnet 
zaptel-1.4.8/cwain/zaptel.conf.hdlcnet
---- zaptel-1.4.8.org/cwain/zaptel.conf.hdlcnet 1970-01-01 01:00:00.000000000 
+0100
-+++ zaptel-1.4.8/cwain/zaptel.conf.hdlcnet     2008-02-09 17:56:18.501632550 
+0100
+diff -urN zaptel-1.4.11.org/cwain/zaptel.conf.hdlcnet 
zaptel-1.4.11/cwain/zaptel.conf.hdlcnet
+--- zaptel-1.4.11.org/cwain/zaptel.conf.hdlcnet        1970-01-01 
01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/zaptel.conf.hdlcnet    2008-07-16 21:26:32.000000000 
+0200
 @@ -0,0 +1,8 @@
 +loadzone=nl
 +defaultzone=nl
@@ -2680,9 +2711,9 @@
 +hdlcnet=1
 +
 +
-diff -urN zaptel-1.4.8.org/cwain/zaptel.conf.hdlcnet.doubleE1 
zaptel-1.4.8/cwain/zaptel.conf.hdlcnet.doubleE1
---- zaptel-1.4.8.org/cwain/zaptel.conf.hdlcnet.doubleE1        1970-01-01 
01:00:00.000000000 +0100
-+++ zaptel-1.4.8/cwain/zaptel.conf.hdlcnet.doubleE1    2008-02-09 
17:56:18.501632550 +0100
+diff -urN zaptel-1.4.11.org/cwain/zaptel.conf.hdlcnet.doubleE1 
zaptel-1.4.11/cwain/zaptel.conf.hdlcnet.doubleE1
+--- zaptel-1.4.11.org/cwain/zaptel.conf.hdlcnet.doubleE1       1970-01-01 
01:00:00.000000000 +0100
++++ zaptel-1.4.11/cwain/zaptel.conf.hdlcnet.doubleE1   2008-07-16 
21:26:32.000000000 +0200
 @@ -0,0 +1,10 @@
 +loadzone=nl
 +defaultzone=nl
@@ -2695,9 +2726,9 @@
 +; hdlc 1
 +hdlcnet = 2
 \ Brak znaku nowej linii na końcu pliku
-diff -urN zaptel-1.4.8.org/ds1x1f.c zaptel-1.4.8/ds1x1f.c
---- zaptel-1.4.8.org/ds1x1f.c  1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/ds1x1f.c      2008-02-09 17:56:18.508299536 +0100
+diff -urN zaptel-1.4.11.org/ds1x1f.c zaptel-1.4.11/ds1x1f.c
+--- zaptel-1.4.11.org/ds1x1f.c 1970-01-01 01:00:00.000000000 +0100
++++ zaptel-1.4.11/ds1x1f.c     2008-07-16 21:26:32.000000000 +0200
 @@ -0,0 +1,2089 @@
 +//=======================================================================
 +//            T1/E1 PCI card with failover  DS1x1F card Driver
@@ -4788,49 +4819,188 @@
 +module_init(ds1_init);
 +module_exit(ds1_cleanup);
 +
-diff -urN zaptel-1.4.8.org/Makefile zaptel-1.4.8/Makefile
---- zaptel-1.4.8.org/Makefile  2008-01-08 23:09:08.000000000 +0100
-+++ zaptel-1.4.8/Makefile      2008-02-09 17:56:55.610077902 +0100
-@@ -105,8 +105,8 @@
- endif
- #SUBDIRS_UTILS        += ppp
- 
--TOPDIR_MODULES:=pciradio tor2 torisa wcfxo wct1xxp wctdm wcte11xp wcusb 
zaptel ztd-eth ztd-loc ztdummy ztdynamic zttranscode
--SUBDIR_MODULES:=wct4xxp wctc4xxp xpp wctdm24xxp wcte12xp
-+TOPDIR_MODULES:=pciradio tor2 torisa wcfxo wct1xxp wctdm wcte11xp wcusb 
zaptel ztd-eth ztd-loc ztdummy ztdynamic zttranscode opvxa1200 wcopenpci
-+SUBDIR_MODULES:=wct4xxp wctc4xxp xpp wctdm24xxp wcte12xp cwain qozap vzaphfc 
zaphfc ztgsm
- TOPDIR_MODULES+=$(MODULES_EXTRA)
- SUBDIR_MODULES+=$(SUBDIRS_EXTRA)
- BUILD_TOPDIR_MODULES:=$(filter-out $(MENUSELECT_MODULES),$(TOPDIR_MODULES))
-@@ -440,6 +440,20 @@
-       tar -zxf mISDNuser-$(MISDNUSERVERSION).tar.gz
-       $(MAKE) -C mISDNuser-$(MISDNUSERVERSION) install
+diff -urN zaptel-1.4.11.org/kernel/zaptel-base.c 
zaptel-1.4.11/kernel/zaptel-base.c
+--- zaptel-1.4.11.org/kernel/zaptel-base.c     2008-05-11 03:57:08.000000000 
+0200
++++ zaptel-1.4.11/kernel/zaptel-base.c 2008-07-16 21:30:39.658027584 +0200
+@@ -136,6 +136,7 @@
+ EXPORT_SYMBOL(zt_qevent_lock);
+ EXPORT_SYMBOL(zt_hooksig);
+ EXPORT_SYMBOL(zt_alarm_notify);
++EXPORT_SYMBOL(zt_alarm_notify_no_master_change);
+ EXPORT_SYMBOL(zt_set_dynamic_ioctl);
+ EXPORT_SYMBOL(zt_ec_chunk);
+ EXPORT_SYMBOL(zt_ec_span);
+@@ -609,6 +610,10 @@
+               len += sprintf(page + len, "\tTiming slips: %d\n", 
spans[span]->timingslips);
+       len += sprintf(page + len, "\n");
  
-+# copy bristuff files from subdirectories
-+# provide zaphfc.[ch] from zaphfc/zaphfc.[ch] etc. Any better way?
-+ztgsm.%: ztgsm/ztgsm.%
-+      cp $^ $@
++      if (spans[span]->proc_read) {
++              len += spans[span]->proc_read(spans[span], page + len);
++      }
 +
-+zaphfc.%: zaphfc/zaphfc.%
-+      cp $^ $@
+ 
+         for (x=1;x<ZT_MAX_CHANNELS;x++) {     
+               if (chans[x]) {
+@@ -3191,6 +3196,30 @@
+       }
+ }
+ 
++void zt_alarm_notify_no_master_change(struct zt_span *span)
++{
++      int j;
++      int x;
 +
-+qozap.%: qozap/qozap.%
-+      cp $^ $@
++      span->alarms &= ~ZT_ALARM_LOOPBACK;
++      /* Determine maint status */
++      if (span->maintstat || span->mainttimer)
++              span->alarms |= ZT_ALARM_LOOPBACK;
++      /* DON'T CHANGE THIS AGAIN. THIS WAS DONE FOR A REASON.
++         The expression (a != b) does *NOT* do the same thing
++         as ((!a) != (!b)) */
++      /* if change in general state */
++      if ((!span->alarms) != (!span->lastalarms)) {
++              if (span->alarms)
++                      j = ZT_EVENT_ALARM;
++              else
++                      j = ZT_EVENT_NOALARM;
++              span->lastalarms = span->alarms;
++              for (x=0;x < span->channels;x++)
++                      zt_qevent_lock(&span->chans[x], j);
++      }
++}
 +
-+cwain.%: cwain/cwain.%
-+      cp $^ $@
+ #define VALID_SPAN(j) do { \
+       if ((j >= ZT_MAX_SPANS) || (j < 1)) \
+               return -EINVAL; \
+@@ -5744,11 +5773,40 @@
+                                       *(txb++) = 
fasthdlc_tx_run_nocheck(&ms->txhdlc);
+                               }
+                               bytes -= left;
++#ifdef CONFIG_ZAPATA_BRI_DCHANS
++                      } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
++                          /*
++                           * Let's get this right, we want to transmit 
complete frames only.
++                           * The card driver will do the dirty HDLC work for 
us.
++                           * txb (transmit buffer) is supposed to be big 
enough to store one frame
++                           * we will make this as big as the D fifo (1KB or 
2KB)
++                           */
 +
- $(UTILS): %: %.o
-       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
++                          /* there are 'left' bytes in the user buffer left 
to transmit */
++                          left = ms->writen[ms->outwritebuf] - 
ms->writeidx[ms->outwritebuf] - 2;
++                          if (left > ms->maxbytes2transmit) {
++                              memcpy(txb, buf + 
ms->writeidx[ms->outwritebuf], ms->maxbytes2transmit);
++                              ms->writeidx[ms->outwritebuf] += 
ms->maxbytes2transmit;
++                              txb += ms->maxbytes2transmit;
++                              ms->bytes2transmit = ms->maxbytes2transmit;
++                              ms->eoftx = 0;
++                          } else {
++                              memcpy(txb, buf + 
ms->writeidx[ms->outwritebuf], left);
++                              ms->writeidx[ms->outwritebuf] += left + 2;
++                              txb += left + 2;
++                              ms->bytes2transmit = left;
++                              ms->eoftx = 1;
++                          }
++                          bytes = 0;
++#endif
+                       } else {
+                               memcpy(txb, buf + 
ms->writeidx[ms->outwritebuf], left);
+                               ms->writeidx[ms->outwritebuf]+=left;
+                               txb += left;
+                               bytes -= left;
++#if defined(CONFIG_ZAPATA_BRI_DCHANS) 
++                              ms->bytes2transmit=ZT_CHUNKSIZE;
++#endif
+                       }
+                       /* Check buffer status */
+                       if (ms->writeidx[ms->outwritebuf] >= 
ms->writen[ms->outwritebuf]) {
+@@ -5805,6 +5863,17 @@
+                               /* Transmit a flag if this is an HDLC channel */
+                               if (ms->flags & ZT_FLAG_HDLC)
+                                       fasthdlc_tx_frame_nocheck(&ms->txhdlc);
++#if defined(CONFIG_ZAPATA_BRI_DCHANS) 
++                              if(ms->flags & ZT_FLAG_BRIDCHAN) { 
++                      //          if (ms->bytes2transmit > 0) {
++                                      // txb += 2;
++                                      // ms->bytes2transmit -= 2;
++                                      bytes=0;
++                                      ms->eoftx = 1;
++//                                    printk(KERN_CRIT "zaptel EOF(%d) 
bytes2transmit %d\n",ms->eoftx,ms->bytes2transmit);
++                      //          }
++                              }
++#endif
+ #ifdef CONFIG_ZAPATA_NET
+                               if (ms->flags & ZT_FLAG_NETDEV)
+                                       netif_wake_queue(ztchan_to_dev(ms));
+@@ -5865,6 +5934,12 @@
+                               memset(txb, 0xFF, bytes);
+                       }
+                       bytes = 0;
++#if defined(CONFIG_ZAPATA_BRI_DCHANS) 
++              } else if(ms->flags & ZT_FLAG_BRIDCHAN) { 
++                  ms->bytes2transmit = 0;
++                  ms->eoftx = 0;
++                  bytes = 0;
++#endif
+               } else {
+                       memset(txb, ZT_LIN2X(0, ms), bytes);    /* Lastly we 
use silence on telephony channels */
+                       bytes = 0;
+@@ -6683,6 +6758,14 @@
+       int res;
+       int left, x;
  
-diff -urN zaptel-1.4.8.org/opvxa1200.c zaptel-1.4.8/opvxa1200.c
---- zaptel-1.4.8.org/opvxa1200.c       1970-01-01 01:00:00.000000000 +0100
-+++ zaptel-1.4.8/opvxa1200.c   2008-02-09 17:56:18.504966042 +0100
-@@ -0,0 +1,2718 @@
++#if defined(CONFIG_ZAPATA_BRI_DCHANS) 
++      if (ms->flags & ZT_FLAG_BRIDCHAN) {
++          bytes = ms->bytes2receive;
++          if (bytes < 1) return;
++//        printk(KERN_CRIT "bytes2receive %d\n",ms->bytes2receive);
++      }
++#endif
++
+       while(bytes) {
+ #if defined(CONFIG_ZAPATA_NET)  || defined(CONFIG_ZAPATA_PPP)
+               skb = NULL;
+@@ -6740,6 +6823,19 @@
+                                               }
+                                       }
+                               }
++#ifdef CONFIG_ZAPATA_BRI_DCHANS
++                      } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
++                          memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
++                          rxb += left;
++                          ms->readidx[ms->inreadbuf] += left;
++                          bytes -= left;
++                          if (ms->eofrx == 1) {
++                              eof=1;
++                          }
++//                        printk(KERN_CRIT "receiving %d 
bytes\n",ms->bytes2receive);
++                          ms->bytes2receive = 0;
++                          ms->eofrx = 0;
++#endif
+                       } else {
+                               /* Not HDLC */
+                               memcpy(buf + ms->readidx[ms->inreadbuf], rxb, 
left);
+diff -urN zaptel-1.4.11.org/kernel/zaptel-base.c.orig 
zaptel-1.4.11/kernel/zaptel-base.c.orig
+--- zaptel-1.4.11.org/kernel/zaptel-base.c.orig        1970-01-01 
01:00:00.000000000 +0100
++++ zaptel-1.4.11/kernel/zaptel-base.c.orig    2008-05-11 03:57:08.000000000 
+0200
+@@ -0,0 +1,7801 @@
 +/*
-+ * OpenVox A1200P FXS/FXO Interface Driver for Zapata Telephony interface
++ * Zapata Telephony Interface Driver
 + *
-+ * Modify from wctdm.c by MiaoLin<[EMAIL PROTECTED]>
++ * Written by Mark Spencer <[EMAIL PROTECTED]>
++ * Based on previous works, designs, and architectures conceived and
++ * written by Jim Dixon <[EMAIL PROTECTED]>.
++ * 
++ * Special thanks to Steve Underwood <[EMAIL PROTECTED]>
++ * for substantial contributions to signal processing functions 
++ * in zaptel and the zapata library.
++ *
++ * Yury Bokhoncovich <[EMAIL PROTECTED]>
++ * Adaptation for 2.4.20+ kernels (HDLC API was changed)
++ * The work has been performed as a part of our move
++ * from Cisco 3620 to IBM x305 here in F1 Group
++ *
++ * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
++ * Copyright (C) 2001 -2006 Digium, Inc.
 + *
 + * All rights reserved.
 + *
@@ -4847,82 +5017,10283 @@
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
-+ *
 + */
 +
-+/* Rev histroy
-+ *
-+ * Rev 0.10 initial version   
-+ * Rev 0.11 
-+ *    fixed the led light on/off bug.
-+ *    modify some wctdm print to opvxa1200
-+ *    support firmware version 1.2, faster i/o operation, and better LED 
control.
-+ * 
-+ * Rev 0.12 patched to support new pci id 0x8519
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ * 
-+ */
++
++#include "zconfig.h"
++#include "../version.h"
 +
 +#include <linux/kernel.h>
 +#include <linux/errno.h>
 +#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/errno.h>
++#include <linux/proc_fs.h>
 +#include <linux/pci.h>
-+#include <linux/interrupt.h>
-+#include <asm/io.h>
-+#include "proslic.h"
-+#include "wctdm.h"
-+  
-+//miaolin
-+#include <linux/string.h>
-+#include <asm/uaccess.h> // get_fs(), set_fs(), KERNEL_DS
-+#include <linux/file.h> // fput()
-+//miaolin
-+  
++#include <linux/init.h>
++#include <linux/version.h>
++#include <linux/ctype.h>
++#include <linux/kmod.h>
++#ifdef CONFIG_DEVFS_FS
++#include <linux/devfs_fs_kernel.h>
++#endif /* CONFIG_DEVFS_FS */
++#ifdef CONFIG_ZAPATA_NET
++#include <linux/netdevice.h>
++#endif /* CONFIG_ZAPATA_NET */
++#include <linux/ppp_defs.h>
++#ifdef CONFIG_ZAPATA_PPP
++#include <linux/netdevice.h>
++#include <linux/if.h>
++#include <linux/if_ppp.h>
++#endif
++#include <asm/atomic.h>
 +
-+/*
-+ *  Define for audio vs. register based ring detection
-+ *  
-+ */
-+/* #define AUDIO_RINGCHECK  */
++#ifndef CONFIG_OLD_HDLC_API
++#define NEW_HDLC_INTERFACE
++#endif
 +
-+/*
-+  Experimental max loop current limit for the proslic
-+  Loop current limit is from 20 mA to 41 mA in steps of 3
-+  (according to datasheet)
-+  So set the value below to:
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/zaptel-bristuff.patch?r1=1.4&r2=1.5&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to