Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!ctisbv!pim From: pim@cti-software.nl (Pim Zandbergen) Newsgroups: comp.unix.i386 Subject: which multiport i/o cards pass this test? Message-ID: <1990Aug21.180653.615@cti-software.nl> Date: 21 Aug 90 18:06:53 GMT Organization: CTI Software BV, The Hague, The Netherlands Lines: 165 Hi netfolk, I am currently looking for a multiport I/O card to replace Specialix, because the Dutch distributor has stopped importing them. I have evaluated some cards but lots of their drivers have trouble with correctly handling modem control. This prevents them from working with the intelligent modem feature in HDB UUCP: "ttyxx,M" in Devices means open with O_NDELAY set and "\M" and "\m" in Dialers means set and clear the CLOCAL flag. The problem is that with these drivers, the O_NDELAY flag cannot be properly cleared when carrier detect is not present. I have noticed this problem with the stock ISC asy driver, with Specialix drivers older than release 3.03, with the Equinox Megaport 1.8.2 driver (a pity, I like this card) and the Chase Research AT8+ 4.02a driver. In fact, the only working drivers I have seen are the Specialix 3.03 and the PORTS and EPORTS drivers for the AT&T 3B2. Rather than evaluate every card on the market myself I would appreciate very much if you would run my little test program and mail me the result. I *think* this program emulates HDB UUCP behaviour. I only tested it on ISC 386/ix 2.0.2 and on the AT&T 3B2. If any UNIX guru would like to comment, please feel free. The crucial moment in this program is the read(). It should block, waiting for input, but returns immediately with zero bytes read on lots of cards. You should run this program on a port that has no cable whatsoever attached to it, nor should any other process have this port opened (ie. no getty's running). The port should implement modem control, ie. "> /dev/ttyxx" should hang. Thanks in advance for you help. #--------------------------------CUT HERE------------------------------------- #! /bin/sh # # This is a shell archive. Save this into a file, edit it # and delete all lines above this comment. Then give this # file to sh by executing the command "sh file". The files # will be extracted into the current directory owned by # you with default permissions. # # The files contained herein are: # # -rw------- 1 pim other 2232 Aug 21 19:27 modemtest.c # echo 'x - modemtest.c' if test -f modemtest.c; then echo 'shar: not overwriting modemtest.c'; else sed 's/^X//' << '________This_Is_The_END________' > modemtest.c X#include X#include X#include X#include X#include X Xmain(argc, argv) X int argc; X char *argv[]; X{ X int fcntl_flags; X int fd; X extern int errno; X extern unsigned alarm(); X char buf[1]; X char *usage = "usage: %s \n"; X extern char *sys_errlist[]; X struct termio termio_flags; X struct termio old_termio_flags; X void on_alarm(); X extern void exit(); X X X if (argc != 2) X { X (void) fprintf(stderr, usage, argv[0]); X exit(1); X } X X (void) printf("opening %s with O_NDELAY set\n", argv[1]); X if ((fd = open(argv[1], O_RDWR | O_NDELAY)) < 0) X { X (void) fprintf(stderr, "%s: can't open %s: %s\n", X argv[0], argv[1], sys_errlist[errno]); X exit(2); X } X X (void) printf("clearing O_NDELAY flag\n"); X if ((fcntl_flags = fcntl(fd, F_GETFL, 0)) == -1) X { X (void) fprintf(stderr, "%s: can't get fcntl flags: %s\n", X argv[0], sys_errlist[errno]); X exit(3); X } X fcntl_flags &= ~(O_NDELAY); X if (fcntl(fd, F_SETFL, fcntl_flags) == -1) X { X (void) fprintf(stderr, "%s: can't set fcntl flags: %s\n", X argv[0], sys_errlist[errno]); X exit(4); X } X X (void) printf("setting CLOCAL\n"); X if (ioctl(fd, TCGETA, &termio_flags) < 0) X { X (void) fprintf(stderr, "%s: can't get termio flags: %s\n", X argv[0], sys_errlist[errno]); X exit(5); X } X old_termio_flags = termio_flags; /* save original modes */ X termio_flags.c_cflag |= CLOCAL; X if (ioctl(fd, TCSETAW, &termio_flags) < 0) X { X (void) fprintf(stderr, "%s: can't set termio flags: %s\n", X argv[0], sys_errlist[errno]); X exit(6); X } X X (void) printf("reading from %s\n", argv[1]); X (void) signal(SIGALRM, on_alarm); X (void) alarm((unsigned) 10); X if ((read(fd, buf, 1) < 1) && (errno == EINTR)) X (void) printf("test succesful\n"); X else X (void) printf("test failed\n"); X X X (void) printf("clearing CLOCAL\n"); X if (ioctl(fd, TCSETAW, &old_termio_flags) < 0) X { X (void) fprintf(stderr, "%s: can't restore termio flags: %s\n", X argv[0], sys_errlist[errno]); X exit(7); X } X X X (void) printf("exiting\n"); X return 0; X} X Xvoid Xon_alarm() X{ X (void) printf("caught SIGALRM\n"); X} ________This_Is_The_END________ if test `wc -c < modemtest.c` -ne 2232; then echo 'shar: modemtest.c was damaged during transit (should have been 2232 bytes)' fi fi ; : end of overwriting check exit 0 -- Pim Zandbergen domain : pim@cti-software.nl CTI Software BV uucp : uunet!mcsun!hp4nl!ctisbv!pim Laan Copes van Cattenburch 70 phone : +31 70 3542302 2585 GD The Hague, The Netherlands fax : +31 70 3512837