home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!ddssuprs!lpc
- From: lpc@dickens.com (Luis P Caamano)
- Subject: Re: High-speed modem at built-in serial port (RS/6000)
- Message-ID: <1992Sep2.140205.16776@dickens.com>
- Date: Wed, 2 Sep 1992 14:02:05 GMT
- References: <01050810.c5a4ip@mbeckman.mbeckman.com> <BtpJy7.92L@well.sf.ca.us> <1255@curly.appmag.com>
- Organization: Dickens Data Systems, Inc.
- Lines: 103
-
- In article <1255@curly.appmag.com> pa@curly.appmag.com (Pierre Asselin) writes:
- >In <BtpJy7.92L@well.sf.ca.us> nlane@well.sf.ca.us (Nathan D. Lane) writes:
- >
- >>On AIX 3.2, the hardware flow control settings DO NOT hold between reboots.
- >
- >I pulled a couple of incantations from a smit.script and inserted a
- >paragraph near the end of my /etc/rc (just before the
- >/etc/mfg/rc.preload stuff). The "-a runmode" strings are shown here as
- >tab-continued lines, but of course they are single long lines in /etc/rc.
- >
- [ ... ]
- >
- >Works for me.
- >CAVEAT: I'm at 3.1.6.
-
- 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:
-
- /etc/rc:
- ...
- echo "Adding RTS to modem ttys"
- /home/lpc/c/setrts /dev/tty0 # multitech
- /home/lpc/c/setrts /dev/tty1 # telebit
- /home/lpc/c/setrts /dev/tty10 # fax
- ...
-
-
- sttyget is the same as "stty get < /dev/ttyx" but it opens
- the device with NDELAY.
-
-
- ------8<------------8<--------------8<----------------
- /* setrts.c */
- #include <fcntl.h>
- #include <termios.h>
- #include <sys/ioctl.h>
-
- main(int argc,char **argv)
- {
- int fd;
- struct termios t;
-
- if ((fd = open(argv[1],O_NDELAY|O_RDWR)) == -1) {
- printf("%s: can't open %s\n",argv[0],argv[1]);
- printf("usage: %s device\n",argv[0]);
- exit(1);
- }
-
- ioctl(fd,TXADDCD,"rts");
-
- exit 0;
- }
- ------8<------------8<--------------8<----------------
-
-
-
- ------8<------------8<--------------8<----------------
- /* sttyget.c */
- #include <fcntl.h>
- #include <termios.h>
- #include <sys/ioctl.h>
-
- main(int argc,char **argv)
- {
- int fd, i;
- struct termios t;
- union txname txbuf;
-
- if ((fd = open(argv[1],O_NDELAY|O_RDWR)) == -1) {
- printf("%s: can't open %s\n",argv[0],argv[1]);
- printf("usage: %s device\n",argv[0]);
- exit(1);
- }
-
- i=0;
- while(1) {
- txbuf.tx_which=i;
- ioctl(fd,TXGETCD,&txbuf);
- printf("%s ",txbuf.tx_name);
-
- if(txbuf.tx_which == 0) {
- printf("\n");
- break;
- }
- i++;
- }
-
- close(fd);
- exit(0);
- }
- ------8<------------8<--------------8<----------------
- --
- ---------------------------------------------------------------------------
- Luis P. Caamano | lpc@dickens.com
- Dickens Data Systems, Inc. | uunet!dickens.com!lpc
- Atlanta, GA | (404) 475-8860
- ---------------------------------------------------------------------------
- If I think I know it all, I'll stop learning. -myself
- The more I learn, the more I know I know nothing. -somebody else
-