From owner-freebsd-current@FreeBSD.ORG Mon Aug 11 01:25:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5233937B401 for ; Mon, 11 Aug 2003 01:25:30 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 91C7543F85 for ; Mon, 11 Aug 2003 01:25:29 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 11 Aug 2003 09:25:28 +0100 (BST) To: Christopher Nehren In-Reply-To: Your message of "10 Aug 2003 19:12:22 EDT." <1060557141.755.29.camel@prophecy.velum> Date: Mon, 11 Aug 2003 09:25:26 +0100 From: Ian Dowse Message-ID: <200308110925.aa06499@salmon.maths.tcd.ie> cc: current@freebsd.org Subject: Re: PLIP transmit timeouts -- any solutions? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 08:25:31 -0000 In message <1060557141.755.29.camel@prophecy.velum>, Christopher Nehren writes: > >--=-7MVWKH2AJ0lqXf3q30++ >Content-Type: text/plain >Content-Transfer-Encoding: quoted-printable > >I currently have a PLIP link to an old laptop running Linux (I tried to >install FreeBSD, but it freezes at the USB detection -- yes, I tried Try the following patch. I can't remember if all the changes in this are necessary, but I think I found it fixed problems when interoperating with a Linux-like PLIP implementation. If I remember correctly, the PLIP implementation I saw used the data bits that came in the very first read that had the correct handshake signal, whereas FreeBSD readers do one extra read after the handshake to ensure that the signal is stable (i.e. that implementation used an "unsafe" read and a "safe" write, whereas FreeBSD's uses a "safe" read and an "unsafe" write). This patch causes both read and write to be "safe". The removal of the use of ctxmitl[] seems to be unnecessary. Ian Index: if_plip.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/dev/ppbus/if_plip.c,v retrieving revision 1.28 diff -u -r1.28 if_plip.c --- if_plip.c 4 Mar 2003 23:19:54 -0000 1.28 +++ if_plip.c 12 Mar 2003 07:09:43 -0000 @@ -409,12 +409,14 @@ static __inline int clpoutbyte (u_char byte, int spin, device_t ppbus) { - ppb_wdtr(ppbus, ctxmitl[byte]); + ppb_wdtr(ppbus, byte & 0xf); + ppb_wdtr(ppbus, (byte & 0xf) | 0x10); while (ppb_rstr(ppbus) & CLPIP_SHAKE) if (--spin == 0) { return 1; } - ppb_wdtr(ppbus, ctxmith[byte]); + ppb_wdtr(ppbus, ((byte & 0xf0) >> 4) | 0x10); + ppb_wdtr(ppbus, ((byte & 0xf0) >> 4)); while (!(ppb_rstr(ppbus) & CLPIP_SHAKE)) if (--spin == 0) { return 1;