*BSD News Article 47626


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!cs.utexas.edu!usc!news.cerf.net!ni1.ni.net!hgac.hgac.com!user
From: harry@hgac.com (Harry Goldschmitt)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: dial up at > 9600 baud
Date: Sat, 22 Jul 1995 13:09:31 -0700
Organization: Network Intensive
Lines: 56
Message-ID: <harry-2207951309310001@hgac.hgac.com>
References: <harry-1807952115390001@hgac.hgac.com>
NNTP-Posting-Host: hgac.hgac.com

In article <harry-1807952115390001@hgac.hgac.com>, harry@hgac.com (Harry
Goldschmitt) wrote:

> I've been trying to configure my FreeBSD 2.0 system to handle dial ups
> at more than 9600 baud.  I have 28.8 modems at both ends.  I can
> successfully dial into ttyd1 when it's slattach'ed at 38400. When I try to
> get to a shell account, even though the modems connect at 28.8, I just get
> garbage instead of the login: prompt.  If I set the non-Freebsd modem to
> 9600 baud, everything works fine.  I think something is happening in
> getty.  I've issued stty commands to see what's happening to the port.
> 

Well the problem is solved. My co-worker Paul Scott and I instrumented the
2.0.5 version of getty.c.  We found the following:

PPP always connected at 9600 baud. Found that in getty.c the open() function
blocks until carrier detected. This happens before the port is set up using
the getty args. Changed getty to use non-blocking open(), then fall through
to set up the port with getty args, and then wait for carrier using ioctl()
similar to slattach. See attached diff file for getty.c in FreeBSD 2.0.5. 

This solution works well. Now modems negotiate for highest common speed. 
These changes may or may not work with direct (non-modem) lines, but since we
are only using modems, I don't care. 

-----------------------------------------------------------
Paul A. Scott                                (714) 991-9460
Tone Software Corporation              FAX - (714) 991-1831
-------------------------------->  e-mail: pas@tonesoft.com

143a144,145
>       int carrier = 0;
>       int comstate = 0;
170c172
<               while ((i = open(ttyn, O_RDWR)) == -1) {
---
>               while ((i = open(ttyn, O_RDWR | O_NONBLOCK)) == -1) {
236a239,249
>               
>               syslog(LOG_NOTICE, "Waiting for carrier on %s", ttyn);
>               /* Now wait for carrier by polling */
>               while (! carrier) {
>                       sleep(2);
>                       ioctl(0, TIOCMGET, &comstate);
>                       if (comstate & TIOCM_CD)
>                               carrier = 1;
>               }
>               syslog(LOG_NOTICE, "Carrier now present on %s", ttyn);
>       

Thanks to all that thought about this.

-- 
Harry Goldschmitt                 |    harry@hgac.com
1226 Starlit Rd.                  |     (714)494-6086 
Laguna Beach, CA 92651-3035       | Fax:(714)494-3072