home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / aix / 9293 < prev    next >
Encoding:
Text File  |  1992-09-02  |  3.0 KB  |  114 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!ddssuprs!lpc
  3. From: lpc@dickens.com (Luis P Caamano)
  4. Subject: Re: High-speed modem at built-in serial port (RS/6000)
  5. Message-ID: <1992Sep2.140205.16776@dickens.com>
  6. Date: Wed, 2 Sep 1992 14:02:05 GMT
  7. References: <01050810.c5a4ip@mbeckman.mbeckman.com> <BtpJy7.92L@well.sf.ca.us> <1255@curly.appmag.com>
  8. Organization: Dickens Data Systems, Inc.
  9. Lines: 103
  10.  
  11. In article <1255@curly.appmag.com> pa@curly.appmag.com (Pierre Asselin) writes:
  12. >In <BtpJy7.92L@well.sf.ca.us> nlane@well.sf.ca.us (Nathan D. Lane) writes:
  13. >
  14. >>On AIX 3.2, the hardware flow control settings DO NOT hold between reboots.
  15. >
  16. >I pulled a couple of incantations from a smit.script and inserted a
  17. >paragraph near the end of my /etc/rc (just before the
  18. >/etc/mfg/rc.preload stuff).  The "-a runmode" strings are shown here as
  19. >tab-continued lines, but of course they are single long lines in /etc/rc.
  20. >
  21. [ ... ]
  22. >
  23. >Works for me.
  24. >CAVEAT:  I'm at 3.1.6.
  25.  
  26. Yes, it works for you but it would be kind of complicated to do that
  27. for multiple modems :-)
  28.  
  29. These are the two programs we use to handle rts/cts and to read the
  30. line discipline stack when the line is set with no clocal (which is
  31. the case for modem lines).  We use them this way in /etc/rc:
  32.  
  33. /etc/rc:
  34. ...
  35. echo "Adding RTS to modem ttys"
  36. /home/lpc/c/setrts /dev/tty0    # multitech
  37. /home/lpc/c/setrts /dev/tty1    # telebit 
  38. /home/lpc/c/setrts /dev/tty10    # fax
  39. ...
  40.  
  41.  
  42. sttyget is the same as "stty get < /dev/ttyx" but it opens
  43. the device with NDELAY.  
  44.  
  45.  
  46. ------8<------------8<--------------8<----------------
  47. /* setrts.c */
  48. #include <fcntl.h>
  49. #include <termios.h>
  50. #include <sys/ioctl.h>
  51.  
  52. main(int argc,char **argv)
  53. {
  54.     int fd;
  55.     struct termios t;
  56.     
  57.     if ((fd = open(argv[1],O_NDELAY|O_RDWR)) == -1) {
  58.     printf("%s: can't open %s\n",argv[0],argv[1]);
  59.     printf("usage: %s device\n",argv[0]);
  60.     exit(1);
  61.     }
  62.  
  63.     ioctl(fd,TXADDCD,"rts");
  64.  
  65.     exit 0;
  66. }
  67. ------8<------------8<--------------8<----------------
  68.  
  69.  
  70.  
  71. ------8<------------8<--------------8<----------------
  72. /* sttyget.c */
  73. #include <fcntl.h>
  74. #include <termios.h>
  75. #include <sys/ioctl.h>
  76.  
  77. main(int argc,char **argv)
  78. {
  79. int fd, i;
  80. struct termios t;
  81. union txname txbuf;
  82.  
  83.     if ((fd = open(argv[1],O_NDELAY|O_RDWR)) == -1) {
  84.     printf("%s: can't open %s\n",argv[0],argv[1]);
  85.     printf("usage: %s device\n",argv[0]);
  86.     exit(1);
  87.     }
  88.  
  89.     i=0;
  90.     while(1) {
  91.     txbuf.tx_which=i;
  92.     ioctl(fd,TXGETCD,&txbuf);
  93.     printf("%s ",txbuf.tx_name);
  94.  
  95.     if(txbuf.tx_which == 0) {
  96.         printf("\n");
  97.         break;
  98.     }
  99.     i++;
  100.     } 
  101.  
  102.     close(fd);
  103.     exit(0);
  104. }
  105. ------8<------------8<--------------8<----------------
  106. -- 
  107. ---------------------------------------------------------------------------
  108. Luis P. Caamano                    |         lpc@dickens.com
  109. Dickens Data Systems, Inc.         |         uunet!dickens.com!lpc
  110. Atlanta, GA                        |         (404) 475-8860
  111. ---------------------------------------------------------------------------
  112. If I think I know it all, I'll stop learning. -myself
  113. The more I learn, the more I know I know nothing. -somebody else
  114.