shannon changes to support DF02+DF03 -- require kernel hack
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 10 Oct 1981 07:27:58 +0000 (23:27 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 10 Oct 1981 07:27:58 +0000 (23:27 -0800)
SCCS-vsn: usr.bin/tip/acutab.c 4.3
SCCS-vsn: usr.bin/tip/aculib/df.c 4.2

usr/src/usr.bin/tip/aculib/df.c
usr/src/usr.bin/tip/acutab.c

index e692b12..9170183 100644 (file)
@@ -1,20 +1,39 @@
-/*     df.c    4.1     81/05/09        */
+/*     df.c    4.2     81/10/09        */
 /*
 /*
- * Dial the DF02-AC
+ * Dial the DF02-AC or DF03-AC
  */
 
  */
 
+#if defined(DF02) || defined(DF03)
 #include "tip.h"
 #include "tip.h"
-#if DF02
 #include <setjmp.h>
 
 static jmp_buf Sjbuf;
 static timeout();
 
 #include <setjmp.h>
 
 static jmp_buf Sjbuf;
 static timeout();
 
-df_dialer(num, acu)
+#if DF02
+df02_dialer(num, acu)
 char *num, *acu;
 char *num, *acu;
+{
+       return(df_dialer(acu, num, 0));
+}
+#endif
+
+#if DF03
+df03_dialer(num, acu)
+char *num, *acu;
+{
+       return(df_dialer(acu, num, 1));
+}
+#endif
+
+df_dialer(num, acu, df03)
+char *num, *acu;
+int df03;
 {
        register int f = FD;
 {
        register int f = FD;
-       int c;
+       struct sgttyb buf;
+       int speed = 0, c = 0;
+       int st = MST;           /* Secondary Transmit flag, for speed select */
 
        ioctl(f, TIOCHPCL, 0);          /* make sure it hangs up when done */
        if (setjmp(Sjbuf)) {
 
        ioctl(f, TIOCHPCL, 0);          /* make sure it hangs up when done */
        if (setjmp(Sjbuf)) {
@@ -25,15 +44,32 @@ char *num, *acu;
        if (boolean(value(VERBOSE)))
                printf("\ndialing...");
        fflush(stdout);
        if (boolean(value(VERBOSE)))
                printf("\ndialing...");
        fflush(stdout);
+#ifdef TIOCMSET
+       if (df03) {
+               ioctl(f, TIOCGETP, &buf);
+               if (buf.sg_ospeed != B1200) {   /* must dial at 1200 baud */
+                       speed = buf.sg_ospeed;
+                       buf.sg_ospeed = buf.sg_ispeed = B1200;
+                       ioctl(f, TIOCSETP, &buf);
+                       ioctl(f, TIOCMBIC, &st); /* clear ST for 300 baud */
+               } else
+                       ioctl(f, TIOCMBIS, &st); /* set ST for 1200 baud */
+       }
+#endif
        signal(SIGALRM, timeout);
        alarm(5 * strlen(num) + 10);
        ioctl(f, TIOCFLUSH, 0);
        write(f, "\001", 1);
        signal(SIGALRM, timeout);
        alarm(5 * strlen(num) + 10);
        ioctl(f, TIOCFLUSH, 0);
        write(f, "\001", 1);
-       sleep(0);               /* this must waste 70 ms. */
+       sleep(1);
        write(f, "\002", 1);
        write(f, num, strlen(num));
        write(f, "\002", 1);
        write(f, num, strlen(num));
-       c = 0;
        read(f, (char *)&c, 1);
        read(f, (char *)&c, 1);
+#ifdef TIOCMSET
+       if (df03 && speed) {
+               buf.sg_ispeed = buf.sg_ospeed = speed;
+               ioctl(f, TIOCSETP, &buf);
+       }
+#endif
        return(c == 'A');
 }
 
        return(c == 'A');
 }
 
index 2e42064..8695851 100644 (file)
@@ -1,7 +1,7 @@
-/*     acutab.c        4.2     81/09/17        */
+/*     acutab.c        4.3     81/10/09        */
 #include "tip.h"
 
 #include "tip.h"
 
-extern int df_dialer(), df_disconnect(), df_abort(),
+extern int df02_dialer(), df03_dialer(), df_disconnect(), df_abort(),
           biz31f_dialer(), biz31_disconnect(), biz31_abort(),
           biz31w_dialer(),
           biz22f_dialer(), biz22_disconnect(), biz22_abort(),
           biz31f_dialer(), biz31_disconnect(), biz31_abort(),
           biz31w_dialer(),
           biz22f_dialer(), biz22_disconnect(), biz22_abort(),
@@ -18,7 +18,10 @@ acu_t acutable[] = {
        "biz22w", biz22w_dialer, biz22_disconnect,      biz22_abort,
 #endif
 #if DF02
        "biz22w", biz22w_dialer, biz22_disconnect,      biz22_abort,
 #endif
 #if DF02
-       "df02", df_dialer,      df_disconnect,          df_abort,
+       "df02", df02_dialer,    df_disconnect,          df_abort,
+#endif
+#if DF03
+       "df03", df03_dialer,    df_disconnect,          df_abort,
 #endif
 #if DN11
        "dn11", dn_dialer,      dn_disconnect,          dn_abort,
 #endif
 #if DN11
        "dn11", dn_dialer,      dn_disconnect,          dn_abort,