ctsflow solution for xenix cu/uucico and fas question

Stu Heiss stu at jpusa1.chi.il.us
Sun Jun 30 03:03:45 AEST 1991


I've been using fas with a trailblazer+ since 2.07 but just recently
got flow control set up (hopefully correctly).  Perhaps this will help
someone else and/or if this seems incorrect, I would apreciate email as
to why.  It does seem to work properly for me.  I have locked the trailblazer+
at 19200 and set rts and cts flow for full duplex by doing the following:
	s51=5	(interface speed 19200)
	s66=1	(lock interface, use flow control)
	s58=2	(use dte rts flow control)
	s68=2	(use dce cts flow control)
I also set noecho, dtr low disconect and reset, dcd assert on carrier true,
dsr toggle on lost carrier, instant break, autoreliable mnp.  To make
fas mimic xenix port minor convention, I changed the macro GET_OPEN_MODE.
With this setup, you can drop fas into xenix and use the standard devices.
Included below is an intialization script for the trailblazer+ and patch
to fas.c.  Disable the login on the modem port before running the script
and edit the 'dev=tty2a' if your telebit is on a different port.

Stu

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	fas.c.diff
#	inittb.sh
# This archive created: Sat Jun 29 11:50:50 1991
# By:	stu (JPUSA - Chicago, IL)
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "x - 'fas.c.diff'"
if test -f 'fas.c.diff'
then
	echo shar: "will not over-write existing file 'fas.c.diff'"
else
cat << \SHAR_EOFfas.c.diff > 'fas.c.diff'
===================================================================
RCS file: RCS/fas.c,v
retrieving revision 1.1
diff -u -r1.1 fas.c
--- 1.1	1991/06/25 16:36:44
+++ fas.c	1991/06/25 16:53:14
@@ -1,3 +1,14 @@
+#ifndef lint
+static char *RCSid = "$Header: /usr/sys/fas/src/RCS/fas.c,v 1.2 1991/06/25 16:50:58 stu Exp $";
+#endif
+
+/*
+ * $Log: fas.c,v $
+ * Revision 1.2  1991/06/25  16:50:58  stu
+ * swap dev minor bits 5 and 6 for xenix convention
+ *
+ */
+
 /* FAS Final Async Solution driver for 286/386 versions of system V UNIX */
 
 /* FAS was developed by
@@ -7,9 +18,11 @@
 Germany
 */
 
+#ifndef M_XENIX
 #if !defined (M_I286)
 #ident	"@(#)fas.c	2.09"
 #endif
+#endif
 
 /* Note: This source code was quite heavily optimized for speed. You
          may wonder that register variables aren't used everywhere.
@@ -350,7 +363,12 @@
 
 /* The following defines are used to take apart the minor device numbers. */
 #define GET_UNIT(dev)		((dev) & 0x0f)
+#ifndef M_XENIX
 #define GET_OPEN_MODE(dev)	(fas_open_modes [((dev) >> 4) & 0x0f])
+#else
+/* to swap bits 0101xxxx <=> 0000xxxx and 1101xxxx <=> 1000xxxx - ie. swap bits 5, 7 */
+#define GET_OPEN_MODE(dev)	(fas_open_modes [(((dev) >> 4) & 0x0f)^0x5])
+#endif
 
 /* lock device against concurrent use */
 #define get_device_lock(fip,prio) \
SHAR_EOFfas.c.diff
fi
echo shar: "x - 'inittb.sh'"
if test -f 'inittb.sh'
then
	echo shar: "will not over-write existing file 'inittb.sh'"
else
cat << \SHAR_EOFinittb.sh > 'inittb.sh'
:
# initialize telebit trailblazer+
# Fri Jun 28 16:33:30 CDT 1991
# use full duplex rts/cts flow with fas driver
PATH=/usr/lib/uucp:/bin:/usr/bin export PATH

xflg=-x9
dev=tty2a

# try 19200 and 9600 baud, recall factory default and lock baudrate at 19200
for br in 19200 9600;do
	uuchat $xflg $dev $br '' at OK 'at&f' OK ats51=5 OK
done

#       noecho          19200      lock/flow  rtsflow    ctsflow
#       dtrreset   dcddsr     instbreak  autorelmnp  writeconfig
uuchat $xflg $dev 19200 '' at OK \
	ate0 OK atq4 OK ats51=5 OK ats66=1 OK ats58=2 OK ats68=2 OK \
	ats52=2 OK ats53=4 OK ats54=2 OK ats95=2 OK 'at&w1' OK 'at&w2' OK

# dump registers
uuchat $xflg $dev 19200 '' at OK 'at&n' OK
SHAR_EOFinittb.sh
fi
exit 0
#	End of shell archive
-- 
Stu Heiss - stu at jpusa1.chi.il.us



More information about the Comp.unix.xenix.sco mailing list