On Sun, Jun 23, 2002 at 12:15:01PM +0200, Martin Faxer wrote:
> hi!
> 
> i'm trying to write a driver for an old cd-rom drive that you connect
> to the parallel port.  it is a shuttletech "para drive" 525.
> 
> i don't have any driver docs or technical specifications but i believe
> that it uses some kind of a SCSI to parallel chipset.

The problem will be that FreeBSD ppbus framework is much more
timing-sensitive than Linux parport. Without the tech sheets it may be
hard.

> the linux tree seems to have drivers for shuttletech EPSA-2 chipsets,
> so i'm currently trying to port their probe routines to FreeBSD to see
> if my cd-rom is indeed equipped with one of those chipsets.

The best is certainly to install Linux on some partition and check that
your drive is supported, then port the driver.

> the linux code uses outb() and inb() directly to communicate with the
> parallel port so i have to port it to use the ppbus interface.
> 
> here are my questions:
> 1) do the ppb_[rw][dcs]tr() functions have any "side effects", like
>    eg. does ppb_wdtr() drive strobe high or something like that to
>    tell the device that there is data waiting, or is it simply a
>    wrapper around outb() ? (ps. i tried to find the code for these

A wrapper.

>    functions but didn't succeed since the macros make use of PPBUS_IO()
>    which is generated and calls some other function.)
> 
>    if the ppb_[rw][dcs]tr() function have side effects, are there any
>    lower level functions which simply wrap around inb() and outb() ?
> 
> 2) do the ppb_[rw][dcs]tr() functions wait, or do i have to call some
>    function to do that, like DELAY() ? the linux code calls usleep()
>    after sending commands to the device.  (i believe it is bad to call
>    DELAY() in a _probe() routine, but perhaps i can do that to start
>    with...)
> 
> 3) should i use micro sequences instead of doing ppb_*() calls ?
>    i looked briefly at the man page but it seemed pretty complicated
>    and i'm not a very experienced kernel hacker yet.

Yes, certainly. Microsequences offer you a general mechanism for bypassing
the overhead of the newbus framework.

> i would be very grateful for any answers or tips you might have!

The task will not be easy :) Note that the first version of the vpo driver
was a port of Linux driver. Then I rewrote it completly from specs.

outb and inb might be used as well, but they're not portable. You should
use ppb_xxx() routines preferably or even microsequences.

Nicholas

-- 
Nicholas Souchu - [EMAIL PROTECTED] - [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to