[comp.unix.ultrix] Ultrix 3.1C uucp will not dial a LAT terminal modem

D. Allen [CGL]) (09/17/90)

I have a host-initiated LAT tty pointing at a DS200/MC port.  I thought
I'd check to see that the Ultrix 3.1C kernel knows how to deal with modem
control on LAT tty lines.  I configure /dev/tty55 using

    lcp -h /dev/tty55:CGLDSB:PORT_3

I verify that I can "tip" to it (not using /etc/acucap, though) and talk
to my modem.  No problem.  I then run this:

#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/file.h>

main()
{
	int r;
	static int yes = 1;
	static int no = 0;

	int u = open("/dev/tty55", O_RDWR|O_NDELAY, 0);

	if( u < 0 ){
		perror("/dev/tty55 open");
	}

	r = ioctl(u, TIOCMODEM, &yes);
	if( r < 0 ){
		perror("/dev/tty55 TIOCMODEM");
	}

	r = ioctl(u, TIOCCAR, &yes);
	if( r < 0 ){
		perror("/dev/tty55 TIOCCAR");
	}

	alarm(60);
	r = ioctl(u, TIOCWONLINE, &yes);
	if( r < 0 ){
		perror("/dev/tty55 TIOCWONLINE");
	}
	alarm(0);

	exit(0);
}

I run the above program and get this:

    /dev/tty55 TIOCMODEM: Not a typewriter
    /dev/tty55 TIOCWONLINE: Not a typewriter

So much for that.  Looks like LAT ttys are not full ttys.  I wish it said
this somewhere in the documentation, so I didn't have to waste all this
time trying to use them.  Uucp and tip use the TIOCWONLINE ioctl via the
aculib code to wait for carrier, and since they don't check the return
code from the ioctl, it appears to "succeed", only to have it fail
immediately because no "CONNECT" string is found.

Please, people, check the return codes of your system calls!

I think I finally have to admit defeat and move my uucp call-out modem
off my DS200/MC onto a MVII serial card.  Does Ultrix 4.0 support real
modem signals on host-initiated LAT connections?  (Oh please?)
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada

D. Allen [CGL]) (09/17/90)

Oh, LAT ttys don't support TIOCCDTR or TIOCSDTR either:

    /dev/tty55 TIOCCDTR: Not a typewriter
    /dev/tty55 TIOCSDTR: Not a typewriter
    /dev/tty55 TIOCMODEM: Not a typewriter
    /dev/tty55 TIOCWONLINE: Not a typewriter

So it looks like you can't use an Ultrix LAT tty in any application where
your program wants to manipulate or know about modem control signals.
This makes "shared" in/out LAT lines impossible under Ultrix, doesn't it?

Ultrix 3.1C uucp/tip don't check the return status of their ioctl calls, so
they just fail silently.

Why isn't this deficiency in BIG BOLD LETTERS in the LAT documentation,
the lta(4) man page, and the tty(4) man page?  Aaargh what a waste of time.
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada

thomas@mipsbx.lkg.dec.com (Matt Thomas) (09/17/90)

In article <1990Sep17.063335.17243@watcgl.waterloo.edu> idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) writes:
>I verify that I can "tip" to it (not using /etc/acucap, though) and talk
>to my modem.  No problem.  I then run this:

>So much for that.  Looks like LAT ttys are not full ttys.  I wish it said
>this somewhere in the documentation, so I didn't have to waste all this
>time trying to use them.  Uucp and tip use the TIOCWONLINE ioctl via the
>aculib code to wait for carrier, and since they don't check the return
>code from the ioctl, it appears to "succeed", only to have it fail
>immediately because no "CONNECT" string is found.

LAT will connect during the open sequence.  One the open finishes, either
you are connected (0 is returned) or it failed.  The line may or may not
have carrier but LAT doesn't (can't) know that.  I could support TIOCWONLINE
but it would always return success and would never sleep.  Would that help
any?

>Please, people, check the return codes of your system calls!

>I think I finally have to admit defeat and move my uucp call-out modem
>off my DS200/MC onto a MVII serial card.  Does Ultrix 4.0 support real
>modem signals on host-initiated LAT connections?  (Oh please?)

It can't.  The LAT protocol does not contain any support for manipulation
or control of modem signals beyond the act of connecting to the port.

Matt Thomas                     Internet:   thomas@wrl.dec.com
DECnet-ULTRIX Development       UUCP:       ...!decwrl!thomas
Digital Equipment Corporation   Disclaimer: This message reflects my own
Littleton, MA                               warped views, etc.

D. Allen [CGL]) (09/19/90)

In article <15412@shlump.nac.dec.com> thomas@mipsbx.lkg.dec.com (Matt Thomas) writes:
>LAT will connect during the open sequence.  One the open finishes, either
>you are connected (0 is returned) or it failed.  The line may or may not
>have carrier but LAT doesn't (can't) know that.  I could support TIOCWONLINE
>but it would always return success and would never sleep.  Would that help
>any?

No, TIOCWONLINE should not be supported if it doesn't work.  *You* don't
have to do anything -- the fellow who added stuff to UUCP and didn't
check his system calls has to clean up his act.

>The LAT protocol does not contain any support for manipulation
>or control of modem signals beyond the act of connecting to the port.

I wish my sales reps had known that before I bought three DS200/MC
terminal servers and tried for days to make UUCP work on them.  UUCP
and TIP have all this wonderful code for setting baud rates and using
serial lines, and it's all useless on Ultrix LAT ports.  I have a pair
of DS5400's sitting here and I have to put my outgoing TIP and UUCP
line on a MVII!
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada