From owner-freebsd-questions@FreeBSD.ORG Fri Dec 24 15:50:37 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E54916A4CE for ; Fri, 24 Dec 2004 15:50:37 +0000 (GMT) Received: from sa9.bezeqint.net (sa9.bezeqint.net [192.115.104.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2D4243D1D for ; Fri, 24 Dec 2004 15:50:36 +0000 (GMT) (envelope-from nimrod-me@bezeqint.net) Received: from localhost (unknown [127.0.0.1])ESMTP id 8DD2133E63 for ; Fri, 24 Dec 2004 17:46:03 +0200 (IST) Received: from sa9.bezeqint.net ([127.0.0.1]) by localhost (sa9 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22846-10 for ; Fri, 24 Dec 2004 17:46:02 +0200 (IST) Received: from localhost.bsd.net.il (unknown [81.218.176.56])ESMTP for ; Fri, 24 Dec 2004 17:46:02 +0200 (IST) Received: from localhost.bsd.net.il (nimrodm@localhost [127.0.0.1]) by localhost.bsd.net.il (8.12.9p2/8.12.9) with ESMTP id iBOGk0uk003755 for ; Fri, 24 Dec 2004 18:46:00 +0200 (IST) (envelope-from nimrodm@localhost.bsd.net.il) Received: (from nimrodm@localhost) by localhost.bsd.net.il (8.12.9p2/8.12.6/Submit) id iBOGjxNQ003754 for questions@freebsd.org; Fri, 24 Dec 2004 18:45:59 +0200 (IST) From: Nimrod Mesika Date: Fri, 24 Dec 2004 18:45:59 +0200 To: questions@freebsd.org Message-ID: <20041224164559.GA3727@localhost.bsd.net.il> Mail-Followup-To: questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: amavisd-new at bezeqint.net Subject: ppbus programming / porting freenomad to FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2004 15:50:37 -0000 Hi all, I'm trying to port 'freenomad' (an abandoned sourceforge project) from Linux to FreeBSD. The software uses the Linux parallel port framework (parport) to setup a simple IEEE 1284 ECP session. It seems like the equivalent functionality is provided by FreeBSD's ppbus(4). However, I can't find any documentation/example code for using ppbus from a userland application. Specifically, the Linux app does the following: 1. open("/dev/parport0", O_RDWR) 2. Claim the port (Linux ioctl PPCLAIM) 3. Negotiate ECP (Linux ioctl PPNEGOT with arg. IEEE1284_MODE_ECP) Before reading or writing it sets the parallel port direction 4. ioctl( fd, PPDATADIR, &direction ) (direction=0/1) 5. write() or read() using the handle returned by open() On exit 6. Release the port: ioctl( fd, PPRELEASE ) 7. close(fd) I need to find the equivalent code for FreeBSD and would appreciate any pointers you might have. Thanks, Nimrod.