From owner-freebsd-questions@FreeBSD.ORG Thu Dec 23 21:16:36 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 E32A816A4CE for ; Thu, 23 Dec 2004 21:16:36 +0000 (GMT) Received: from sa2.bezeqint.net (sa2.bezeqint.net [192.115.104.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3081143D46 for ; Thu, 23 Dec 2004 21:16:36 +0000 (GMT) (envelope-from nimrod-me@bezeqint.net) Received: from localhost (unknown [127.0.0.1])ESMTP id 38AA834FD0 for ; Thu, 23 Dec 2004 23:11:51 +0200 (IST) Received: from sa2.bezeqint.net ([127.0.0.1]) by localhost (sa2 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17839-04 for ; Thu, 23 Dec 2004 23:11:50 +0200 (IST) Received: from localhost.bsd.net.il (unknown [82.81.86.251])ESMTP for ; Thu, 23 Dec 2004 23:11:50 +0200 (IST) Received: from localhost.bsd.net.il (nimrodm@localhost [127.0.0.1]) iBNMBvv6001754 for ; Fri, 24 Dec 2004 00:11:58 +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 iBNMBvIX001753 for freebsd-questions@freebsd.org; Fri, 24 Dec 2004 00:11:57 +0200 (IST) From: Nimrod Mesika Date: Fri, 24 Dec 2004 00:11:57 +0200 To: freebsd-questions@freebsd.org Message-ID: <20041223221157.GA1577@localhost.bsd.net.il> Mail-Followup-To: freebsd-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: Thu, 23 Dec 2004 21:16: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.