1 Only in zaptel-1.2.5: version.h
2 Only in zaptel-1.2.5: zaptel
3 diff -ur zaptel-1.2.5.orig/zaptel.c zaptel-1.2.5/zaptel.c
4 --- zaptel-1.2.5.orig/zaptel.c 2005-12-17 03:04:05.000000000 +0100
5 +++ zaptel-1.2.5/zaptel.c 2006-04-10 10:39:37.000000000 +0200
6 @@ -4913,11 +4913,40 @@
7 *(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
10 +#ifdef CONFIG_ZAPATA_BRI_DCHANS
11 + } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
13 + * Let's get this right, we want to transmit complete frames only.
14 + * The card driver will do the dirty HDLC work for us.
15 + * txb (transmit buffer) is supposed to be big enough to store one frame
16 + * we will make this as big as the D fifo (1KB or 2KB)
19 + /* there are 'left' bytes in the user buffer left to transmit */
20 + left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf] - 2;
21 + if (left > ms->maxbytes2transmit) {
22 + memcpy(txb, buf + ms->writeidx[ms->outwritebuf], ms->maxbytes2transmit);
23 + ms->writeidx[ms->outwritebuf] += ms->maxbytes2transmit;
24 + txb += ms->maxbytes2transmit;
25 + ms->bytes2transmit = ms->maxbytes2transmit;
28 + memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
29 + ms->writeidx[ms->outwritebuf] += left + 2;
31 + ms->bytes2transmit = left;
37 memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
38 ms->writeidx[ms->outwritebuf]+=left;
41 +#if defined(CONFIG_ZAPATA_BRI_DCHANS)
42 + ms->bytes2transmit=ZT_CHUNKSIZE;
45 /* Check buffer status */
46 if (ms->writeidx[ms->outwritebuf] >= ms->writen[ms->outwritebuf]) {
47 @@ -4962,6 +4991,17 @@
48 /* Transmit a flag if this is an HDLC channel */
49 if (ms->flags & ZT_FLAG_HDLC)
50 fasthdlc_tx_frame_nocheck(&ms->txhdlc);
51 +#if defined(CONFIG_ZAPATA_BRI_DCHANS)
52 + if(ms->flags & ZT_FLAG_BRIDCHAN) {
53 + // if (ms->bytes2transmit > 0) {
55 + // ms->bytes2transmit -= 2;
58 +// printk(KERN_CRIT "zaptel EOF(%d) bytes2transmit %d\n",ms->eoftx,ms->bytes2transmit);
62 #ifdef CONFIG_ZAPATA_NET
63 if (ms->flags & ZT_FLAG_NETDEV)
64 netif_wake_queue(ztchan_to_dev(ms));
66 tasklet_schedule(&ms->ppp_calls);
71 } else if (ms->curtone && !(ms->flags & ZT_FLAG_PSEUDO)) {
72 left = ms->curtone->tonesamples - ms->tonep;
74 @@ -5018,6 +5058,10 @@
75 memset(txb, 0xFF, bytes);
78 +#if defined(CONFIG_ZAPATA_BRI_DCHANS)
79 + } else if(ms->flags & ZT_FLAG_BRIDCHAN) {
83 memset(txb, ZT_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
85 @@ -5743,6 +5787,13 @@
88 int bytes = ZT_CHUNKSIZE;
89 +#if defined(CONFIG_ZAPATA_BRI_DCHANS)
90 + if (ms->flags & ZT_FLAG_BRIDCHAN) {
91 + bytes = ms->bytes2receive;
92 + if (bytes < 1) return;
93 +// printk(KERN_CRIT "bytes2receive %d\n",ms->bytes2receive);
98 #if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
99 @@ -5801,6 +5852,19 @@
103 +#ifdef CONFIG_ZAPATA_BRI_DCHANS
104 + } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
105 + memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
107 + ms->readidx[ms->inreadbuf] += left;
109 + if (ms->eofrx == 1) {
112 +// printk(KERN_CRIT "receiving %d bytes\n",ms->bytes2receive);
113 + ms->bytes2receive = 0;
118 memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
119 diff -ur zaptel-1.2.5.orig/zaptel.h zaptel-1.2.5/zaptel.h
120 --- zaptel-1.2.5.orig/zaptel.h 2005-12-17 03:04:05.000000000 +0100
121 +++ zaptel-1.2.5/zaptel.h 2006-04-10 10:39:37.000000000 +0200
124 struct sk_buff_head ppp_rq;
126 +#ifdef CONFIG_ZAPATA_BRI_DCHANS
128 + int maxbytes2transmit; /* size of the tx buffer in the card driver */
129 + int bytes2transmit;
134 char name[40]; /* Name */
135 /* Specified by zaptel */
136 @@ -1068,7 +1075,7 @@
137 int txbufpolicy; /* Buffer policy */
138 int rxbufpolicy; /* Buffer policy */
139 int txdisable; /* Disable transmitter */
140 - int rxdisable; /* Disable receiver */
141 + int rxdisable; /* Disable receiver */
144 /* Tone zone stuff */
145 @@ -1231,6 +1238,10 @@
146 #define ZT_FLAG_T1PPP (1 << 15)
147 #define ZT_FLAG_SIGFREEZE (1 << 16) /* Freeze signalling */
149 +#if defined(CONFIG_ZAPATA_BRI_DCHANS)
150 +#define ZT_FLAG_BRIDCHAN (1 << 17)
155 void *pvt; /* Private stuff */
156 diff -ur zaptel-1.2.5.orig/zconfig.h zaptel-1.2.5/zconfig.h
157 --- zaptel-1.2.5.orig/zconfig.h 2005-11-29 19:42:08.000000000 +0100
158 +++ zaptel-1.2.5/zconfig.h 2006-04-10 10:39:37.000000000 +0200
161 /* #define FXSFLASH */
164 + * Uncomment the following for BRI D channels
167 +#define CONFIG_ZAPATA_BRI_DCHANS