home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aix / 9449 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.9 KB  |  108 lines

  1. Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!konopik.austin.ibm.com!konopik
  2. From: konopik@konopik.austin.ibm.com (Brad Konopik)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: High-speed modem at built-in serial port (RS/6000)
  5. Message-ID: <1992Sep4.143808.792@awdprime.austin.ibm.com>
  6. Date: 4 Sep 92 14:38:08 GMT
  7. References: <BtpJy7.92L@well.sf.ca.us> <1255@curly.appmag.com> <1992Sep2.140205.16776@dickens.com>
  8. Sender: news@awdprime.austin.ibm.com (USENET News)
  9. Organization: IBM AIX Porting Center, Austin
  10. Lines: 96
  11.  
  12. In article <1992Sep2.140205.16776@dickens.com> lpc@dickens.com (Luis P Caamano) writes:
  13. >
  14. >Yes, it works for you but it would be kind of complicated to do that
  15. >for multiple modems :-)
  16. >
  17. >These are the two programs we use to handle rts/cts and to read the
  18. >line discipline stack when the line is set with no clocal (which is
  19. >the case for modem lines).  We use them this way in /etc/rc:
  20. >
  21. > [submissions omitted]
  22.  
  23. Here's what you get from IBM as a workaround (for AIX 3.1 substitute 
  24. /etc/tty everywhere you see /usr/lbin/tty):
  25.  
  26. add this stanza to /etc/rc (before 'Multi-user initialization completed\n')
  27.  
  28. ----- start of stanza -----------------------
  29. echo "Initializing RTS/CTS tty ports"
  30. echo "\c" > /tmp/addrts.out
  31. for i in `/bin/cat /usr/lbin/tty/addrts.list | /bin/grep -v "^#"`
  32. do
  33.         /usr/lbin/tty/addrts $i 1>>/tmp/addrts.out 2>&1
  34. done
  35. if [ -s /tmp/addrts.out ]
  36. then
  37.         echo "RTS/CTS experienced errors^G"
  38. fi
  39. ----- end of stanza -----------------------
  40.  
  41. /usr/lib/tty/addrts.list should contain list of fully qualified ttys (one 
  42. per line) to add RTS/CTS (lines with leading '#' are ignored), example:
  43.  
  44. #/dev/tty7
  45. /dev/tty1
  46. /dev/tty13/0
  47.  
  48. errors are logged to /tmp/addrts.out (which is cleared each time /etc/rc
  49. gets executed).
  50.  
  51. ----- code for /usr/lbin/tty/addrts -------------
  52. #include <stdio.h>
  53. #include <fcntl.h>
  54. #include <sys/ioctl.h>
  55. #include <termios.h>
  56.  
  57.  
  58. static char buff[1024];
  59. static char *progname;
  60. static void usage();
  61. static void error(char *s);
  62.  
  63. main(int argc, char *argv[])
  64. {
  65.     int ttyfd;
  66.     union txname tx_stuff;
  67.  
  68.     if (progname = rindex(argv[0], '/'))
  69.     ++progname;
  70.     else
  71.     progname = argv[0];
  72.  
  73.     if (argc < 2)
  74.     usage();
  75.  
  76.     if ((ttyfd = open(argv[1], O_NONBLOCK)) < 0) {
  77.     sprintf(buff, "Open of %s", argv[1]);
  78.     error(buff);
  79.     }
  80.  
  81.     strcpy(tx_stuff.tx_name, "rts");
  82.     if (ioctl (ttyfd, TXADDCD, &tx_stuff) < 0) {
  83.     sprintf(buff, "Adding rts to %s", argv[1]);
  84.     error(buff);
  85.     }
  86.  
  87. }
  88.  
  89. static void usage()
  90. {
  91.     fprintf(stderr, "Usage: %s tty\n", progname);
  92.     exit(1);
  93. }
  94.  
  95. static void error(char *s)
  96. {
  97.     fprintf(stderr, "%s: ", progname);
  98.     perror(s);
  99.     exit(1);
  100. }
  101. ----- end code for /usr/lbin/tty/addrts -------------
  102.  
  103. -- 
  104.   tcpnet: konopik@konopik.austin.ibm.com  |  Brad Konopik
  105.  ibmvnet: KONOPIK at AUSTIN               |  IBM AIX Porting Center, Austin
  106. internet: konopik.austin.ibm.com!konopik@ibmpa.awdpa.ibm.com
  107.    uunet: ..!uunet!ibmsupt!ibmpa!konopik.austin.ibm.com!konopik
  108.