patch-2.1.27 linux/drivers/isdn/teles/callc.c

Next file: linux/drivers/isdn/teles/card.c
Previous file: linux/drivers/isdn/sc/timer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.26/linux/drivers/isdn/teles/callc.c linux/drivers/isdn/teles/callc.c
@@ -1,6 +1,15 @@
-/* $Id: callc.c,v 1.13 1996/06/24 17:15:55 fritz Exp $
+/* $Id: callc.c,v 1.16 1997/02/11 01:39:46 keil Exp $
  *
  * $Log: callc.c,v $
+ * Revision 1.16  1997/02/11 01:39:46  keil
+ * Changed setup-interface (incoming and outgoing)
+ *
+ * Revision 1.15  1996/11/23 11:32:20  keil
+ * windowsize = 7 X.75 bugfix Thanks to Martin Maurer
+ *
+ * Revision 1.14  1996/10/22 23:14:14  fritz
+ * Changes for compatibility to 2.0.X and 2.1.X kernels.
+ *
  * Revision 1.13  1996/06/24 17:15:55  fritz
  * corrected return code of teles_writebuf()
  *
@@ -47,7 +56,6 @@
  */
 #define __NO_VERSION__
 #include "teles.h"
-#include <asm/uaccess.h>
 
 extern struct IsdnCard cards[];
 extern int      nrcards;
@@ -58,7 +66,6 @@
 
 static int      init_ds(int chan, int incoming);
 static void     release_ds(int chan);
-static char    *strcpyupto(char *dest, char *src, char upto);
 
 static struct Fsm callcfsm =
 {NULL, 0, 0},   lcfsm =
@@ -219,19 +226,6 @@
 #define LC_D  0
 #define LC_B  1
 
-static int
-my_atoi(char *s)
-{
-        int             i, n;
-
-        n = 0;
-        if (!s)
-                return -1;
-        for (i = 0; *s >= '0' && *s <= '9'; i++, s++)
-                n = 10 * n + (*s - '0');
-        return n;
-}
-
 /*
  * Dial out
  */
@@ -240,23 +234,10 @@
 {
         isdn_ctrl      *ic = arg;
         struct Channel *chanp = fi->userdata;
-        char           *ptr;
-        char            sis[3];
 
-        /* Destination Phone-Number */
-        ptr = strcpyupto(chanp->para.called, ic->num, ',');
-        /* Source Phone-Number */
-        ptr = strcpyupto(chanp->para.calling, ptr + 1, ',');
-        if (!strcmp(chanp->para.calling, "0"))
-                chanp->para.calling[0] = '\0';
-
-        /* Service-Indicator 1 */
-        ptr = strcpyupto(sis, ptr + 1, ',');
-        chanp->para.info = my_atoi(sis);
-
-        /* Service-Indicator 2 */
-        ptr = strcpyupto(sis, ptr + 1, '\0');
-        chanp->para.info2 = my_atoi(sis);
+	chanp->para.setup = ic->parm.setup;
+	if (!strcmp(chanp->para.setup.eazmsn, "0"))
+		chanp->para.setup.eazmsn[0] = '\0';
 
         chanp->l2_active_protocol = chanp->l2_protocol;
         chanp->incoming = 0;
@@ -414,8 +395,7 @@
                  * No need to return "unknown" for calls without OAD,
                  * cause that's handled in linklevel now (replaced by '0')
                  */
-                sprintf(ic.num, "%s,%d,0,%s", chanp->para.calling, chanp->para.info,
-                        chanp->para.called);
+		ic.parm.setup = chanp->para.setup;
                 iif.statcallb(&ic);
         } else {
                 chanp->is.l4.l4l3(&chanp->is,CC_DLRL,NULL);
@@ -670,7 +650,7 @@
         ic.driver = drid;
         ic.command = ISDN_STAT_CINF;
         ic.arg = chanp->chan;
-        sprintf(ic.num, "%d", chanp->para.chargeinfo);
+        sprintf(ic.parm.num, "%d", chanp->para.chargeinfo);
         iif.statcallb(&ic);
 }
 
@@ -1234,7 +1214,7 @@
         st->l2.laptype = LAPB;
         st->l2.orig = !incoming;
         st->l2.t200 = 1000;        /* 1000 milliseconds */
-        st->l2.window = 3;
+        st->l2.window = 7;
         st->l2.n200 = 4;           /* try 4 times       */
         st->l2.t203 = 5000;        /* 5000 milliseconds */
 
@@ -1327,7 +1307,9 @@
           case (ISDN_CMD_DIAL):
                   chanp = chanlist + (ic->arg & 0xff);
                   if (chanp->debug & 1) {
-                          sprintf(tmp, "DIAL %s", ic->num);
+		  	  sprintf(tmp, "DIAL %s -> %s (%d,%d)",
+				ic->parm.setup.eazmsn, ic->parm.setup.phone,
+				ic->parm.setup.si1, ic->parm.setup.si2);
                           command_debug(chanp, tmp);
                   }
                   FsmEvent(&chanp->fi, EV_DIAL, ic);
@@ -1353,7 +1335,7 @@
           case (ISDN_CMD_SUSPEND):
                   chanp = chanlist + ic->arg;
                   if (chanp->debug & 1) {
-                          sprintf(tmp, "SUSPEND %s", ic->num);
+                          sprintf(tmp, "SUSPEND %s", ic->parm.num);
                           command_debug(chanp, tmp);
                   }
                  FsmEvent(&chanp->fi, EV_SUSPEND, ic);
@@ -1361,7 +1343,7 @@
           case (ISDN_CMD_RESUME):
                   chanp = chanlist + ic->arg;
                   if (chanp->debug & 1) {
-                          sprintf(tmp, "RESUME %s", ic->num);
+                          sprintf(tmp, "RESUME %s", ic->parm.num);
                           command_debug(chanp, tmp);
                   }
                   FsmEvent(&chanp->fi, EV_RESUME, ic);
@@ -1382,14 +1364,14 @@
                                     channel_report(i);
                             break;
                     case (1):
-                            debugflags = *(unsigned int *) ic->num;
+                            debugflags = *(unsigned int *) ic->parm.num;
                             distr_debug();
                             sprintf(tmp, "debugging flags set to %x\n", debugflags);
                             teles_putstatus(tmp);
 			    printk(KERN_DEBUG "%s", tmp);
                             break;
                     case (2):
-                            num = *(unsigned int *) ic->num;
+                            num = *(unsigned int *) ic->parm.num;
                             i = num >> 8;
                             if (i >= chancount)
                                     break;
@@ -1451,10 +1433,9 @@
 
         ptr += i;
 
-        if (user) {
-                if (copy_from_user(ptr, buf, count))
-					return -EFAULT;
-		} else
+        if (user)
+                copy_from_user(ptr, buf, count);
+        else
                 memcpy(ptr, buf, count);
         ibh->datasize = count + i;
 
@@ -1469,13 +1450,4 @@
                 return (0);
         }
 
-}
-
-static char    *
-strcpyupto(char *dest, char *src, char upto)
-{
-        while (*src && (*src != upto) && (*src != '\0'))
-                *dest++ = *src++;
-        *dest = '\0';
-        return (src);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov