Subject: Re: multi-port serial on NetBSD PPC (long)
To: Donald Lee <donlee_ppc@icompute.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 12/05/2000 09:14:48
On Mon, 4 Dec 2000, Donald Lee wrote:

> >In the source I have, the cy driver calles the line discipline around line
> >487 of sys/dev/ic/cy.c, in the cyioctl() routine. The code looks like:
> >
> >        error = (*tp->t_linesw->l_ioctl) (tp, cmd, data, flag, p);
> >        if (error >= 0)
> >                return error;
> >
> >For 1.5, it was "error = (*linesw[tp->t_line].l_ioctl) (tp, cmd, data, ..."
> 
> Is what you have -current?  Should I try that?  I'd _really_ like
> to get this working.

NO! Don't try the line from -current. As Allen pointed out, how line
disciplines work has changed a smigeon in -current.

The point I was trying to make is that the cy driver already had support
for ioctl's, not that you had to change code.

> I have tried many times, and failed, to get ppp to work on any macppc
> box.  I've tried 1.4.1, 1.4.2, and 1.5 beta.  All failed.  I've not
> tried 1.4.3 or 1.5 (latest).  I'm using the same modems, cables, and setups that
> work quite well on my 68K boxes.  Most of my kernels are straight from the
> distributions.  I've also tried buildig my own.

My suggestion to you is to keep digging into pppd. Something somewhere in
your setup is wrong, in a very subtle way. I'd suggest digging through the
pppd source, and finding out where it's doing the wrong thing.

> some output from the log file, w/ debug and kdebug set in pppd options.

Most of this is useless to me as I don't know the ppp protocols that well.

> Dec  3 14:57:53 pm7600 pppd[495]: pppd 2.4.0 started by donlee, uid 1001
> Dec  3 14:57:55 pm7600 pppd[495]: Serial connection established.
> Dec  3 14:57:55 pm7600 pppd[495]: Using interface ppp1
> Dec  3 14:57:55 pm7600 pppd[495]: Connect: ppp1 <--> /dev/tty03
> Dec  3 14:57:58 pm7600 /netbsd: ppp1: got 24 bytes

> Dec  3 14:58:08 pm7600 pppd[495]: user donlee logged in

> Dec  3 14:58:08 pm7600 pppd[495]: Unsupported protocol 'Appletalk Control Protoc
> ol' (0x8029) received

Ok, other side used some Apple protocol which we didn't understand..

> Dec  3 14:58:09 pm7600 pppd[495]: Could not determine local IP address

This error looks really suspicious. This message comes from
ipcp.c:ipcp_up(), and is below the following comment:

    /*
     * We must have a non-zero IP address for both ends of the link.
     */

I suspect if you figure out why pppd isn't able to determine its local
address, you'll be set.

> Dec  3 14:58:10 pm7600 /netbsd: ppp1: got 8 bytes
> Dec  3 14:58:10 pm7600 /netbsd: ff03c02106030004
> Dec  3 14:58:10 pm7600 pppd[495]: Connection terminated.
> Dec  3 14:58:10 pm7600 pppd[495]: Connect time 0.3 minutes.
> Dec  3 14:58:10 pm7600 pppd[495]: Sent 337 bytes, received 341 bytes.
> Dec  3 14:58:10 pm7600 pppd[495]: Serial link disconnected.
> Dec  3 14:58:14 pm7600 pppd[495]: Hangup (SIGHUP)
> Dec  3 14:58:15 pm7600 pppd[495]: Serial connection established.
> Dec  3 14:58:15 pm7600 pppd[495]: Using interface ppp1
> Dec  3 14:58:15 pm7600 pppd[495]: Connect: ppp1 <--> /dev/tty03
> Dec  3 14:58:15 pm7600 pppd[495]: Hangup (SIGHUP)
> Dec  3 14:58:15 pm7600 pppd[495]: Modem hangup
> Dec  3 14:58:15 pm7600 pppd[495]: Connection terminated.
> Dec  3 14:58:16 pm7600 pppd[495]: Couldn't restore device fd flags: Inappropriat
> e ioctl for device
> Dec  3 14:58:16 pm7600 pppd[495]: ioctl(TIOCSETD): Inappropriate ioctl for devic
> e
> Dec  3 14:58:16 pm7600 pppd[495]: tcsetattr: Inappropriate ioctl for device
> Dec  3 14:58:41 pm7600 pppd[495]: Connect script failed
> Dec  3 14:59:16 pm7600 last message repeated 3 times
> Dec  3 15:00:00 pm7600 newsyslog[537]: logfile turned over
> Dec  3 14:59:46 pm7600 last message repeated 2 times
> 
> 
> I tried a number of variations of options to set up the IP addresses, with
> both explicit and implicit setting in ppp's options files.
> 
> In the log files on the Mac that was trying to connect, it always reported
> that the IP address being offered by NetBSD was 0.0.0.0 on both ends of
> the wire.

As above, I'd suggest focus on figuring out why the local IP address isn't
working right. Also, you might ask on current-users or netbsd-users (I
don't read the latter). At least at this point, your problem looks like a
general ppp problem (which might somehow be ppc-specific, but I doubt
that).

Good luck!

Take care,

Bill