[comp.sys.hp] RS232 Hardware Handshaking

paul@mecazh.uu.ch (Paul Breslaw) (08/30/90)

We have upgraded a working 2400 baud UUCP/CU system with a 9600 baud modem, 
and a new serial multiplexer card. It is some time since we looked at the 
way the system was configured, and because the modem is now faster than some 
of our callers, we need to introduce a few features that were not present on 
our old system.

That is where our problems began. To the details:-

Machine: HP9000/330
OS     : HP-UX 6.5
MUX    : HP 98642
Modem  : Multitech V.32

Requirements:-

 - Bi-directional UUCP on the same serial port.
 - Call-in and call-out cu(1) on the same port as the UUCP.
 - Hardware (CTS/RTS) handshaking initiated by the modem.

This last requirement is to take advantage of the modem's capability of 
locking its speed with the computer regardless of the speed of its line 
connection. The benefit of this is that the gettydef entry is simple, and so 
are my UUCP callers' chat scripts, since they do not have to send the right
number of BREAKs for their individual connection speeds. (In fact they don't 
have to send BREAK's at all).

We need to know the following information.

 1. What is the correct cable to use.
 2. What is the correct getty to run (ie getty or uugetty).
 3. What is the correct gettydef entry.
 4. What are the correct minor device numbers for:-

      /dev/cua13          the auto-dialler line
      /dev/cul13          the uucp call out line
      /dev/ttyd13         the dial-in (getty) line
      /dev/tty13          to set up the modem (ie. cu -s 9600 dir)

Our previous configuration works fine except for the hardware-handshaking.

With regard to getty, we have used uugetty in the past. But I have noticed 
recently from modem(7) and various utterances on the Net that bog-standard 
getty will do.

The minor device number seems to be a major stumbling block, because
nobody at HP whom I spoke to had had any experience of using the same line 
as call-in/call-out. 

Further the HP documentation is contradictory about bit 3. One piece of 
documentation states that as of HP-UX 5.2 Bit 3 of the minor device number 
implements CTS/RTS handshaking. The spec for the HP98642 says NA against 
Bit 3. The documentation for modem(7) says that setting the device to CCITT 
mode (Bit 2) enables handshaking, as did someone at HP.

Can anyone who has actually had this working, provide the information I need.


Paul Breslaw

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Breslaw, Mecasoft SA,          |  telephone :  41 1 362 2040
Guggachstrasse 10, CH-8057 Zurich,  |  e-mail    :  paul@mecazh.uu.ch
Switzerland.                        |               mcsun!chx400!mecazh!paul

perry@hpfcdc.HP.COM (Perry Scott) (09/05/90)

>The minor device number seems to be a major stumbling block, because
>nobody at HP whom I spoke to had had any experience of using the same line 
>as call-in/call-out. 

Create two devices - cuaXX/culXX and ttyXX.

mknod /dev/cuaXX c 1 0x0d0001		# uucp call-out
ln /dev/cuaXX /dev/culXX
mknod /dev/ttyXX c 1 0x0d0000		# uucp call-in

Put a getty on /dev/ttyXX for call-in.


>Further the HP documentation is contradictory about bit 3. One piece of 
>documentation states that as of HP-UX 5.2 Bit 3 of the minor device number 
>implements CTS/RTS handshaking. The spec for the HP98642 says NA against 
>Bit 3. The documentation for modem(7) says that setting the device to CCITT 
>mode (Bit 2) enables handshaking, as did someone at HP.

The 300 MUX driver responds to changes on the CTS line if you |= 0x08.
It is a hack; and is equivalent in the driver to receiving XOFF.

Since the MUX itself is not handling the pacing, you may experience the
MUX dribbling up to 16 characters after CTS goes low.  If that is a
problem, limit the transmitter buffer size.  This is from the driver:

define TXLIMIT 0x000030        /* minor number field */
u_char mux_tx_limit[4] = {16,8,4,1};    /* max chars sent after getting XOFF */

So, |= 0x00 => 16 bytes, |= 0x10 => 8 bytes, ..., |= 0x30 => 1 byte.
Setting this to one byte will make your CPU work harder.


I don't know if HP officially supports this - it was originally done to
get some big-deal business.  It works on against a 4955 protocol analyzer,
but never tried on a Swiss modem.  Caveat emptor....

Perry Scott

graham@hparc0.HP.COM (Graham Eddy) (09/27/90)

so far as i am aware, for the 98642A MUX, minor number bit 3 enables
CTS/RTS flow control and bits 4-5 indicate silo size (viz. how full
the buffer must be before it looks at handshaking..)

-graham "but don't quote me"

wehr@fmeed1.UUCP (Bruce Wehr) (10/19/90)

In article <1510002@hparc0.HP.COM>, graham@hparc0.HP.COM (Graham Eddy) writes:
> so far as i am aware, for the 98642A MUX, minor number bit 3 enables
> CTS/RTS flow control and bits 4-5 indicate silo size (viz. how full
> the buffer must be before it looks at handshaking..)

I was told that no HP serial port does full hardware handshaking ...
bit 3 enables handshaking in one direction only (I don't remember which
one).  I would *greatly* appreciate someone telling me that this isn't
true :-)

