home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / sysv386 / 12351 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  8.1 KB

  1. Xref: sparky comp.unix.sysv386:12351 biz.sco.general:2669
  2. Newsgroups: comp.unix.sysv386,biz.sco.general
  3. Path: sparky!uunet!scorn!dionj
  4. From: dionj@sco.COM (Dion)
  5. Subject: Re: SCO Unix Release 3.2 Version 4.0, RTSFLOW, CTSFLOW and CRTSFL
  6. Reply-To: dionj@sco.com   (Dion)
  7. Cc: chip@tct.com dionj@sco.com jochen@busybit.mrz.lm.sub.org
  8. Organization: The Santa Cruz Operation, Inc.
  9. Date: Mon, 20 Jul 1992 02:03:12 GMT
  10. Message-ID: <1992Jul20.020312.13404@sco.com>
  11. Keywords: RTSFLOW CTSFLOW CRTSFL flow control
  12. References: <JOCHEN.92Jul12064058@busybit.mrz.lm.sub.org> <2A6326A2.6C61@tct.com>
  13. Sender: news@sco.com (News admin)
  14. Lines: 161
  15.  
  16.  
  17. In response to a inquiries (see below) here are some comments on flow control.
  18.  
  19. Currently, the "stty -clocal rtsflow ctsflow -ixon -ixoff" stty(C)
  20. settings on SCO Systems provide hardware flow control on modem 
  21. control ports according to the original, unidirectional convention:
  22.  
  23. Computer                                                Peripheral
  24.  (DTE)   pin 4   ==== RTS - ready to send ===>>>  pin 4   (DCE)
  25.          pin 5  <<<== CTS - ready to receive ==   pin 5
  26.  
  27. The RTS (Request To Send) line is asserted by the computer (DTE)
  28. when it is ready to send data to the peripheral (DCE).  After the
  29. data is sent, RTS is dropped until there is more data to send in 
  30. the sio driver's buffer.  
  31.  
  32. The peripheral (DCE) then asserts the CTS (Clear To Send) line 
  33. when it is ready to receive data.  If the peripheral (DCE) 
  34. becomes busy, it drops CTS and the computer (DTE) stops sending 
  35. data until the peripheral (DCE) raises CTS again.
  36.  
  37. This scheme allows the peripheral to control the flow of data
  38. from the computer, but not vice versa.  There is an implicit 
  39. (and outdated) assumption that the computer is faster than 
  40. the peripheral.
  41.  
  42.  
  43. De facto Industry Standard RTS/CTS Flow Control
  44. -----------------------------------------------
  45. Many third-party vendors (including Arnet, Telebit, U.S. Robotics,
  46. Computer Peripherals, Hayes, Digiboard, Computone, Specialix, and 
  47. Stallion among others) implement a newer, de facto standard for the 
  48. "stty rtsflow ctsflow" settings:
  49.  
  50. Computer                                                 Peripheral
  51.  (DTE)   pin 4   ==== RTS - ready to receive ==>>> pin 4   (DCE)
  52.          pin 5  <<<== CTS - ready to receive ====  pin 5
  53.  
  54. The computer (DTE) asserts RTS (Request To Send) when it is ready
  55. to receive data from the peripheral (DCE).  The meaning of "Request 
  56. To Send" has changed, becoming a request for the peripheral to send 
  57. to the computer.  If the computer becomes busy, it drops RTS and the 
  58. peripheral stops sending data until the computer raises RTS again.
  59.  
  60. The CTS (Clear To Send) line is used as before.
  61.  
  62. The obvious advantage of this implementation is that it allows the
  63. computer to control the flow of data from the peripheral.  There is
  64. a possible disadvantage.  Some older peripherals may require that RTS
  65. be raised in order to put them in a "ready to receive" state.
  66.  
  67. In SCO UNIX Release 3.2 Version 4.0 the "stty -clocal -rtsflow -ctsflow
  68. crtsfl -ixon -ixoff" stty settings provides this newer, bidirectional
  69. hardware flow control on modem control ports (uppercase devices such as
  70. tty1A).
  71.  
  72.  
  73. Possible Changes to SCO's RTS/CTS Flow Control
  74. ----------------------------------------------
  75. SCO customers have suggested five changes to the current SCO 
  76. implementation of RTS/CTS hardware flow control.   These changes
  77. will be considered for future releases of SCO operating systems.  The
  78. comments of the technical community are welcomed on this topic.
  79.  
  80. (1) Make "stty rtsflow ctsflow" implement the newer, bidirectional flow 
  81.     control standard described above.  This would allow modem dialers and 
  82.     other programs to have binary compatibility with popular third-party
  83.     serial drivers.  Currently, changing from a standard serial port to a
  84.     port on an intelligent multiport card requires a change to the binary.
  85.  
  86. (2) Implement "stty rtsflow ctsflow" on non-modem control ports.  This 
  87.     would allow the convenient use of printers and other non-modem devices.
  88.     Jumpering CD (Carrier Detect) high on the computer side can present a
  89.     problem with certain styles of hardware.
  90.  
  91. (3) Allow the use of the clocal, ixon, and ixoff settings in conjunction with
  92.     the rtsflow and ctsflow settings.  Other vendors don't require -clocal;
  93.     and it's sometimes desirable to use hardware and software flow control 
  94.     together.
  95.  
  96. (4) Make sure the implementation is correct when the baud rate field
  97.     (c_cflag & CBAUD) is equal to B0.  It should *not* change the
  98.     divisor programmed into the SIO chip, but it *should* drop both RTS
  99.     and DTR signals to that port.  The user thus has brute-force control
  100.     of this pair of signals by switching baud rates between B0 and the
  101.     desired baud rate.  This technique is used by some modem-control
  102.     software in order to hang up modems without having to close the serial
  103.     port (and thus being forced to reprogram all of the other termio states,
  104.     etc.).  
  105.  
  106. (5) Implement the RTS_TOG ioctl(S) call (found in <sys/termio.h>).  This
  107.     ioctl allows programmers to take direct control of the RTS line if
  108.     necessary.  If the integer argument to this ioctl is 0, RTS is
  109.     lowered on the port; if it is 1, RTS is raised.  This ioctl is
  110.     present in AT&T SVR3 and SVR4, and is supported by third-party
  111.     serial drivers under SCO UNIX Release 3.2.
  112.     
  113.  
  114. Additional useful information, thanks to
  115. "Managing UUCP and Usenet" (O'Reilly & Associates, 1990, p.19)
  116. -----------------------------------------------------------------------
  117. "In the RS-232 standard, flow control is defined only for half-duplex
  118.  connections-that is, for connections in which data can be transmitted
  119.  only in one direction at a time.  However, the standard has been
  120.  adapted, de facto, for full-duplex communications as well.
  121.  
  122.  In the half-duplex standard, the DTE asserts RTS when it wants to send
  123.  data.  The DCE replies with CTS when it is ready, and the DTE begins
  124.  sending data.  Unless RTS and CTS are both asserted, only the DCE can
  125.  send data.
  126.  
  127.  However, in the full-duplex variations, RTS/CTS is used as a kind of
  128.  "throttle."  The signals have the opposite meaning than they do for
  129.  half-duplex communications.
  130.  
  131.  Whenever a DTE device is able to accept data, it asserts pin 4. Request
  132.  to Send.  If the DCE is ready to accept data, it asserts pin 5, Clear to
  133.  Send.  If the voltage on the RTS or CTS drops at any time, this tells the
  134.  sending system that the receiver is not ready for more data: "Whoa!
  135.  Hold on till I get my buffers cleared."  Since this flow control
  136.  handshake is implemented in the serial port hardware, it is considerably
  137.  more efficient and reliable than the CTRL-S/CTRL-Q  handshake that can be
  138.  performed in software."
  139. -----end of quote.
  140.  
  141. This reply was masterminded by Bela and Don in SCO's Support department.
  142. We'd also like to thank Robert Lipe from Arnet who provided valuable
  143. input for this write-up.  Also we thank the O'Reilly folks for the quote
  144. from the Nutshell Handbook "Managing UUCP and Usenet" which explains the
  145. two flavors of RTS/CTS flow control; half-duplex and full-duplex.
  146. (contact: nuts@ora.com or ph. 800-338-6887)
  147.  
  148. Please direct any suggestions or comments to belal@sco.com, dond@sco.com,
  149. and dionj@sco.com.
  150.  
  151. Dion L. Johnson
  152. SCO Engineering Technical Liaison       400 Encinal St.   Santa Cruz, CA 95061
  153. Bangpath:                           ...{ucbvax!ucscc, decwrl, uunet}!sco!dionj
  154. Domain:  dionj@sco.com    FAX: 408-458-0811                  Tel: 408-427-7565
  155.  
  156. re:
  157. In article <2A6326A2.6C61@tct.com> chip@tct.com (Chip Salzenberg) writes:
  158. >According to jochen@busybit.mrz.lm.sub.org (Jochen Fahrner):
  159. >>Now, in release 3.2v4, the sio driver also has bidirectional hardware
  160. >>flow control. The new termio flag to switch this on is CRTSFL. They
  161. >>also changed the behaviour of RTSFLOW/CTSFLOW.
  162. >
  163. >Thanks for the pointer; but I just read the termio(M) man page and I
  164. >can't make head nor tail of it the flow control explanation.
  165. >
  166. >Does anyone out there understand:
  167. >
  168. >   1.  What RTSFLOW and CTSFLOW do, singly and in combination,
  169. >         under (A) 3.2v2 and (B) 3.2v4?
  170. >   2.  What CRTSFL does, compared to 1(A) and 1(B)?
  171. >
  172. >Please post some explanation.  I'm very confused.
  173. >-- 
  174. >Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  175.  
  176.  
  177.