From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 15 21:59:11 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C94716A4CE for ; Mon, 15 Mar 2004 21:59:11 -0800 (PST) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 761D243D69 for ; Mon, 15 Mar 2004 21:59:10 -0800 (PST) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.9/8.12.8) with ESMTP id i2G5x6Q9029684; Tue, 16 Mar 2004 16:29:07 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Tue, 16 Mar 2004 16:29:04 +1030 User-Agent: KMail/1.6 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200403161629.04021.doconnor@gsoft.com.au> X-Spam-Score: 0.6 (*) CARRIAGE_RETURNS,SPAM_PHRASE_00_01,USER_AGENT X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) Subject: How to write a new line discipline? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2004 05:59:11 -0000 Hi, My company uses RS485 to talk to various pieces of hardware, and currently to do this we have a hacked up copy of sio which talks to a conventional RS485 card, while this works well it would be nicer to be able to use different 485 cards via the puc driver instead of having to use a custom driver. Our custom driver only understands 8250/16550/etc UARTS which is another limitation (not currently an issue though :) It was suggested a while ago by phk (I think..) that a line discipline would be the best approach, and I think this makes sense. The protocol in question uses the parity bit as a 9th bit to signal an address byte (only 256 addresses on this bus). I can't see how a line discipline can directly control and read the parity information, and to set various control lines (specifically RTS) to switch the transceiver into transmit mode when necessary. The current disciplines seem to be either very very old, or 'hacks' for things like PPP or SLIP :( -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5