I would almost *kill* for full hardware handshaking.  Does anyone have
the real scoop?

(If I'll stumble across the answer whilst I'm catching up, you are
cordially invited to ignore this message :-)

-- 
	       Bruce Wehr (wehr%dptc.decnet@srlvx0.srl.ford.com)
 (...uunet!mailrus!sharkey!fmeed1!wehr) (wehr%fmeed1.uucp@mailgw.cc.umich.edu)
		   Ford Motor Company - Electronics Division
  17000 Rotunda Drive, ETC Room LN081, Dearborn, Michigan 48121 (313)845-3039

rjn@hpfcso.HP.COM (Bob Niland) (10/23/90)

re: > I was told that no HP serial port does full hardware handshaking ...
    > bit 3 enables handshaking in one direction only (I don't remember
    > which one).  I would *greatly* appreciate someone telling me that this
    > isn't true :-)

Not true.

re: Advanced Serial Driver                                   Date: 23 Oct 90

Here are the things you can control on the 400 #1 and 345/375 serial port
with the 7.05 or pre-release 7.0/7.03 driver.  Some of this is not yet
documented in any published manuals.  Contact your HP support representative
for a copy of the driver.  Have them contact me if they don't have it.

Permissions    Owner    Group  Major Minor    Last write   File name
crw--w--w-   1 root     crm        1 0x090000 Feb 28 09:39 tty09
crw-rw-rw-   1 root     other      1 0x090001 Nov  4  1988 cua09
crw-rw-rw-   1 root     other      1 0x090001 Feb 12 14:17 cul09
#
# example LP files
#
crw--w--w-   1 root     bin        1 0x0900cc Mar 19 11:44 lp
crw-rw-rw-   1 lp       bin        1 0x0900cc Mar  1  1989 rlp
                                     ^^^^^^^^
                                        |
              __________________________/
             /
             |
             V
  TERMINALS:
        0xScPoAc where
                Sc = card select code (05, 06, 09)
                Po = port number (98642); 00 for other cards
                Ac = access type
        Access type bit fields: AABB CDEF
                AA =   receive fifo trigger level
                        00 =  1
                        01 =  4
                        10 =  8
                        11 = 14
 
                BB =   effective tx fifo size
                        00 = 12  (16 on all other buffered cards)
                        01 =  8
                        10 =  4
                        11 =  1
                AA/BB only on 345/375 built-in port 09, 98628A, 98638A and
		      98642A
 
                C = 0  hardware handshake disabled  (CTS/RTS)
                C = 1  hardware handshake enabled
                       CTS available on all built-in 05, 06, 09, 98626A,
		           98628A, 98638A and 98642A port 0
                       RTS available on 345/375/400 built-in 09
 
                D = 0  modem (or modem eliminator)
                D = 1  direct connect
                       Not supported on 98642A ports 1,2,3
 
                E = 0  US modems
                E = 1  CCITT mode (for European modem support)
                       Not supported on 98642A ports 1,2,3
 
                F = 0  call-in port
                F = 1  call-out port (for cu* devices)
 

In addition, UNIX (HP-UX) routinely allows control of the following items.
See the termio(7) manual page in the HP-UX Reference Manual for details.

speed 19200 baud; line = 0; susp <undef>; dsusp <undef>
intr = ^C; quit = ^\; erase = ^H; kill = ^U; swtch = ^@
eof = ^D; eol = ^@; min = 4; time = 0; stop = ^S; start = ^Q
-parenb -parodd cs8 -cstopb -hupcl cread clocal -loblk -crts 
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
ixon ixany -ixoff -ienqak 
isig icanon iexten -xcase echo echoe echok -echonl -noflsh 
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop 

Note "ienqak" is ignored on the 300 and 800.


# example /etc/inittab entries (don't use both on the same port)
#
09:2:respawn:/etc/getty -h tty09 HST
09:2:respawn:/etc/getty -h lp LPH    {if using CTS flow control}
09:2:respawn:/etc/getty -h lp LP     {if not}


# example customized /etc/gettydef entries
# The "LP" and "LPH" entry keeps the port properly configure for unspooled I/O.
#
LP# B19200 SANE CS8 ONLCR CLOCAL IXON IXANY TAB3 OPOST ###LP
LPH# B19200 SANE CS8 ONLCR CLOCAL TAB3 OPOST ###LPH
HST# B19200 SANE HUPCL CS8 ISTRIP IXON IXOFF # B19200 SANE HUPCL CS8 ISTRIP IXON IXOFF #HST login: #HST

# example /usr/lib/uucp/Devices entries (HST modem)
#
<type> <cul> <cua> <speed> PROG/usr/lib/dialit <type> /dev/<cul> \T \S \P
Direct tty09 0 19200 direct
Direct cul09 0 19200 direct
ACUHP92205A cul09 cua09 19200 hp92205A

Regards,                                              Hewlett-Packard
Bob Niland                                            3404 East Harmony Road
Internet: rjn@hpfcrjn.FC.HP.COM                       Fort Collins
UUCP: [hplabs|hpu*!hpfcse]!hpfcrjn!rjn                CO          80525-9599