home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!konopik.austin.ibm.com!konopik
- From: konopik@konopik.austin.ibm.com (Brad Konopik)
- Newsgroups: comp.unix.aix
- Subject: Re: High-speed modem at built-in serial port (RS/6000)
- Message-ID: <1992Sep4.143808.792@awdprime.austin.ibm.com>
- Date: 4 Sep 92 14:38:08 GMT
- References: <BtpJy7.92L@well.sf.ca.us> <1255@curly.appmag.com> <1992Sep2.140205.16776@dickens.com>
- Sender: news@awdprime.austin.ibm.com (USENET News)
- Organization: IBM AIX Porting Center, Austin
- Lines: 96
-
- In article <1992Sep2.140205.16776@dickens.com> lpc@dickens.com (Luis P Caamano) writes:
- >
- >Yes, it works for you but it would be kind of complicated to do that
- >for multiple modems :-)
- >
- >These are the two programs we use to handle rts/cts and to read the
- >line discipline stack when the line is set with no clocal (which is
- >the case for modem lines). We use them this way in /etc/rc:
- >
- > [submissions omitted]
-
- Here's what you get from IBM as a workaround (for AIX 3.1 substitute
- /etc/tty everywhere you see /usr/lbin/tty):
-
- add this stanza to /etc/rc (before 'Multi-user initialization completed\n')
-
- ----- start of stanza -----------------------
- echo "Initializing RTS/CTS tty ports"
- echo "\c" > /tmp/addrts.out
- for i in `/bin/cat /usr/lbin/tty/addrts.list | /bin/grep -v "^#"`
- do
- /usr/lbin/tty/addrts $i 1>>/tmp/addrts.out 2>&1
- done
- if [ -s /tmp/addrts.out ]
- then
- echo "RTS/CTS experienced errors^G"
- fi
- ----- end of stanza -----------------------
-
- /usr/lib/tty/addrts.list should contain list of fully qualified ttys (one
- per line) to add RTS/CTS (lines with leading '#' are ignored), example:
-
- #/dev/tty7
- /dev/tty1
- /dev/tty13/0
-
- errors are logged to /tmp/addrts.out (which is cleared each time /etc/rc
- gets executed).
-
- ----- code for /usr/lbin/tty/addrts -------------
- #include <stdio.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
- #include <termios.h>
-
-
- static char buff[1024];
- static char *progname;
- static void usage();
- static void error(char *s);
-
- main(int argc, char *argv[])
- {
- int ttyfd;
- union txname tx_stuff;
-
- if (progname = rindex(argv[0], '/'))
- ++progname;
- else
- progname = argv[0];
-
- if (argc < 2)
- usage();
-
- if ((ttyfd = open(argv[1], O_NONBLOCK)) < 0) {
- sprintf(buff, "Open of %s", argv[1]);
- error(buff);
- }
-
- strcpy(tx_stuff.tx_name, "rts");
- if (ioctl (ttyfd, TXADDCD, &tx_stuff) < 0) {
- sprintf(buff, "Adding rts to %s", argv[1]);
- error(buff);
- }
-
- }
-
- static void usage()
- {
- fprintf(stderr, "Usage: %s tty\n", progname);
- exit(1);
- }
-
- static void error(char *s)
- {
- fprintf(stderr, "%s: ", progname);
- perror(s);
- exit(1);
- }
- ----- end code for /usr/lbin/tty/addrts -------------
-
- --
- tcpnet: konopik@konopik.austin.ibm.com | Brad Konopik
- ibmvnet: KONOPIK at AUSTIN | IBM AIX Porting Center, Austin
- internet: konopik.austin.ibm.com!konopik@ibmpa.awdpa.ibm.com
- uunet: ..!uunet!ibmsupt!ibmpa!konopik.austin.ibm.com!konopik
-