Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 2004 18:45:59 +0200
From:      Nimrod Mesika <nimrod-me@bezeqint.net>
To:        questions@freebsd.org
Subject:   ppbus programming / porting freenomad to FreeBSD
Message-ID:  <20041224164559.GA3727@localhost.bsd.net.il>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041224164559.GA3727>